[antlr-interest] a grammar problem

Jim Idle jimi at temporal-wave.com
Fri May 18 12:51:47 PDT 2007


I see Ter answered already, but it might be useful for you to see this rearranged. I think you want:

operation
    :   atom ((ASTERISK | SLASH) atom)*
    ;


atom
    :   NUMBER
    |   STRING
    |   array
    |   LEFT_PARENTHESIS expressionList? RIGHT_PARENTHESIS
    ;

array  // Assumes that arrays have some sort of lead in as if they are just ( expr (COMMA expr)*) then they
       // are the same as paren expressions and cannot be distinguished.
	: ID LEFT_PARENTHESIS expressionList RIGHT_PARENTHESIS
	;


-----Original Message-----
From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-bounces at antlr.org] On Behalf Of Firat KÜÇÜK
Sent: Friday, May 18, 2007 12:05 PM
To: LİSTE ANTLR-INTEREST
Subject: [antlr-interest] a grammar problem




More information about the antlr-interest mailing list