[antlr-interest] @declarations

Jim Idle jimi at temporal-wave.com
Thu May 12 12:22:14 PDT 2011


Declarations is only needed for C targets (and really only to be C89
compliant which used to be important before gcc everywhere). So just roll
them up:

@declarations
{
	int i;
}
@init
{
	i = 0;
}

from a C target is just

@init
{
	int i = 0;
}

In C# and Java targets and probably most others.

Jim


> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of The Researcher
> Sent: Thursday, May 12, 2011 11:32 AM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] @declarations
>
> I am working on converting the C++ grammar by *Aurelian Melinte* from a
> C back end to a C# back end and for the life of me cannot find out how
> to property convert the @declarations section to C#.
>
> The searching of @declarations in both Google, and MarkMail drop the @
> and then the results become meaningless.
>
> I am currently converting it to scope and @init sections if only to get
> the C# to build. Once built I will need to debug the code and thus need
> to know more about how to properly convert @declarations.
>
> Thanks,  Eric
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
> email-address


More information about the antlr-interest mailing list