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

PatternMatcher

Guides

  • A Virtual Machine for the Pattern Matcher

Symbols

  • CompilePatternToBytecode
  • CreatePatternMatcherVirtualMachine
  • PatternBytecodeDisassemble
  • PatternBytecodeInformation
  • PatternBytecode
  • PatternBytecodeQ
  • PatternMatcherEnableTrace
  • PatternMatcherExecute
  • PatternMatcherMatch
  • PatternMatcherMatchQ
  • PatternMatcherReplace
  • PatternMatcherStep
  • PatternMatcherTraceEnabled
  • PatternMatcherTraceEnabledQ
  • PatternMatcherVirtualMachine
  • PatternToMatchFunction
DanielS`PatternMatcher`
PatternBytecodeDisassemble
​
PatternBytecodeDisassemble
[bytecode]
displays the compiled
bytecode
instructions in human-readable assembly format.
​
Details and Options
Examples  
(2)
Basic Examples  
(2)
Compile a simple pattern and inspect its bytecode:
In[1]:=
bytecode=
CompilePatternToBytecode
[_Integer];​​
PatternBytecodeDisassemble
[bytecode]
Out[1]=
L0:​
0 BEGIN_BLOCK Label[0]​
1 MATCH_HEAD %e0​, Expr[Integer]​, Label[1]​
2 JUMP Label[2] → L2
3 END_BLOCK Label[0]​
​L1:​
4 LOAD_IMM %b0​, 0
5 HALT
​L2:​
6 EXPORT_BINDINGS
7 LOAD_IMM %b0​, 1
8 HALT
​
​========================================​
​Statistics:​
Instructions: 9
Labels: 3
Expr registers: 1
Bool registers: 1
Blocks: 1 (max depth: 1)​
Jumps: 1
Backtrack points: 0
​
Instead of
PatternBytecode
objects, patterns can be passed directly:
In[1]:=
PatternBytecodeDisassemble
[_Integer|_Real|_String]
Out[1]=
L0:​
0 BEGIN_BLOCK Label[0]​
1 TRY Label[4]​
​L3:​
2 MATCH_HEAD %e0​, Expr[Integer]​, Label[7]​
3 JUMP Label[6] → L6
​L7:​
4 FAIL
​L4:​
5 RETRY Label[5]​
6 MATCH_HEAD %e0​, Expr[Real]​, Label[8]​
7 JUMP Label[6] → L6
​L8:​
8 FAIL
​L5:​
9 TRUST
10 MATCH_HEAD %e0​, Expr[String]​, Label[1]​
11 JUMP Label[6] → L6
​L6:​
12 JUMP Label[2] → L2
13 END_BLOCK Label[0]​
​L1:​
14 LOAD_IMM %b0​, 0
15 HALT
​L2:​
16 EXPORT_BINDINGS
17 LOAD_IMM %b0​, 1
18 HALT
​
​========================================​
​Statistics:​
Instructions: 19
Labels: 9
Expr registers: 1
Bool registers: 1
Blocks: 1 (max depth: 1)​
Jumps: 4
Backtrack points: 1
SeeAlso
PatternBytecode
 
▪
PatternBytecodeInformation
 
▪
CompilePatternToBytecode
RelatedGuides
▪
A Virtual Machine for the Pattern Matcher
""

© 2026 Wolfram. All rights reserved.

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