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`
P
a
r
s
e
P
o
s
i
t
i
o
n
P
a
r
s
e
P
o
s
i
t
i
o
n
[
]
i
s
t
h
e
z
e
r
o
-
w
i
d
t
h
P
a
r
s
e
r
C
o
m
b
i
n
a
t
o
r
t
h
a
t
y
i
e
l
d
s
t
h
e
c
u
r
r
e
n
t
1
-
b
a
s
e
d
c
h
a
r
a
c
t
e
r
p
o
s
i
t
i
o
n
a
n
d
c
o
n
s
u
m
e
s
n
o
t
h
i
n
g
.
B
r
a
c
k
e
t
i
n
g
a
s
u
b
-
p
a
r
s
e
r
,
P
a
r
s
e
P
o
s
i
t
i
o
n
[
]
~
~
p
~
~
P
a
r
s
e
P
o
s
i
t
i
o
n
[
]
,
c
a
p
t
u
r
e
s
t
h
e
s
o
u
r
c
e
s
p
a
n
p
c
o
v
e
r
s
-
t
h
e
s
t
a
r
t
p
o
s
i
t
i
o
n
,
p
'
s
v
a
l
u
e
,
t
h
e
n
t
h
e
e
n
d
(
o
n
e
p
a
s
t
t
h
e
l
a
s
t
c
h
a
r
a
c
t
e
r
)
.
D
e
t
a
i
l
s
a
n
d
O
p
t
i
o
n
s
▪
P
a
r
s
e
P
o
s
i
t
i
o
n
[
]
is
zero-width
: it matches at every position, succeeds always, and advances the cursor by nothing - like
P
a
r
s
e
S
u
c
c
e
e
d
with the cursor offset as its value. It is a built-in parser, not a combinator over other parsers.
▪
The position is a 1-based character offset into the input. The
end
position a closing
P
a
r
s
e
P
o
s
i
t
i
o
n
[
]
reports is
one past
the last character the bracketed parser consumed, so
e
n
d
-
s
t
a
r
t
is exactly the number of characters matched.
▪
Bracketing yields a
{
s
t
a
r
t
,
v
a
l
u
e
,
e
n
d
}
shape: the leading
P
a
r
s
e
P
o
s
i
t
i
o
n
[
]
contributes
start
, the inner parser its
value
, the trailing
P
a
r
s
e
P
o
s
i
t
i
o
n
[
]
the
end
. Inside a
P
a
r
s
e
S
e
q
u
e
n
c
e
those three become successive elements; reshape with
P
a
r
s
e
A
c
t
i
o
n
.
▪
This is the primitive behind source tracking.
S
p
a
n
n
e
d
T
o
k
e
n
uses
P
a
r
s
e
P
o
s
i
t
i
o
n
[
]
to record each leaf's offset span, and
A
S
T
A
d
d
S
o
u
r
c
e
turns those offsets into
{
{
s
t
a
r
t
L
i
n
e
,
s
t
a
r
t
C
o
l
u
m
n
}
,
{
e
n
d
L
i
n
e
,
e
n
d
C
o
l
u
m
n
}
}
pairs -
C
o
d
e
P
a
r
s
e
r
's LineColumn convention.
Examples
(
2
)
Basic Examples
(
1
)
P
a
r
s
e
P
o
s
i
t
i
o
n
[
]
is a built-in parser like
P
a
r
s
e
S
u
c
c
e
e
d
- it carries no children:
I
n
[
1
]
:
=
P
a
r
s
e
P
o
s
i
t
i
o
n
[
]
O
u
t
[
1
]
=
P
a
r
s
e
r
C
o
m
b
i
n
a
t
o
r
T
y
p
e
:
P
o
s
i
t
i
o
n
A
r
i
t
y
:
0
C
o
m
p
i
l
e
d
:
F
a
l
s
e
Bracket a number parser to capture the span it covers - start
1
, the matched text, end
4
(one past the last digit):
I
n
[
2
]
:
=
P
a
r
s
e
P
a
r
s
e
S
e
q
u
e
n
c
e
P
a
r
s
e
P
o
s
i
t
i
o
n
[
]
,
P
a
r
s
e
R
e
g
e
x
[
"
[
0
-
9
]
+
"
]
,
P
a
r
s
e
P
o
s
i
t
i
o
n
[
]
,
"
1
2
3
"
O
u
t
[
2
]
=
{
1
,
1
2
3
,
4
}
Because it consumes nothing, a
P
a
r
s
e
P
o
s
i
t
i
o
n
[
]
after
a whitespace skip reports the position the next token actually starts at. Reshape with
P
a
r
s
e
A
c
t
i
o
n
to keep just the
{
s
t
a
r
t
,
v
a
l
u
e
,
e
n
d
}
triple:
I
n
[
3
]
:
=
w
s
=
P
a
r
s
e
M
a
n
y
P
a
r
s
e
C
h
a
r
a
c
t
e
r
[
W
h
i
t
e
s
p
a
c
e
C
h
a
r
a
c
t
e
r
]
;
s
p
a
n
n
e
d
=
P
a
r
s
e
A
c
t
i
o
n
w
s
~
~
P
a
r
s
e
P
o
s
i
t
i
o
n
[
]
~
~
P
a
r
s
e
R
e
g
e
x
[
"
[
0
-
9
]
+
"
]
~
~
P
a
r
s
e
P
o
s
i
t
i
o
n
[
]
,
F
u
n
c
t
i
o
n
[
{
s
k
i
p
,
s
,
v
,
e
}
,
{
s
,
v
,
e
}
]
;
P
a
r
s
e
[
s
p
a
n
n
e
d
,
"
1
2
3
"
]
O
u
t
[
3
]
=
{
3
,
1
2
3
,
6
}
The start jumped to
3
, past the two leading spaces.
P
r
o
p
e
r
t
i
e
s
&
R
e
l
a
t
i
o
n
s
(
1
)
S
e
e
A
l
s
o
P
a
r
s
e
S
e
q
u
e
n
c
e
▪
P
a
r
s
e
A
c
t
i
o
n
▪
S
p
a
n
n
e
d
T
o
k
e
n
▪
A
S
T
A
d
d
S
o
u
r
c
e
R
e
l
a
t
e
d
G
u
i
d
e
s
▪
W
o
l
f
r
a
m
P
a
r
s
e
r
▪
P
a
r
s
e
r
Z
o
o
"
"