March 2001
Intermediate to advanced
400 pages
8h 35m
English
An alternation is a collection of parsers, any of which may match against an assembly. As with the Sequence class, the primary service of the Alternation class is matching, as Figure 10.5 shows.

An Alternation object matches each of its subparsers against the collection of assemblies that match() receives. The Alternation object accumulates the results of each match into an output final state. Here it is in pseudocode:
out = new state; ...
Read now
Unlock full access