Java port by Eibe Frank

Source code:

sequitur
rule
symbol

nonTerminal
terminal
guard