next | previous | forward | backward | up | top | index | toc | Macaulay2 website
Parsing > Parser > futureParser

futureParser -- forward reference to a parser not defined yet

Synopsis

Description

This function makes recursive parsers possible.

i1 : p = futureParser q

o1 = p

o1 : Parser
i2 : m = p : charAnalyzer

o2 = m

o2 : FunctionClosure
i3 : q = constParser "abc"

o3 = q

o3 : Parser
i4 : m "abc"

o4 = abc

Code

../../../../../../../Macaulay2/packages/Parsing.m2:65:29-65:75: --source code:
futureParser = parserSymbol -> new Parser from (c -> (value parserSymbol) c)

For the programmer

The object futureParser is a function closure.