title: JFlex with CUP compile errors
body: <p>I am trying to run an example provided by CUP: <a href="http://www2.cs.tum.edu/projekte/cup/examples.php#xml" rel="nofollow noreferrer">Parsing directly to XML</a>.</p>
  <p>I stored the 'Minijava Grammar' in a file named <strong>minijava.cup</strong> and the scanner into a file named <strong>xml.flex</strong>. I ran JFlex to obtain <strong>Lexer.java</strong> from the xml.flex file. After that I obtained <strong>Parser.java</strong> and <strong>sym.java</strong> after running the command specified on the CUP example:</p>
  <pre><code>java -jar java-cup-11b.jar -locations -interface -parser Parser -xmlactions minijava.cup
  </code></pre>
  <p>My directory looks like this:</p>
  <pre><code>input.xml
  java-cup-11b.jar
  java-cup-11b-runtime.jar
  jflex-1.6.1.jar
  Lexer.java
  minyjava.cup
  Parser.java
  sym.java
  xml.flex
  </code></pre>
  <p>I am trying to compile the Lexer.java file by using the following command:</p>
  <pre><code>javac -cp java-cup-11b-runtime.jar Lexer.java
  </code></pre>
  <p>but I get 47 errrors in the format &quot;..cannot find symbol...&quot;. The first ones specify that classes sym and minijava.Constants can't be found.</p>
  <blockquote>
  <p>Lexer.java:17: error: cannot find symbol</p>
  <p>public class Lexer implements java_cup.runtime.Scanner, sym, minijava.Constants{</p>
  <p>^   symbol: class sym</p>
  <p>Lexer.java:17: error: package minijava does not exist</p>
  <p>public class Lexer implements java_cup.runtime.Scanner, sym, minijava.Constants {</p>
  <p>^ Lexer.java:679: error: cannot find symbol</p>
  <p>{return symbolFactory.newSymbol(&quot;EOF&quot;, EOF, new Location(yyline+ 1,yycolumn+1,yychar), new Location(yyline+1,yycolumn+1,yychar+1));</p>
  </blockquote>
  <p>I do not understand why the sym.java file is not visible to Lexer or where to get the minijava.Constants file.</p>