Generates a new TokenParser or SymbolParser that will chain parsers together one after the other unconditionally
in the order specified.
It will optionally execute some action on semantic data values returned by parsers
and return the semantic value returned by action.
At least one parser must be passed.
If at least one of the parsers fail, the ParseError will be returned and action
will not be executed.
If the ParseError needs to be handled, the chain parser can always be nested
in a map parser.
It can be used where there are multiple chains to be done at once, (ex: at grammar rules).
It is actually a simple fold operation on the chain parser with an optional action
on the end of them.
It is suggested in cases where chain nesting is used:
Generates a new TokenParser or SymbolParser that will chain
parserstogether one after the other unconditionally in the order specified. It will optionally execute someactionon semantic data values returned byparsersand return the semantic value returned byaction. At least one parser must be passed. If at least one of theparsersfail, the ParseError will be returned andactionwill not be executed. If the ParseError needs to be handled, the chain parser can always be nested in a map parser.It can be used where there are multiple chains to be done at once, (ex: at grammar rules). It is actually a simple fold operation on the chain parser with an optional
actionon the end of them.It is suggested in cases where chain nesting is used:
The
actionis made to simulate Bison's "actions" and can be used to define an Abstract Syntax Tree (AST) for the input by changing the semantic data.Returns
A new TokenParser or SymbolParser that will chain
parsersand execute them along with an optionalactionat the end of the chain.See