Repeats one parser
Repeats a parser indefinitely, while it succeeds. It will return an empty token if the parser never succeeds,
Number of repetitions may be zero.
1 2 3 4
parse to be applied iteratively
Function to be executed if recognition succeeds. It takes as input parameters information derived from parsers involved as parameters
Function to be executed if recognition does not succeed. I takes two parameters:
In case of at least one success,
action gets the
node returned by the parser
repetition1N after applying the parser to be repeated. Otherwise, it gets the
node corresponding to token
error is never called. It is defined as parameter for the sake of homogeneity with the rest of functions.
Anonymous functions, returning a list.
From these input parameters, an anonymous function is constructed. This function admits just one parameter, stream, with
streamParser class, and returns a three-field list:
"ok" or "fail"
errorfunction output, depending on the case
With information about the input, after success or failure in recognition
1 2 3 4 5 6 7 8