[antlr-interest] Example anyone?

Barnes, Jeff JB0284 at att.com
Tue Aug 21 08:24:05 PDT 2007


I'm looking to implement a language that has the following features (not
complete):

event : 
    "@event" ID (POPEN args PCLOSE)? 
    ( SQBOPEN guardExpr SQBCLOSE )? TRANSITION ID 
    ( SLASH actionExpr )?
;

args :
    ID ID ( ',' ID ID )*
;

POPEN : "(";
PCLOSE : ")";
SQBOPEN : "[";
SQBCLOSE : "]";
TRANSITION: "->";


I'm having a little trouble figuring out how to do the guardExpr because
it can have SQBCLOSE in it (an array index for example). I like the way
UML specifies guard expressions, so I'd like to stick with that. But the
guardExpr can be any valid java boolean expression.

Is this going to be like the example for javadoc comments? Or is there
another more pertinent example.

Thanks for any pointers.

Jeff


More information about the antlr-interest mailing list