[antlr-interest] Newbie question

Jim Idle jimi at temporal-wave.com
Thu Apr 30 08:33:32 PDT 2009


Bill Steer wrote:
> Please excuse this newbie question.  I'm generating a lexer/parser in 
> C#, setting the 'language' option to 'Csharp2'.  It's successfully 
> generating the code, but there are several errors in it, as follows:
>
> 1. It's missing a ';' on one statement.
> 2. It's missing a cast from IList to ArrayList on one statement.
> 3. I haven't found a way to include a 'namespace' statement in the 
> generated code.
>
> Are these common errors, or is there a way around them?
>
> Thanks for any help.
>
> Bill Steer
>
>
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>   
To add a namespace, use:

@namespace { namespace1 }

Which should be placed after any tokens {} section (before your first rule).

For the other two, make sure you are using the latest tool to generate 
the code and see if gives anything different, but you probably need to 
post your grammar for the C# guys to take a look at.

Jim


More information about the antlr-interest mailing list