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`Brainfuck`
B
r
a
i
n
f
u
c
k
A
S
T
B
r
a
i
n
f
u
c
k
A
S
T
[
c
o
d
e
]
p
a
r
s
e
s
t
h
e
B
r
a
i
n
f
u
c
k
s
o
u
r
c
e
s
t
r
i
n
g
c
o
d
e
t
o
a
s
t
a
n
d
a
r
d
s
y
n
t
a
x
t
r
e
e
-
a
C
o
n
t
a
i
n
e
r
N
o
d
e
o
f
L
e
a
f
N
o
d
e
c
o
m
m
a
n
d
s
a
n
d
[
-
]
l
o
o
p
s
a
s
G
r
o
u
p
N
o
d
e
[
"
L
o
o
p
"
,
…
]
.
D
e
t
a
i
l
s
a
n
d
O
p
t
i
o
n
s
▪
B
r
a
i
n
f
u
c
k
A
S
T
is the standard-AST mode of the Brainfuck grammar: it runs
B
r
a
i
n
f
u
c
k
G
r
a
m
m
a
r
over a neutral node-building algebra, so the result carries only structure - which commands run, and how the loops nest - and no executable meaning.
▪
The eight commands
>
<
+
-
.
,
[
]
are the only significant characters. Each of the first six becomes a
"
C
o
m
m
a
n
d
"
L
e
a
f
N
o
d
e
holding its literal token; every
other
character is a comment and is dropped from the tree.
▪
A matched
[
…
]
pair becomes a
G
r
o
u
p
N
o
d
e
[
"
L
o
o
p
"
,
{
…
}
]
whose children are the parsed body. Loops nest arbitrarily, so a
G
r
o
u
p
N
o
d
e
[
"
L
o
o
p
"
,
…
]
can itself contain
G
r
o
u
p
N
o
d
e
[
"
L
o
o
p
"
,
…
]
.
▪
B
r
a
i
n
f
u
c
k
R
u
n
runs the
same
grammar over
B
r
a
i
n
f
u
c
k
S
e
m
a
n
t
i
c
instead, compiling the program to an executable closure and returning its output. The grammar is written once; only the algebra differs.
▪
Source whose brackets do not balance does not parse to completion and returns a
F
a
i
l
u
r
e
(see
P
a
r
s
e
).
Examples
(
4
)
Basic Examples
(
1
)
A single command is a
"
C
o
m
m
a
n
d
"
L
e
a
f
N
o
d
e
; a
[
…
]
pair is a
G
r
o
u
p
N
o
d
e
[
"
L
o
o
p
"
,
…
]
:
I
n
[
1
]
:
=
B
r
a
i
n
f
u
c
k
A
S
T
[
"
+
[
>
]
"
]
O
u
t
[
1
]
=
C
o
n
t
a
i
n
e
r
N
o
d
e
[
S
t
r
i
n
g
,
{
L
e
a
f
N
o
d
e
[
C
o
m
m
a
n
d
,
+
,
S
o
u
r
c
e
{
{
1
,
1
}
,
{
1
,
2
}
}
]
,
G
r
o
u
p
N
o
d
e
[
L
o
o
p
,
{
L
e
a
f
N
o
d
e
[
C
o
m
m
a
n
d
,
>
,
S
o
u
r
c
e
{
{
1
,
3
}
,
{
1
,
4
}
}
]
}
,
S
o
u
r
c
e
{
{
1
,
3
}
,
{
1
,
4
}
}
]
}
,
S
o
u
r
c
e
{
{
1
,
1
}
,
{
1
,
4
}
}
]
Every node carries a
"
S
o
u
r
c
e
"
span of
{
{
startLine
,
startCol
}
,
{
endLine
,
endCol
}
}
(
C
o
d
e
P
a
r
s
e
r
LineColumn). Each command
L
e
a
f
N
o
d
e
spans its single character, and the
G
r
o
u
p
N
o
d
e
[
"
L
o
o
p
"
,
…
]
spans its
content
- here the
>
at columns
3
-
4
, with the enclosing
[
and
]
delimiters excluded.
Every non-command character is a comment and leaves no trace - here only the
+
survives:
I
n
[
2
]
:
=
B
r
a
i
n
f
u
c
k
A
S
T
[
"
a
+
b
"
]
O
u
t
[
2
]
=
C
o
n
t
a
i
n
e
r
N
o
d
e
[
S
t
r
i
n
g
,
{
L
e
a
f
N
o
d
e
[
C
o
m
m
a
n
d
,
+
,
S
o
u
r
c
e
{
{
1
,
2
}
,
{
1
,
3
}
}
]
}
,
S
o
u
r
c
e
{
{
1
,
2
}
,
{
1
,
3
}
}
]
The same source through
B
r
a
i
n
f
u
c
k
R
u
n
runs the program rather than describing it:
I
n
[
3
]
:
=
B
r
a
i
n
f
u
c
k
R
u
n
[
"
+
+
+
+
+
+
[
>
+
+
+
+
+
+
+
+
+
+
<
-
]
>
+
+
+
+
+
.
"
]
O
u
t
[
3
]
=
A
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
B
r
a
i
n
f
u
c
k
R
u
n
▪
B
r
a
i
n
f
u
c
k
G
r
a
m
m
a
r
▪
B
r
a
i
n
f
u
c
k
S
e
m
a
n
t
i
c
▪
G
r
o
u
p
N
o
d
e
▪
L
e
a
f
N
o
d
e
▪
C
o
n
t
a
i
n
e
r
N
o
d
e
R
e
l
a
t
e
d
G
u
i
d
e
s
▪
P
a
r
s
e
r
Z
o
o
"
"