Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java -jar antlr-4.9.3-complete.jar -o生成文件目录can't find token file问题 #1

Closed
eleveyuan opened this issue Apr 4, 2022 · 2 comments

Comments

@eleveyuan
Copy link
Owner

eleveyuan commented Apr 4, 2022

环境:ubuntu20.04
ide:clion2021.03

目的: 使用shell生成cpp的语法文件

shell文件

LOCATION=antlr-4.9.3-complete.jar
java -jar $LOCATION -Dlanguage=Cpp -listener -visitor -o generated/mysql/ resource/mysql/MySqlLexer.g4 resource/mysql/MySqlParser.g4

遇到问题:

error(114): resource/mysql/MySqlParser.g4:28:21: cannot find tokens file resource/mysql/MySqlLexer.tokens


输出文件遇到的文件
输出文件结构

--resource
|       -- mysql 
|            -- *.g4
--generated
|       --mysql
|           -- resource
|                --mysql
|                     -- 相应的输出

想要的结构:

--resource
|       -- mysql
|            -- *.g4
--generated
|       --mysql
|           -- 相应的输出
@eleveyuan
Copy link
Owner Author

@eleveyuan
Copy link
Owner Author

加上-Xexact-output-dir即可解决
java -jar antlr-4.9.3-complete.jar -Xexact-output-dir -o

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant