[antlr-interest] Use each token Once -- All required

georgehernando georgehernando at hotmail.com
Tue Sep 21 08:15:38 PDT 2004


How can I specify a compact syntax for the parser that will define a 
list of token types from the lexer where each type must appear, but 
only one time?

XXX :  (TokenType1 | TokenType2 | TokenType3 | TokenType4)+;
doesn't limit the token types to appearing only one time.

Do I have to specify all permutations?

XXX :  ( (TokenType1 TokenType2 TokenType3 TokenType4) |
         (TokenType1 TokenType2 TokenType4 TokenType3) |
         (TokenType1 TokenType4 TokenType3 TokenType2) |
         (TokenType4 TokenType2 TokenType3 TokenType1) |
         (TokenType2 TokenType1 TokenType3 TokenType4) |
         ....
        )




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list