next | previous | forward | backward | up | top | index | toc | home
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:58
futureParser = parserSymbol -> new Parser from (c -> (value parserSymbol) c)