SQLess / AdaptSQLess

MIT License
3 stars 1 forks source link

Error building AdaptParser #1

Open zrclzrcl opened 1 month ago

zrclzrcl commented 1 month ago

I'm getting an error when building from the README for AdaptParser!

The first thing that happens is that after doing the

java -cp target/AdaptParser-4.11.1-complete.jar org.antlr.v4.MyTool -o src/org/antlr/v4/MySql g4/MySqlLexer.g4 g4/MySqlParser.g4 -l resources/postgres_example -n resources

At this step, it says 'ANTLR Tool version 4.12.0 used for code generation does not match the current runtime version 4.11.1'.

When I ignored this prompt and followed the official instructions 'pip install antlr4-tools'. After using 'antlr4 MySqlLexer.g4', 'antlr4 MySqlParser.g4' according to the README, then 'javac MySqlLexer.java MySqlParser.java'. I get a lot of errors, some of which are listed below

javac MySqlLexer.java MySqlParser.java
MySqlLexer.java:2: Error: Package org.antlr.v4.runtime does not exist.
import org.antlr.v4.runtime.
                           ^
MySqlLexer.java:3: Error: package org.antlr.v4.runtime does not exist!
import org.antlr.v4.runtime.CharStream; ^ MySqlLexer.java:3.
                           ^
MySqlLexer.java:4: Error: package org.antlr.v4.runtime does not exist!
import org.antlr.v4.runtime.Token;

I tried using javac -cp /path/to/AdaptParser-4.11.1-complete.jar MySqlLexer.java MySqlParser.java But there are still tons of errors, some of them are listed below:

javac MySqlLexer.java MySqlParser.java
MySqlLexer.java:2: Error: Package org.antlr.v4.runtime does not exist.
import org.antlr.v4.runtime.
                           ^
MySqlLexer.java:3: Error: package org.antlr.v4.runtime does not exist!
import org.antlr.v4.runtime.CharStream; ^ MySqlLexer.java:3.
                           ^
MySqlLexer.java:4: Error: package org.antlr.v4.runtime does not exist!
import org.antlr.v4.runtime.Token;.
                           Token; ^

I'm not sure if these errors are caused by the fact that the official instructions for pip install antlr4-tools downloads an antlr version of 1.13.2 that doesn't match the 1.11.1 version used by the project. Could you please provide the environment you are using and the version and method of tool configuration, thank you very much!

linli1724647576 commented 1 month ago

I'm also encountering the warning 'ANTLR Tool version 4.12.0 used for code generation does not match the current runtime version 4.11.1,' but it doesn't affect normal execution. The environment I'm using includes antlr4-runtime:4.11.1 and antlr:antlr-runtime:3.5.3.