小编kaw*_*erd的帖子

如何使用 Eclipse 构建 Antlr4 C# 语法?

我正在尝试构建以下存储库中可用的 Antlr V4 语法: https: //github.com/antlr/grammars-v4。我已经成功构建了 Python3 和 Java 语法,并且目标 *.java 文件已成功生成。但是,当我尝试构建 C# 语法(例如 CSharpLexer.g4、CSharpParser.g4 和 CsharpPreporcessorParser.g4)时,我收到构建错误。它会生成以下错误:

error(114): CSharpPreprocessorParser.g4:7:21: cannot find tokens file ./CSharpLexer.tokens
error(126): CSharpParser.g4:20:62: cannot create implicit token for string literal in non-combined grammar: '.'
error(126): CSharpParser.g4:25:14: cannot create implicit token for string literal in non-combined grammar: '?'
error(126): CSharpParser.g4:25:37: cannot create implicit token for string literal in non-combined grammar: '*'
error(126): CSharpParser.g4:31:8: cannot create implicit token for string literal in non-combined grammar: '*'
error(126): CSharpParser.g4:71:3: cannot …
Run Code Online (Sandbox Code Playgroud)

c# grammar antlr4

2
推荐指数
1
解决办法
346
查看次数

标签 统计

antlr4 ×1

c# ×1

grammar ×1