[antlr-interest] Please help a newbie!

Peter Ashford kaffiene at xtra.co.nz
Tue Aug 3 22:00:18 PDT 2004


Richard Clark wrote:

>Some of this just takes a Zen approach: becoming one with the 
>documentation. Try adding # in front of the var names in the action 
>(and look at the generated code to see what ANTLR does with it.)
>
>
>assign
>  { float f; }
>          : i:ID EQ f=f_expr                 { assignTo(#i->getText(), 
>#f); }
>          ;
>
>  ...R
>
>  
>

I appologise for being a pain - but adding the hash just makes the code 
not compile because MSVC .NET thinks it's a preprocessor command.

I have been stepping through the generated code and what I find is the 
parser skipping over all of the possiblities (keywords, comments etc) 
and throwing the no valid alternative exception rather than scanning as 
an identifier


 
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