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

12.3. Building Blocks

All the code for the engine described in this chapter lies within the package sjm.engine. In this package, there is no Engine class; instead, there are a few collaborating classes that together produce an engine. The essential classes that make up the engine are Structure, Variable, Rule, and Program. The classes Structure and Variable are the fundamental building blocks of the engine. Classes Program and Rule are aggregations; a Program object is an aggregation of Rule objects, and a Rule object is an aggregation of Structure objects. You'll visit all these classes, starting with the fundamentals shown in Figure 12.1.

Figure 12.1. Terms, structures, and variables. The classes Structure and Variable implement the Term interface. ...

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