Package org.nineml.coffeegrinder.parser

The parser classes.

In outline:

  • Create a Grammar.
  • Use the grammar to create NonterminalSymbols.
  • Use the grammar (or Rule directly) to create rules and add them to the grammar.
  • Create an EarleyParser from the grammar.
  • Parse a sequence of input tokens to obtain an EarleyResult.
  • From the result, you can get information about the success or failure of the parse, and possibly continue parsing.
  • If the parse was successful, get the ParseForest (a shared packed parse forest) from the parse.
  • Use the forest to get GenericTree parse tree(s).
  • The forest will also tell you about the ambiguity of the result, the number of parse trees available, etc.