[antlr-interest] Re: Updated version of C# codegen 2.7.2a2 now on ANTLR site
micheal_jor
open.zone at virgin.net
Wed Jul 17 22:05:26 PDT 2002
--- In antlr-interest at y..., Dare Obasanjo <kpako at y...> wrote:
>
> --- Micheal J <open.zone at v...> wrote:
> >
> > 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 for looking into it. I also had a problem with
> lexer rules like
>
> protected
> STRING returns [String s]
> : (.)+ { s=$getText; }
> ;
>
> because it complained about s being an unitialized
> variable. The following works however
>
> protected
> STRING returns [String s]{
> s = null;
> } : (.)+ { s=$getText; }
> ;
I have noticed this too. It is an artifact of C#'s rules for variable
definition and usage really (admittedly triggered by ANTLR code
generation style).
Can't see any easy way to pre-initialize arbitary variable
declarations within the code generator so I guess I just need to add
some specific info about it to the csharp runtime document.
Thanks,
Micheal
PS I found your "C# from a Java dev's precpective" document
helpful. Helped with the C# codegen's development as it
happens.... ;-)
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list