O'Reilly logo

Building Parsers with Java™ by Steven John Metsker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

15.9. Creating the Jaql Parser

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required