Question

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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top