javacc problem about lookahead example
javacc 4.0, I run follows example:
PARSER_BEGIN(Example)
import java.io.*;
public class Example {
public static void main(String args[]) throws Exception {
Example parser = new Example(new FileReader("d:/workingfolder/JavaCC/resource/data.dat"));
parser.Input();
}
}
PARSER_END(Example)
SKIP :
{
" "
| "\t"
| "\n"
| "\r"
}
void Input() :
{}
{
"a" BC() "c"
}
void BC() :
{}
{
"b" [ "c" ]
}
//example end
throw a exception when recognise string "abc".
Exception in thread "main" ParseException: Encountered "<EOF>" at line 1, column 5.
Was expecting:
"c" ...
at Example.generateParseException(Example.java:206)
at Example.jj_consume_token(Example.java:144)
at Example.Input(Example.java:15)
at Example.main(Example.java:7)
Would you tell me why throw the exception?
Thanks Advance!

