[antlr-interest] Antlr 3 syntax question

shmuel siegel antlr at shmuelhome.mine.nu
Thu Apr 27 04:01:32 PDT 2006


I would also like to understand the usage of alternatives and 
parenthesis. According to AntlrWorks, the following rule has 4 
alternatives consistent with the visual layout of this rule. The second 
and third alternatives are identical. My question is "Why is there an 
implied parenthesis around the second alternative?". In other words, 
does sequencing of tokens always take precedence to alternatives?

levelExpr     :
        INT
    |
         '@level' '(' 'offset' '=' INT ')'
    |
         ('@level' '(' 'offset' '=' INT ')' )
    |
    ;



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.385 / Virus Database: 268.5.0/325 - Release Date: 4/26/2006



More information about the antlr-interest mailing list