An indexed collection if inner handlers. All events passed through the CompoundHandler will be passed through each (unfinished) innerHandler.
A function to convert the result values of the inner
handlers to some concrete value. The input to this function
will be an array containing results from the inner handlers.
The result for innerHandlers(n)
will be located at the n'th
index in the array. Note that the array will have values of
type B
, but actual values are likely intended to have more
specific types, so the reform
function will likely need to
perform class casting.
Causes this handler to finalize and produce a result.
Causes this handler to finalize and produce a result.
This method should not be called if isFinished
is already true.
The final output of this parser
Causes this handler to process an error.
Causes this handler to process an error.
This method should not be called if isFinished == true
an error to be processed
An option containing the final output if
this handler became finished as a result
of processing the error
, or None
if
the handler is ready for more input.
Causes this handler to process an input element.
Causes this handler to process an input element.
This method should not be called if isFinished == true
an element to be processed
An option containing the final output if
this handler became finished as a result
of processing the input
, or None
if
the handler is ready for more input.
Tells if this handler is finished.
Tells if this handler is finished.
If a handler is finished, its handleX
methods
should no longer be called. Doing so after the
handler finishes will cause undefined behavior.
Typically a handler should be discarded once it
is finished.
whether this handler is finished
A composition of a number of "inner" handlers which delegates each event to each (unfinished) inner handler, then reforms a final result based on the final results of each of the inner handlers.
Used internally by
ParserChain
The input type for each of the inner handlers
A base type for the results of all of the innerHandlers. This will typically be
Any
orResult[Any]
.The type of the final combined result