[antlr-interest] Implementing Preprocessor Functions

Bryan Ewbank ewbank at gmail.com
Fri Feb 24 12:14:02 PST 2006


If there's really a need for a meta-language (why aren't existing flow
control good enough?)...

Rather than "similar to C++'s preprocessor", why not just preprocess
with "gcc -E" to use the C++ preprocessor.  That way, you don't need
to match an existing implementation, nor document your new language.

This model makes a firewall between the preprocessor and the
scanner/parser as well.

The only problem I've had with this model is some of the edge cases
around character literals and string processing...

On 2/22/06, de Jong, Ron <ron at iesys.com.au> wrote:
> to the C++ #include, #ifdef, #else, #endif, #define....


More information about the antlr-interest mailing list