ParseTree in AnTLR4 C#

余生颓废 提交于 2019-12-12 17:02:22

问题


I am currently creating a grammar using AnTLR4 targeting C# but I am facing a problem while developing a visitor. I can't find the class ParseTree referred in the book.

In the book we have:

LabeledExprLexer lexer = new LabeledExprLexer(input);
CommonTokenStream tokens = new CommonTokenStream(lexer);
LabeledExprParser parser = new LabeledExprParser(tokens);
ParseTree tree = parser.prog(); // parse
but I can't see the equivalent C# code.

Can you please help?


回答1:


Interfaces in C# have the prefix I. The fully qualified name here is Antlr4.Runtime.Tree.IParseTree.



来源:https://stackoverflow.com/questions/18219331/parsetree-in-antlr4-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!