The code for the parsers ( ComparisonParser and JaqlParser ) is in each case almost a direct translation of the grammars, following the rules in Section 3.6 "Translating a Grammar to Code." Both parsers require a Speller instance variable and a constructor that accepts a speller. A JaqlParser object passes its speller to a ComparisonParser object, which uses the speller when it sees a variable name .
Other than spelling, the only addition to make to ComparisonParser and JaqlParser in sjm.examples.query is to plug in their assemblers.