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`
RecCell
​
RecCell
[]
allocates a recursion cell - a stable symbol for a self- or mutually-recursive grammar production.
​
Details and Options
▪
A recursive grammar needs a production that refers back to itself before it is fully built. The cell is the named hole: reference it with
RecRef
wherever the production recurs, and close the loop with
SetRec
[cell,parser]
once the parser is in hand.
▪
The cell wraps a fresh global
Unique
symbol kept un-evaluated. A
ParseRecursive
target must outlive the function that built the grammar; a
Module
-local symbol can be garbage-collected once the builder returns - its only live reference is held inside
ParseRecursive
- which silently breaks the recursion. The global cell never gets collected and resolves regardless of when its parser is set. This mirrors the
Unique
-per-rule wiring the paclet's own EBNF front end uses.
▪
Allocate one cell per recursive production. Mutually-recursive productions each get their own cell and reference each other through
RecRef
.
▪
A raw cell is an internal wrapper around its symbol; it is meant to be wired into a grammar with
RecRef
and
SetRec
, not displayed on its own.
​
Examples  
(4)
Basic Examples  
(1)
Allocate a cell, reference it inside a nested-list production with
RecRef
, and close the loop with
SetRec
- the cell lets an item be either a number or a whole sub-list:
In[1]:=
cell=
RecCell
[];​​list=
ParseBetween
​​
ParseLiteral
"["],​​
ParseSepBy

ParseChoice

ParseRegex
["[0-9]+"],
RecRef
[cell],
ParseLiteral
[","],​​
ParseLiteral
["]"​​;​​
SetRec
[cell,list];​​
Parse
[list,"[1,[2,3],[]]"]
Out[1]=
{1,{2,3},{}}
The same grammar handles a flat list - the recursion is simply not exercised:
In[2]:=
Parse
[list,"[1,2,3]"]
Out[2]=
{1,2,3}
Scope  
(1)

Properties & Relations  
(1)

Possible Issues  
(1)

SeeAlso
RecRef
 
▪
SetRec
 
▪
ParseRecursive
 
▪
ParseChoice
 
▪
ParseBetween
RelatedGuides
▪
Parser Zoo
""

© 2026 Wolfram. All rights reserved.

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