Compiling sample ANTRL4 output

后端 未结 2 1548
别跟我提以往
别跟我提以往 2020-12-11 19:55

From the Definitive ANTLR4 reference I have run through the first example and it has generated the JAVA target. In the directory C:\\JavaLib I have antlr-4.5-complete.jar Wh

2条回答
  •  忘掉有多难
    2020-12-11 20:15

    There was 2 problems. One was the file has to be named "Hello.g4" not "hello.g4" because the grammar is specified as Hello. The second was the classpath, it requires the path and name of the jar file, as well as the current directory. The following command worked;

    javac -classpath .;C:\JavaLib\antlr-4.5-complete.jar *.java
    

提交回复
热议问题