[antlr-interest] Re: Predicate question

Brad Schick schick at robotbattle.com
Mon May 3 18:13:40 PDT 2004


> Yes, treat newline as a separator not a terminator:
> 
> function := id "{" statement-list "}" ;
> statement-list := statement ( newline statement )* ;
> statement := ... | empty ;
> newline := NL ;
> empty := ;

Thanks for the idea. I see a few issues with the example. It 
wouldn't handle:

func {
...
stmnt       <-nothing to grab this newline
}

It also won't handle several blank (newline terminated) lines in a 
row because empty won't consume newlines. Adding "newline" to 
statement could cause 2 newlines in a row to be required. But I'll 
play with it now that I have something else to try. 

Thanks,
-Brad




 
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