문제

I am currently using ANTLR4 in C# but I am facing a problem, I don't know how to get the the object/class IParseTree.

I find in C# the fully qualified name here is Antlr4.Runtime.Tree.IParseTree but how to get the object?

AntlrInputStream inputStream = new AntlrInputStream(sSpinTexte);
SpinParserLexer SpinLexer = new SpinParserLexer(inputStream);
CommonTokenStream commonTokenStream = new CommonTokenStream(SpinLexer);
SpinParserParser SpinParser = new SpinParserParser(commonTokenStream);
IParseTree tree = ?????

Can you please help?

도움이 되었습니까?

해결책

Thanks to the comment of Cv4, this is the code I used:

IParseTree tree = SpinParser.expr();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top