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`
BinaryNode
​
BinaryNode
[op,{lhs,rhs},meta]
is a binary-operator application: op is the operator descriptor string, the child list holds the left operand lhs and the right operand rhs, and meta is a metadata association.
​
Details and Options
▪
BinaryNode
is inert data: it carries no
DownValues
, so building one just holds the three arguments. It mirrors
CodeParser
sown
CodeParser
`BinaryNode
.
▪
op stays a language-native descriptor string (
"+"
,
":"
) rather than a Wolfram symbol, so one node serves arithmetic operators and a JSON
key:value
pairing alike.
▪
The child list always has exactly two elements. A left- or right-associative chain of the same operator nests as
BinaryNode
inside
BinaryNode
, rather than flattening into a single
InfixNode
.
▪
CalculatorAST
builds a
BinaryNode
for each of
+
-
*
/
^
, with the operator table giving
^
right associativity and the rest left.
JSONAST
uses
BinaryNode[":",{
key
,
value
}]
for each object member.
▪
The zoo grammars use
BinaryNode
(nested) where a flattening grammar might use
InfixNode
. meta holds a
"Source"
position when the node comes from a real parse, and is an empty

when you build the node by hand.
​
Examples  
(3)
Basic Examples  
(1)
A binary node built literally holds its operator and two-element child list:
In[1]:=
BinaryNode
"+",
LeafNode
["Integer","1",],
LeafNode
["Integer","2",],
Out[1]=
BinaryNode[+,{LeafNode[Integer,1,],LeafNode[Integer,2,]},]
An arithmetic sum parses to a
BinaryNode["+",…]
:
In[2]:=
CalculatorAST
["1+2"]
Out[2]=
ContainerNode[String,{BinaryNode[+,{LeafNode[Integer,1,Source{{1,1},{1,2}}],LeafNode[Integer,2,Source{{1,3},{1,4}}]},Source{{1,1},{1,4}}]},Source{{1,1},{1,4}}]
Each JSON object member is a
BinaryNode[":",…]
pairing the key leaf with the value:
In[3]:=
JSONAST
["{\"k\": 1}"]
Out[3]=
ContainerNode[String,{GroupNode[Object,{BinaryNode[:,{LeafNode[String,"k",Source{{1,2},{1,5}}],LeafNode[Integer,1,Source{{1,7},{1,8}}]},Source{{1,2},{1,8}}]},Source{{1,2},{1,8}}]},Source{{1,2},{1,8}}]
Scope  
(1)

Properties & Relations  
(1)

SeeAlso
InfixNode
 
▪
PrefixNode
 
▪
PostfixNode
 
▪
TernaryNode
 
▪
ASTNodeQ
 
▪
ToCodeParser
RelatedGuides
▪
ParserZoo
""

© 2026 Wolfram. All rights reserved.

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