I downloaded the demo from http://www2.cs.tum.edu/projects/cup/
I got parser.java
by command:
java -jar bin/java-cup-11a.jar cup/parser.cup
but when I compile parser.java
by:
javac -classpath lib/java-cup-11a-runtime.jar parser.java
the result is:
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
how to compile the parser.java ?