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