tags:

views:

115

answers:

1

In ANTLR version 2.X you could specify something was to go before or after the ANTLR includes via the code below.

header "pre_include_hpp" 
{
    #pragma warning( push )
    #pragma warning( disable : 4511 )   // couldn't generate copy constructor
}

header "post_include_hpp" 
{
    #pragma warning( pop )
}

With ANTLR v3.X it looks like this has been replaced by one @header block.

Is there a way to do what we previously did with ANTLR v2?

+1  A: 

I've found out that I should be using

@lexer::preinclude
@lexer::postinclude

to replace the above definitions when I move from Antlr2 to Antlr3

see: http://www.antlr.org/api/C/atsections.html

for more details.

chollida