Name

class BuildParser — Create a Parser from a collection of Rules

BuildParser()

Creates a new BuildParser object.

setGoal( const NonTerminalSymbol& new_goal)

The parser completes successfully when it has read all available input and recognized the sequence of symbols specified by any rule that results in its goal. This method sets the goal of the parser that will be constructed to new_goal. If a goal is not set explicitly with this method, the parser's goal will be the result of the first rule added.

Parser* build( std::ostream& output_stream=null_stream)

This method creates a Parser from the rules and goal set in the BuildParser object. If output_stream is provided, a report of the parser's construction, detailing conflicts, rules, and the states in the resulting parser, is written to that stream. The resulting Parser object is allocated on the heap. If no rules have been added to the BuildParser this method will throw a std::logic_error exception. Otherwise, it will always generate a valid Parser object (whether the Parser can actually recognize any input, of course, is dependent on the grammar.)