11.4. New Parser Features
With the classes Sequence, Alternation, and Repetition, along with a hierarchy of Terminal classes, you can build an infinite variety of parsers. These classes form a complete toolkit, and so you could argue that they need never be extended. History has shown, however, that no toolkit is ever complete in the sense that it cannot profitably be extended. Toolkit developers should strive both for comprehensiveness and extensibility.
Software that is extensible has the following features:
Classes have short methods that perform a single service.
Methods and instance variables are generally protected rather than private, allowing subclasses more flexibility in how they extend a class.
Documentation is accurate and complete ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access