我从http://www2.cs.tum.edu/projects/cup/下载了演示版
我通过命令得到了parser.java
:
java -jar bin/java-cup-11a.jar cup/parser.cup
但是当我通过以下方式编译parser.java
时
javac -classpath lib/java-cup-11a-runtime.jar parser.java
结果是:
cspro@Think:~/Desktop/template$ javac -classpath lib/*.jar -d . parser.java parser.java:104: cannot find symbol symbol : class Parser location: class Example.parser if (args.length==0) new Parser(new Scanner(System.in,sf),sf).parse(); ^ parser.java:104: java_cup.runtime.Scanner is abstract; cannot be instantiated if (args.length==0) new Parser(new Scanner(System.in,sf),sf).parse(); ^ parser.java:105: cannot find symbol symbol : class Parser location: class Example.parser else new Parser(new Scanner(new java.io.FileInputStream(args[0]),sf),sf).parse(); ^ parser.java:105: java_cup.runtime.Scanner is abstract; cannot be instantiated else new Parser(new Scanner(new java.io.FileInputStream(args[0]),sf),sf).parse(); ^ Note: parser.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. 4 errors
如何编译parser.java?