14.3 Logikus Assemblers


 
Building Parsers with Java
By Steven  John  Metsker

Table of Contents
Chapter  14.   Parsing a Logic Language

    Content

From one point of view, Logikus is a computer language that lets its user model a problem in terms of facts and rules. Another perspective of Logikus is that it is only a thin skin over a logic engine, specifically the engine in sjm.engine . A review of the assemblers in sjm.examples.logic confirms the view that Logikus is quite close to the logic engine. Each of the assemblers in Figure 14.2 pushes an object from one of the classes in sjm.engine .

Figure 14.2. Logikus assemblers. The Logikus parser in sjm.examples.logic uses 11 assemblers, which collaborate in composing axioms from text that the parser recognizes.

graphics/14fig02.gif

Assembler placement is sometimes obvious. Evaluations and comparisons, for example, see their text and call on a corresponding assembler to build a corresponding engine object. The notes in Figure 14.3 refer to assembler placements that are more subtle.

Figure 14.3. Logikus Assembler Placement. This table shows the assembler or assemblers that Logikus subparsers employ .

graphics/14fig03.jpg

The "Parser" column in Figure 14.3 refers to methods of the class LogikusParser in sjm.examples.logic . These methods correspond to rules from the Logikus grammar developed earlier in this chapter. The notes in Figure 14.3 refer to assembler placements that merit explanation.

A parser for Logikus follows directly from its grammar along with a knowledge of where to place the parser's assemblers. The start() method of class LogikusParser in package sjm.examples.logic provides a parser for Logikus.


   
Top


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

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