[antlr-interest] Re: Updated version of C# codegen 2.7.2a2 now on ANTLR site

Micheal J open.zone at virgin.net
Wed Jul 17 21:42:13 PDT 2002



> -----Original Message-----
> From: Kpako [mailto:kpako at yahoo.com]
> Sent: 17 July 2002 04:22
> To: antlr-interest at yahoogroups.com
> Subject: [antlr-interest] Re: Updated version of C# codegen 2.7.2a2 now
> on ANTLR site
>
>
> The following rule in my lexer
>
> EQUAL:
>         "="
>         {
>         #if DEBUG
>            Console.WriteLine("EQUAL:{0} seen", $getText);
>         #endif
>         }
> 	;
>
> generates
>
> if DEBUG
>   Console.WriteLine("EQUAL:{0} seen", text.ToString(_begin,
> text.Length-_begin));
> endif
>
> while the rule
>
> EQUAL:
>         "="
>         {
>         #if DEBUG
>            Console.WriteLine("EQUAL:{0} seen", "=");
>         #endif
>         }
> 	;
>
> correctly generates
>
> 	#if DEBUG
> 	Console.WriteLine("EQUAL:{0} seen", "=");
> 	#endif
>
>
> Is this a bug or am I doing somthing wrong?

Thanks for the feedback report. I will look into this. I haven't tested the
code generator's handling of C# preprocessing directives embedded in code
blocks. I seem to remember off the top of my head that ANTLR itself uses the
'#' character and that may be the source of the behavior you are seeing but,
I'll have to verify that later.

Thanks,

Micheal



 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list