Macaulay2 » Documentation
Packages » Parsing > Parser > futureParser
next | previous | forward | backward | up | index | toc

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:28-65:74: --source code:
futureParser = parserSymbol -> new Parser from (c -> (value parserSymbol) c)

For the programmer

The object futureParser is a function closure.