开发者

Antlr @header declaration for C++ generation

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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜