[antlr-interest] Recursive statement in parser causes non-determinism error...

Anthony Youngman Anthony.Youngman at ECA-International.com
Wed Jan 21 07:10:54 PST 2004


Help! I'm sure there must be a simple option for this ...

statement_line : (statement ( SEMI! statement)* ) ;
statement : ( ifst ) ;
ifst : ( "IF"^ expr THEN statement_line );

So, statement_line can itself contain a statement_line, and antlr is
objecting that when it hits the SEMI, it's non-deterministic, and
presumably it doesn't know which statement_line the next statement
belongs to. How do I tell the parser that the lowest-level
statement_line is to be greedy and consume all statements until it hits
something (such as an EOL) that doesn't parse as part of the
statement_line.

Cheers,
Wol


***********************************************************************************

This transmission is intended for the named recipient only. It may contain private and confidential information. If this has come to you in error you must not act on anything disclosed in it, nor must you copy it, modify it, disseminate it in any way, or show it to anyone. Please e-mail the sender to inform us of the transmission error or telephone ECA International immediately and delete the e-mail from your information system.

Telephone numbers for ECA International offices are: Sydney +61 (0)2 9911 7799, Hong Kong + 852 2121 2388, London +44 (0)20 7351 5000 and New York +1 212 582 2333.

***********************************************************************************


 

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