CUP parser returns syntax error for a valid input
<p>I'm trying to write a very simple parser. I'm using JFlex with Java CUP. Here's my code:</p>

<p>LEX file:</p>

<pre><code>import java_cup.runtime.*;


%%

%class Lexer
%line
%column
%cup


%{   
    /*********************************************************************************/
    /* Create a new java_cup.runtime.Symbol with information about the current token */
    /*********************************************************************************/
    private Symbol symbol(int type)               {return new Symbol(type, yyline, yycolumn);}
    private Symbol symbol(int type, Object value) {return new Symbol(type, yyline, yycolumn, value);}

%}



%%


&lt;YYINITIAL&gt; {
&lt;&lt;EOF&gt;&gt;             { return symbol(sym.EOF); }
"|"                 { return symbol(sym.PIPE); } 

}
</code></pre>

<p>CUP file:  </p>

<pre><code>import java_cup.runtime.*;


terminal PIPE;

non terminal myrule;   

myrule  ::=  PIPE {: RESULT = 42; :};
</code></pre>

<p>Main.java</p>

<pre><code>import java.io.FileReader;

public class Main {

    public static void main(String[] args) throws Exception {
        CUP_FILECup parser = new CUP_FILECup(new Lexer(new FileReader(args[0])));
        parser.debug_parse();
    }

}
</code></pre>

<p>As you can see, I tried to make it as simple as I could yet, I get the following error for the input file containing only one character: "|".</p>

<blockquote>
  <p>Syntax error at character 0 of input</p>
</blockquote>

<p>But clearly we defined a proper derivation for "|".</p>

<p>Why is it happening? </p>

<p><strong>EDIT:</strong><br>
- "start with myrule;" doesn't help</p>