Wolfram Language
Paclet Repository
Community-contributed installable additions to the Wolfram Language
Primary Navigation
Categories
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
Create a Paclet
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`Languages`JSON`
J
S
O
N
G
r
a
m
m
a
r
J
S
O
N
G
r
a
m
m
a
r
[
a
l
g
]
b
u
i
l
d
s
t
h
e
R
F
C
8
2
5
9
J
S
O
N
p
a
r
s
e
r
,
a
P
a
r
s
e
r
C
o
m
b
i
n
a
t
o
r
,
p
a
r
a
m
e
t
e
r
i
z
e
d
o
v
e
r
t
h
e
a
l
g
e
b
r
a
a
l
g
-
a
n
A
s
s
o
c
i
a
t
i
o
n
o
f
b
u
i
l
d
e
r
f
u
n
c
t
i
o
n
s
i
t
s
s
e
m
a
n
t
i
c
a
c
t
i
o
n
s
c
a
l
l
.
D
e
t
a
i
l
s
a
n
d
O
p
t
i
o
n
s
▪
J
S
O
N
G
r
a
m
m
a
r
is the
one
grammar behind both JSON modes. The grammar structure - objects, arrays, members, the string and number tokens - is fixed;
alg
decides what each production
builds
.
▪
Hand it
J
S
O
N
S
e
m
a
n
t
i
c
and it folds JSON to a native Wolfram value; that parser is what
J
S
O
N
I
m
p
o
r
t
runs. Hand it the tree-building algebra and it emits the
G
r
o
u
p
N
o
d
e
/
B
i
n
a
r
y
N
o
d
e
/
L
e
a
f
N
o
d
e
syntax tree; that parser is what
J
S
O
N
A
S
T
runs. One grammar, two algebras.
▪
alg
must supply the builders the actions call:
"
S
t
r
"
,
"
N
u
m
"
,
"
B
o
o
l
"
,
"
N
u
l
l
"
,
"
M
e
m
b
e
r
"
,
"
O
b
j
e
c
t
"
,
"
A
r
r
a
y
"
.
J
S
O
N
S
e
m
a
n
t
i
c
is one such algebra.
▪
The returned
P
a
r
s
e
r
C
o
m
b
i
n
a
t
o
r
runs on a string the usual way:
p
a
r
s
e
r
[
i
n
p
u
t
]
, equivalently
P
a
r
s
e
[
p
a
r
s
e
r
,
i
n
p
u
t
]
.
▪
Object and array recursion is wired through the recursion cells of the parser zoo (
R
e
c
C
e
l
l
,
R
e
c
R
e
f
,
S
e
t
R
e
c
), so a value may nest inside an array inside an object to any depth.
Examples
(
4
)
Basic Examples
(
1
)
J
S
O
N
G
r
a
m
m
a
r
over
J
S
O
N
S
e
m
a
n
t
i
c
is a
P
a
r
s
e
r
C
o
m
b
i
n
a
t
o
r
:
I
n
[
1
]
:
=
H
e
a
d
J
S
O
N
G
r
a
m
m
a
r
J
S
O
N
S
e
m
a
n
t
i
c
O
u
t
[
1
]
=
P
a
r
s
e
r
C
o
m
b
i
n
a
t
o
r
Run it on a string to fold JSON to a native value:
I
n
[
2
]
:
=
J
S
O
N
G
r
a
m
m
a
r
J
S
O
N
S
e
m
a
n
t
i
c
[
"
[
1
,
2
,
3
]
"
]
O
u
t
[
2
]
=
{
1
,
2
,
3
}
That is exactly what
J
S
O
N
I
m
p
o
r
t
does:
I
n
[
3
]
:
=
J
S
O
N
I
m
p
o
r
t
[
"
[
1
,
2
,
3
]
"
]
O
u
t
[
3
]
=
{
1
,
2
,
3
}
S
c
o
p
e
(
1
)
P
r
o
p
e
r
t
i
e
s
&
R
e
l
a
t
i
o
n
s
(
1
)
P
o
s
s
i
b
l
e
I
s
s
u
e
s
(
1
)
S
e
e
A
l
s
o
J
S
O
N
S
e
m
a
n
t
i
c
▪
J
S
O
N
I
m
p
o
r
t
▪
J
S
O
N
A
S
T
▪
P
a
r
s
e
r
C
o
m
b
i
n
a
t
o
r
▪
A
S
T
A
l
g
e
b
r
a
▪
P
a
r
s
e
R
e
l
a
t
e
d
G
u
i
d
e
s
▪
P
a
r
s
e
r
Z
o
o
"
"