[antlr-interest] Simple grammar, but #if #endif and are making it harder

Andy Tripp antlr at jazillian.com
Tue Dec 4 18:38:14 PST 2007


I've extended the C grammar to include preprocessor directives,
and I also have code that evaluates them. The code is proprietary,
but if you're willing to pay money for it, let me know.

Andy

Xavier wrote:
> I have to translate .ADM files, that specify Windows Policy Settings
> http://msdn2.microsoft.com/en-us/library/aa372405.aspx
>
> I'm having a hard time getting started,mostly because I'm new to ANTLR
> and I don't know how to deal with comments and #if #endif sections.
>
> 1. To learn how to deal with #if #endif, is there a simpler starting
> point than the full featured C Preprocessor from Youngki KU
> http://www.antlr.org/grammar/1166665121622/Cpp.tar
>
> 2. What does look like a better approach?
> 2.1. Having a preprocessor step (a grammar to deal with comments and
> #ifdefs) and handling the "meat" in a later step
> 2.2. Using a single grammar definition
>
> Thanks in advance for any advice.
>
> -Xavier
>
>   



More information about the antlr-interest mailing list