Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Module Make.Parser
A parser is a consumer of tokens. At the end of consumption there is a result which is either a successfully parsed structure or a syntax or semantic error.
A parser p is a sink of token. As long as it signals needs_more p more token can be pushed into the parser via put token p or the input stream can be ended via put_end p.
has_ended p is equivalent to not (needs_more p). has_ended p signals that the parser has either succeeded or failed.
If it has succeeded the final value is available via final p.
has_consumed_end p Has the parser p already received the end of token stream via put_end and consumed it?
val fold_lookahead : 'a->(token->'a->'a)->('a->'a)->t->'a
fold_lookahead a ftok fend p
Fold the lookahead tokens with the start value a and the folding function ftok. At the end of the lookahead tokens, call fend if there is an unconsumed end.