无法在Intellij中将Rlexer加载为词法分析器或解析器。

huangapple go评论63阅读模式
英文:

Can't load Rlexer as lexer or parser in Intellij

问题

我在我的系统上安装了Java,我还在互联网上阅读了相关内容,但因为我使用IDE,我仍然遇到了这个错误。与此同时,我想要使用词法分析器来对文本文件进行标记化处理,但我却遇到了这个错误。我该如何修复这个错误?

英文:

I installed Java on my system + I also read the content on the Internet, but still, because I use IDE, I only get this error. At the same time, I want to tokenize a text file using lexer, and I get this error. How can I fix this error?
无法在Intellij中将Rlexer加载为词法分析器或解析器。

答案1

得分: 0

解决方案:问题出在我们右键单击语法文件并选择生成 Antlr 识别器选项时,我们必须将包含 Java 文件的gen目录标记为根源。Java 文件不在我们的输出目录(out)中,因此IDE无法找到 Java 文件,因此出现了上述错误。

无法在Intellij中将Rlexer加载为词法分析器或解析器。

英文:

Solution: The problem was that when we right-clicked on the grammar file and selected the Generate Antlr Recognizer option, we had to mark the gen directory that contained the Java file as the root source.
无法在Intellij中将Rlexer加载为词法分析器或解析器。
Java file was not in our output directory (out), the IDE could not find Java files and because of this it gave the above mentioned error..

huangapple
  • 本文由 发表于 2023年3月15日 19:26:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/75744059.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定