Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

Parser

Tutorials

  • Building Language Front-Ends
  • Inside CodeAnalysis - How CodeStructure Parses C
  • Design and Compilation Strategy
  • Implementing the LaTeX Math Parser
  • MaTeX Comparison Showcase
  • The Parser Landscape - a Survey of What Exists Today
  • The Parser Zoo - language front-ends over a shared algebra
  • Parsing BNF Grammars (and bootstrapping a TPTP parser)
  • Parsing GrammarRules Locally
  • A Markdown Inline Parser in Parser Combinators
  • ParsingOpenQASM
  • Parsing TPTP, Auto-Generated from the Published BNF
  • PrattVsPEG
  • The Wolfram Box Typesetting Reference

Guides

  • Parsing in the Wolfram Language

Symbols

  • ASTAddSource
  • ASTAlgebra
  • ASTContainer
  • ASTLeafQ
  • ASTNodeQ
  • ASTStripSource
  • BinaryNode
  • BrainfuckAST
  • BrainfuckGrammar
  • BrainfuckRun
  • BrainfuckSemantic
  • CalculatorAST
  • CalculatorEval
  • CalculatorGrammar
  • CalculatorSemantic
  • CallNode
  • ContainerNode
  • EBNFParse
  • EBNFRules
  • ErrorNode
  • ExportLaTeX
  • GroupNode
  • InfixNode
  • JSONAST
  • JSONGrammar
  • JSONImport
  • JSONSemantic
  • LambdaAST
  • LambdaEval
  • LambdaGrammar
  • LambdaSemantic
  • LaTeXMathParse
  • LaTeXMathParser
  • LaTeXMathStyle
  • LeafNode
  • LispAST
  • LispGrammar
  • LispRead
  • LispSemantic
  • LispSymbol
  • MarkdownInlineParse
  • MarkdownInlineParser
  • MarkdownParse
  • MarkdownParser
  • ParseAction
  • ParseBetween
  • ParseChainLeft
  • ParseChainRight
  • ParseCharacter
  • ParseChoiceLongest
  • ParseChoice
  • ParseFail
  • ParseLiteral
  • ParseLookahead
  • ParseMany
  • Parse
  • ParseNotFollowedBy
  • ParseOperatorTable
  • ParseOptional
  • ParsePartial
  • ParsePosition
  • ParserCombinator
  • ParserCombinatorQ
  • ParserCompile
  • ParseRecursive
  • ParseRegex
  • ParseSepBy1
  • ParseSepBy
  • ParseSequence
  • ParseSome
  • ParseSucceed
  • ParseTry
  • PostfixNode
  • PrefixNode
  • RecCell
  • RecRef
  • SetRec
  • SpannedToken
  • TernaryNode
  • ToCodeParser
  • TPTPExport
  • TPTPImport

Overviews

  • WolframParser
Wolfram`Parser`
ParseRecursive
​
ParseRecursive
[symbol]
returns the
ParserCombinator
that, at parse time, looks up the parser bound to symbol and runs it - a lazy reference for building self-referential and mutually-recursive grammars.
​
Details and Options
▪
ParseRecursive
holds its argument (
HoldFirst
): symbol need not have a parser value when the reference is built. The value is looked up when
Parse
runs.
▪
The reference stores the symbol name, not the parser it currently names:
ParseRecursive[s]
is
ParserCombinator["Recursive",Hold[s],]
.
▪
The lazy lookup lets a grammar be self-referential - a symbol whose definition mentions itself - or mutually recursive - symbols that mention each other - without pre-declaring every node.
▪
symbol must be bound to a
ParserCombinator
by the time
Parse
runs; it is resolved at parse time, not at construction.
▪
A recursive grammar runs on the interpretive engine, and the recursive-descent nesting is bounded by a depth guard, so deeply nested input returns a
Failure
rather than overflowing the stack.
▪
ParseOperatorTable
uses
ParseRecursive
to re-enter itself for a parenthesised sub-expression.
​
Examples  
(9)
Basic Examples  
(3)
The reference holds a symbol and looks it up at parse time, so it can be built before the grammar is defined:
In[1]:=
ParseRecursive
[expr]
Out[1]=
ParserCombinator
Type: Recursive
Arity: 1
Compiled: False

_________________________________________________________________________________________________________________
A self-referential grammar - a value is a number, or a bracketed comma-separated list of values - refers back to itself through
ParseRecursive
:
In[1]:=
value=
ParseChoice
​​
ParseAction

ParseCharacter
[DigitCharacter]..,FromDigits@*StringJoin,​​
ParseBetween

ParseLiteral
"["],​​
ParseSepBy

ParseRecursive
[value],
ParseLiteral
[","],​​
ParseLiteral
["]"​​;​​
Parse
[value,"[1,[2,3],4]"]
Out[1]=
{1,{2,3},4}
_________________________________________________________________________________________________________________
The base case - a bare number - needs no recursion:
In[1]:=
Parse
[value,"42"]
Out[1]=
42
Scope  
(4)

Properties & Relations  
(1)

Possible Issues  
(1)

SeeAlso
ParseOperatorTable
 
▪
ParseBetween
 
▪
ParseChoice
 
▪
ParseOptional
 
▪
ParserCombinator
RelatedGuides
▪
WolframParser
""

© 2026 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com