allow "tokens {}"

This commit is contained in:
Terence Parr 2012-09-28 16:39:36 -07:00
parent c8a51ccfad
commit ea652962ea
3 changed files with 7 additions and 6 deletions

View File

@ -1,9 +1,13 @@
ANTLR v4 Honey Badger
September 28, 2012
* empty "tokens {}" is ok now.
September 22, 2012
* Rule exception handlers weren't passed to the generated code
* $ruleattribute.foo weren't handled properly
* Added -package option
September 18, 2012 -- 4.0b1 release
September 18, 2012 -- 4.0b1 release

View File

@ -1,12 +1,8 @@
grammar T;
<<<<<<< .merge_file_0gRgFB
s : A ;
A : 'a';
=======
tokens {}
s : INT+ ;
ID : [a-z]+ ;
INT : [0-9]+ ;
WS : [ \t\n]+ -> skip ;
>>>>>>> .merge_file_bd3U11

View File

@ -284,6 +284,7 @@ delegateGrammar
*/
tokensSpec
: TOKENS_SPEC id (COMMA id)* RBRACE -> ^(TOKENS_SPEC id+)
| TOKENS_SPEC RBRACE ->
;
// A declaration of a language target specifc section,