wasn't walking lexer rule trees right.

[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9874]
This commit is contained in:
parrt 2012-01-20 15:12:51 -08:00
parent ec5e3e51b1
commit b90d41b508
1 changed files with 34 additions and 1 deletions

View File

@ -357,9 +357,42 @@ outerAlternative
;
lexerAlternative
: alternative
: ^(LEXER_ALT_ACTION lexerElements lexerAction+)
| lexerElements
;
lexerElements
: ^(ALT lexerElement+)
;
lexerElement
: element
;
labeledLexerElement
: ^((ASSIGN|PLUS_ASSIGN) ID (lexerAtom|block))
;
lexerBlock
: ^(BLOCK lexerAlternative+)
;
lexerAtom
: terminal
| ^(NOT blockSet)
| blockSet
| ^(WILDCARD elementOptions)
| WILDCARD
| ARG_ACTION
;
actionElement
: ACTION
| ^(ACTION elementOptions)
| SEMPRED
| ^(SEMPRED elementOptions)
;
alternative
@init {
discoverAlt((AltAST)$start);