首页 > 其他 > 详细

antlr @members

时间:2021-03-02 22:33:55      阅读:42      评论:0      收藏:0      [点我收藏+]

转自StackOverflow,原问题 https://stackoverflow.com/questions/6005898/antlr-members-and-lexer

 

最佳回答:

 

 

In a combined grammar file, @members is a short-hand for @parser::members.

// combined grammar
grammar Foo;

@members {
  // only parser members here, equivalent to: @parser::members { ... }
}

@lexer::members {
  // lexer members
}

When you use separate lexer- and/or parser grammars, then @members is enough:

parser grammar Foo;

@members {
  // parser members
}

or

lexer grammar Foo;

@members {
  // lexer members
}

Galmi wrote:

Btw. is stackoverflow inline code work‘s for Opera?

I guess so, but questions about SO itself can be asked on SO-Meta.

antlr @members

原文:https://www.cnblogs.com/Joynic/p/14470842.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!