fix failing test generation

failed in Python because « type » is reserved
This commit is contained in:
ericvergnaud 2015-06-21 00:42:36 +08:00 committed by parrt
parent 707dbb9f8f
commit fe13b23628
1 changed files with 4 additions and 4 deletions

View File

@ -23,7 +23,7 @@ masterGrammar(grammarName, slaveGrammarName) ::= <<
grammar M;
import S;
prog : decl ;
type : 'int' | 'float' ;
type_ : 'int' | 'float' ;
ID : 'a'..'z'+ ;
INT : '0'..'9'+ ;
WS : (' '|'\n') -> skip;
@ -31,8 +31,8 @@ WS : (' '|'\n') -> skip;
slaveGrammar(grammarName) ::= <<
parser grammar S;
type : 'int' ;
decl : type ID ';'
| type ID init ';' {<write("\"JavaDecl: \" + $text")>};
type_ : 'int' ;
decl : type_ ID ';'
| type_ ID init ';' {<write("\"JavaDecl: \" + $text")>};
init : '=' INT;
>>