title: Using JavaCC to read input from a text file
body: <p>I am trying to make JavaCC use the input from a text file called input.txt. However, I cannot figure out how to do so. I try to setup an InputStream and pass that to a StringReader, but I don't think StringReader takes this type of parameter. My relevant code is below:</p>
  
  <pre><code>InputStream fis = new FileInputStream("C:\\input.txt");
  java.io.StringReader sr = new java.io.StringReader(fis);
  SimpleCharStream scs = new SimpleCharStream(sr);
  LexicalStatesSpacesTokenManager mgr = new LexicalStatesSpacesTokenManager(scs);
  </code></pre>