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`
M
a
r
k
d
o
w
n
I
n
l
i
n
e
P
a
r
s
e
M
a
r
k
d
o
w
n
I
n
l
i
n
e
P
a
r
s
e
[
s
o
u
r
c
e
]
p
a
r
s
e
s
i
n
l
i
n
e
m
a
r
k
d
o
w
n
s
o
u
r
c
e
(
a
S
t
r
i
n
g
—
t
h
e
s
p
a
n
-
l
e
v
e
l
c
o
n
t
e
n
t
o
f
a
s
i
n
g
l
e
p
a
r
a
g
r
a
p
h
)
i
n
t
o
a
f
l
a
t
L
i
s
t
o
f
i
n
l
i
n
e
-
a
t
o
m
A
s
s
o
c
i
a
t
i
o
n
s
,
e
a
c
h
c
a
r
r
y
i
n
g
a
"
T
y
p
e
"
d
i
s
c
r
i
m
i
n
a
t
o
r
(
"
T
e
x
t
"
,
"
B
o
l
d
"
,
"
I
t
a
l
i
c
"
,
"
C
o
d
e
"
,
"
L
i
n
k
"
,
"
M
a
t
h
I
n
l
i
n
e
"
,
…
)
p
l
u
s
p
e
r
-
s
h
a
p
e
p
a
y
l
o
a
d
k
e
y
s
.
D
e
t
a
i
l
s
a
n
d
O
p
t
i
o
n
s
▪
The result is a flat
L
i
s
t
of
A
s
s
o
c
i
a
t
i
o
n
s. Prose runs are
"
T
y
p
e
"
"
T
e
x
t
"
,
"
T
e
x
t
"
s
t
r
; emphasis is
"
B
o
l
d
"
/
"
I
t
a
l
i
c
"
/
"
B
o
l
d
I
t
a
l
i
c
"
; code is
"
C
o
d
e
"
/
"
L
i
t
e
r
a
l
C
o
d
e
"
/
"
H
t
m
l
C
o
d
e
"
; math is
"
M
a
t
h
I
n
l
i
n
e
"
/
"
M
a
t
h
D
i
s
p
l
a
y
"
; the paired references are
"
L
i
n
k
"
and
"
I
m
a
g
e
"
; and
"
S
u
b
"
/
"
S
u
p
"
/
"
S
t
r
i
k
e
"
cover the remaining spans.
▪
A span's body — the
"
C
h
i
l
d
r
e
n
"
of an emphasis / sub / sup / strike atom, or the
"
L
a
b
e
l
"
of a link — is itself a
L
i
s
t
of inline atoms, because the captured body is re-parsed recursively. So
*
*
b
o
l
d
$
x
$
*
*
nests a
"
M
a
t
h
I
n
l
i
n
e
"
atom inside the
"
B
o
l
d
"
.
▪
Adjacent
"
T
e
x
t
"
atoms are merged, so a contiguous prose run is one atom, not one atom per character.
▪
Overlapping openers resolve by PEG order, longest first:
*
*
*
before
*
*
before
*
, double backtick before single,
$
$
before
$
, and the HTML
<
s
u
b
>
/
<
s
u
p
>
before their single-character Pandoc twins.
▪
Underscore emphasis follows CommonMark word-boundary rules:
_
e
m
_
opens emphasis at a word boundary, but an underscore between word characters (
s
n
a
k
e
_
c
a
s
e
) stays literal.
▪
A literal
.
.
.
inside a
"
T
e
x
t
"
run becomes the Unicode ellipsis character;
.
.
.
inside a code span or math span is left verbatim.
▪
A backslash before ASCII punctuation (
\
*
,
\
$
) yields that punctuation as literal text rather than opening a span.
▪
An unclosed delimiter is not an error — the opener and its trailing text stay as literal
"
T
e
x
t
"
.
▪
M
a
r
k
d
o
w
n
I
n
l
i
n
e
P
a
r
s
e
handles inline constructs only. Whole-document structure (frontmatter, headings, code fences, thematic breaks, paragraph splitting) is
M
a
r
k
d
o
w
n
P
a
r
s
e
's job; feed a document's
"
P
r
o
s
e
"
block text through this function to resolve its spans.
▪
M
a
r
k
d
o
w
n
I
n
l
i
n
e
P
a
r
s
e
is the wrapper around the
M
a
r
k
d
o
w
n
I
n
l
i
n
e
P
a
r
s
e
r
combinator: it runs
P
a
r
s
e
and then merges text runs, applies the ellipsis and underscore-emphasis passes, and re-parses span children. On a parse failure it returns the
F
a
i
l
u
r
e
object unchanged.
▪
The grammar and its post-processing passes are walked through in the
M
a
r
k
d
o
w
n
i
n
l
i
n
e
p
a
r
s
e
r
t
u
t
o
r
i
a
l
.
Examples
(
1
5
)
Basic Examples
(
1
)
Plain prose is a single
"
T
e
x
t
"
atom:
I
n
[
1
]
:
=
M
a
r
k
d
o
w
n
I
n
l
i
n
e
P
a
r
s
e
[
"
p
l
a
i
n
t
e
x
t
"
]
O
u
t
[
1
]
=
{
T
y
p
e
T
e
x
t
,
T
e
x
t
p
l
a
i
n
t
e
x
t
}
Emphasis and code spans become their own atoms, with the surrounding prose in
"
T
e
x
t
"
runs:
I
n
[
2
]
:
=
M
a
r
k
d
o
w
n
I
n
l
i
n
e
P
a
r
s
e
[
"
*
*
b
o
l
d
*
*
a
n
d
`
c
o
d
e
`
"
]
O
u
t
[
2
]
=
{
T
y
p
e
B
o
l
d
,
C
h
i
l
d
r
e
n
{
T
y
p
e
T
e
x
t
,
T
e
x
t
b
o
l
d
}
,
T
y
p
e
T
e
x
t
,
T
e
x
t
a
n
d
,
T
y
p
e
C
o
d
e
,
C
o
d
e
c
o
d
e
}
A link's label is parsed recursively — here it is a code span, not plain text:
I
n
[
3
]
:
=
M
a
r
k
d
o
w
n
I
n
l
i
n
e
P
a
r
s
e
[
"
[
`
R
a
n
g
e
`
]
(
p
a
c
l
e
t
:
r
e
f
/
R
a
n
g
e
)
"
]
O
u
t
[
3
]
=
{
T
y
p
e
L
i
n
k
,
U
r
l
p
a
c
l
e
t
:
r
e
f
/
R
a
n
g
e
,
L
a
b
e
l
{
T
y
p
e
C
o
d
e
,
C
o
d
e
R
a
n
g
e
}
}
S
c
o
p
e
(
8
)
P
r
o
p
e
r
t
i
e
s
&
R
e
l
a
t
i
o
n
s
(
3
)
P
o
s
s
i
b
l
e
I
s
s
u
e
s
(
2
)
N
e
a
t
E
x
a
m
p
l
e
s
(
1
)
S
e
e
A
l
s
o
M
a
r
k
d
o
w
n
I
n
l
i
n
e
P
a
r
s
e
r
▪
M
a
r
k
d
o
w
n
P
a
r
s
e
▪
M
a
r
k
d
o
w
n
P
a
r
s
e
r
▪
P
a
r
s
e
▪
P
a
r
s
e
r
C
o
m
b
i
n
a
t
o
r
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
"
"