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

10.4. Collection Parsers

The Sequence and Alternation classes are subclasses of CollectionParser, as Figure 10.3 shows. These classes have a common way of adding and storing their subparsers. They differ primarily in how they match a set of assemblies.

Figure 10.3. The CollectionParser class. CollectionParser is the abstract superclass of the two fundamental types of collection parsers: Alternation and Sequence.

The main behavior that CollectionParser provides to its subclasses is the ability to add a parser to a collection.

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