我在为C#设置ANTLR v4时遇到问题,有人热心帮助我吗?我正在使用官方网站此处https://github.com/sharwell/antlr4cs引用的构建目标
我添加了一个简单的语法 Foo.g
grammar Foo;
r : 'hello' ID ; // match keyword hello followed by an identifier
ID : [a-z]+ ; // match lower-case identifiers
WS : [ \t\r\n]+ -> skip ; // skip spaces, tabs, newlines
...并将其构建动作设置为 Antlr4
现在,我陷入了以下错误。
'´' came as a complete surprise to me
mismatched input 'grammar' expecting SEMI
我没有足够的意见要发表评论,所以这只是一个链接,但是显然此错误消息的一个可能原因是将文档保存为带有BOM的UTF-8编码。显然这是JAVA文件输入流的问题。
Notepad ++将使您无需使用BOM表即可进行保存。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句