Is there a way to know which tokens are possible to follow a partial
string according to a grammar, whose JavaCC parser was generated?
For example:
Lets say you have:
x ::= yz
y ::= "y"
z ::= "a" | "b"
Is it possible that through a JavaCC parser for the above grammar, I
have some kind of framework where if I will provide "y", I will get an
array of the next possible tokens "a" and "b".
For a better understanding of what I need, I want to generate a sort
of small wizard application for a small grammar. This wizard would help the
user in constructing the syntactically correct statements by popping
up the possibilities and the user chooses from them. For example, it
is very similar to how JBuilder pops up a window with the
possibilities in the editor window.