15.9 Creating the Jaql Parser

Building Parsers with Java
By Steven  John  Metsker

Table of Contents
Chapter  15.   Parsing a Query Language


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.


Building Parsers with Java
Building Parsers With Javaв„ў
ISBN: 0201719622
EAN: 2147483647
Year: 2000
Pages: 169

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net