15.10. Jaql Assemblers

When you parse a user's query, you want to create a Query object as a result. To achieve this, you set the initial assembly's target to be a QueryBuilder object. This builder collects information as you parse the user's query. You need assemblers to capture select terms, class names, and comparisons. To handle expressions, you need assemblers for arithmetic operations and variables. Finally, you need an assembler that exchanges a token on an assembly's stack with an atom that has the token's value as its functor. Altogether, the Jaql parser uses six assemblers, as Figure 15.15 shows.

Figure 15.15. Jaql assemblers. The Jaql parser uses six assemblers that help it build an engine query from a user's textual query. Jaql offloads ...

Get Building Parsers with Java™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.