CWB
view release on metacpan or search on metacpan
lib/CWB/CEQL/Parser.pm view on Meta::CPAN
Recall that the list returned by B<Apply> does not have to be validated: if
any error occurs, the respective subrule will B<die> and abort the complete
parse.
=head2 The shift-reduce parser for nested bracketing
The B<Apply> method is more than a convenient shorthand for parsing lists of
constituents. Its main purpose is to parse nested bracketing structures,
which are very common in the syntax of formal languages (examples include
arithmetical formulae, regular expressions and most computer programming
languages). When parsing the constituents of a list with nested bracketing,
two special methods, B<BeginGroup> and B<EndGroup>, are called to mark opening
and closing delimiters. Proper nesting will then automatically be verified by
the DPP parser. If the syntax allows different types of groups to be mixed,
optional names can be passed to the B<BeginGroup> and B<EndGroup> calls in
order to ensure that the different group types match properly.
The output generated by the items of a bracketing group is collected
separately and returned when B<EndGroup> is called. From this list, the rule
processing the closing delimiter has to construct a single expression for the
( run in 0.247 second using v1.01-cache-2.11-cpan-26ccb49234f )