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!

[1019 byte] By [okwuzhijuna] at [2007-10-3 0:16:19]
# 1
The BC rule has consumed 'bc' because you specified an optional 'c', so the other rule is still expecting to see a 'c', and it got EOF instead.
ejpa at 2007-7-14 17:07:05 > top of Java-index,Developer Tools,Java Compiler...