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`Languages`Brainfuck`
BrainfuckRun
​
BrainfuckRun
[code]
compiles the Brainfuck source string code to a Wolfram closure, runs it on a fresh byte tape, and returns the output string.
​
​
BrainfuckRun
[code,input]
runs the program with input supplied to the
,
command.
​
Details and Options
▪
BrainfuckRun
is the executing mode of the Brainfuck grammar: it runs
BrainfuckGrammar
over
BrainfuckSemantic
, the algebra that compiles each construct to a function machine -> machine. The parsed program is an executable closure; running it threads a fresh machine through and collects its output.
▪
The machine is a single
Association
carrying a byte
"tape"
(an
Association
of cell index to value), a cell
"ptr"
, the remaining
"in"
bytes, and the accumulated
"out"
bytes. Every cell starts at
0
; arithmetic on a cell is taken
Mod
256
.
▪
Each
.
appends the current cell to the output; the final byte list is decoded with
FromCharacterCode
into the returned string. Each
,
consumes one byte of input, or writes
0
once the input is exhausted.
▪
To see the structure of code rather than run it, use
BrainfuckAST
, which runs the same grammar over a neutral node-building algebra. The grammar is written once; only the algebra differs.
▪
Source whose brackets do not balance does not parse to completion and returns a
Failure
(see
Parse
).
​
Examples  
(4)
Basic Examples  
(1)
The canonical "A" program: build
60
in a cell with a multiply loop, add
5
, and print it:
In[1]:=
BrainfuckRun
["++++++[>++++++++++<-]>+++++."]
Out[1]=
A
The classic hello-world program returns the greeting, newline and all:
In[2]:=
BrainfuckRun
["++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++."]
Out[2]=
Hello World!
The same source through
BrainfuckAST
describes the program instead of running it:
In[3]:=
BrainfuckAST
["+++."]
Out[3]=
ContainerNode[String,{LeafNode[Command,+,Source{{1,1},{1,2}}],LeafNode[Command,+,Source{{1,2},{1,3}}],LeafNode[Command,+,Source{{1,3},{1,4}}],LeafNode[Command,.,Source{{1,4},{1,5}}]},Source{{1,1},{1,5}}]
Scope  
(1)

Properties & Relations  
(1)

Possible Issues  
(1)

SeeAlso
BrainfuckAST
 
▪
BrainfuckGrammar
 
▪
BrainfuckSemantic
 
▪
FromCharacterCode
 
▪
RightComposition
RelatedGuides
▪
ParserZoo
""

© 2026 Wolfram. All rights reserved.

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