AnTLR4 C#中的解析树 [英] ParseTree in AnTLR4 C#

查看:38
本文介绍了AnTLR4 C#中的解析树的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用面向 C# 的 AnTLR4 创建语法,但在开发访问者时遇到问题.我找不到书中提到的 ParseTree 类.

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.

在书中我们有:

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.

你能帮忙吗?

推荐答案

C# 中的接口具有前缀 I.此处的完全限定名称是 Antlr4.Runtime.Tree.IParseTree.

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

这篇关于AnTLR4 C#中的解析树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆