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`
ParserCombinator
​
ParserCombinator
[type,args,opts]
is the single computable wrapper every parser in the library is represented as. The head is opaque to user code: build a
ParserCombinator
by calling one of the
Parse*
constructors (
ParseLiteral
,
ParseSequence
,
ParseChoice
, …), never by hand.
​
Details and Options
▪
type
is a
Symbol
naming the combinator shape (
Literal
,
Character
,
Sequence
,
Choice
,
Many
,
Some
,
Optional
,
Between
,
Lookahead
,
NotFollowedBy
,
Try
,
Action
,
Capture
,
Recursive
, …).
▪
args
are the combinator's children: other
ParserCombinator
instances, terminal data (a string for
Literal
, a character class for
Character
), or a function (for
Action
).
▪
opts
is an
Association
of compile-time / runtime options. After
ParserCompile
the options carry a
"Code"CompiledCodeFunction[...]
entry; absence of
"Code"
is what makes the parser uncompiled (no extra
"Compiled"
flag is needed).
▪
A
ParserCombinator
is callable as a function via a
SubValues
rule:
pc[input]
is equivalent to
Parse[pc,input]
. If
"Code"
is present in
opts
, the compiled function is invoked; otherwise the interpretive path runs.
▪
ParserCombinator
carries
UpValues
for the WL operators that overload to combinator composition:
WL syntax
UpValue
Combinator
p1|p2
Alternatives
ParseChoice
p1~~p2
StringExpression
ParseSequence
p..
Repeated
ParseSome
p...
RepeatedNull
ParseMany
Optional
[p]
Optional
ParseOptional
▪
~~
is overloaded only when both sides are
ParserCombinator
instances. Plain
"foo"~~"bar"
between strings keeps its built-in
StringExpression
meaning.
▪
~
is not overloaded - it stays as WL's infix function notation
a~f~bf[a,b]
.
▪
A
ParserCombinator
formats as a Wolfram-style
SummaryBox
showing the combinator type, arity, compile status, a structural sketch of the tree, and the options.
​
Examples  
(6)
Basic Examples  
(1)
A literal-matching parser is a
ParserCombinator
with type
Literal
:
In[1]:=
ParseLiteral
["foo"]
Out[1]=
ParserCombinator
Type: Literal
Arity: 1
Compiled: False

A sequence built with the
~~
operator is the same expression you'd get from
ParseSequence
directly:
In[2]:=
ParseLiteral
["foo"]~~
ParseLiteral
["bar"]
Out[2]=
ParserCombinator
Type: Sequence
Arity: 2
Compiled: False

The same
ParseSequence
call explicitly:
In[3]:=
ParseSequence

ParseLiteral
["foo"],
ParseLiteral
["bar"]
Out[3]=
ParserCombinator
Type: Sequence
Arity: 2
Compiled: False

Scope  
(2)

Properties & Relations  
(1)

Possible Issues  
(1)

Neat Examples  
(1)

SeeAlso
Parse
 
▪
ParserCompile
 
▪
ParseLiteral
 
▪
ParseSequence
 
▪
ParseChoice
 
▪
ParseMany
RelatedGuides
▪
WolframParser
""

© 2026 Wolfram. All rights reserved.

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