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

Xavier xverges at gmail.com
Tue Dec 4 02:35:47 PST 2007


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