开发者

antlr text from matching rule in c#

In an Antlr 开发者_StackOverflow3 grammar, is it possible to print out the full text matching a rule in a grammar targeting c#? Something like below:

rule : FIRST SECOND
{ Console.WriteLine($rule.text); };//does not work. 

FIRST: 'first';

SECOND: 'second';


If $rule.text doesn't work (as @dana suggested), you might try $rule.Text or even $rule.GetText().

If all fails, please tell us which version of the C# port you're using (and where it can be downloaded), then I (or someone else) can perhaps give it a try.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜