Silverfly
  • Welcome
  • Getting Started
    • Quickstart
    • Tokens
  • Basics
    • Lexer
      • Matcher
        • IgnoreMatcher
        • Custom Matcher
    • Parser
      • Parselet
    • Traverse the Tree
    • Read Eval Print Loop
    • Looking at the tree
  • Experts
    • Custom Naming Rules
    • Tree Rewriting
  • Guides
    • JSON
    • Parsing Predecesors
    • Using Multiple Tokens As Operators
  • Support
Powered by GitBook
On this page
  1. Basics

Looking at the tree

Sometimes it's usefull to look at the parsed syntax tree encapsulated from a running program. You can use a dotnet tool to view your ast right in your favourite terminal. You can install it with:

dotnet tool install --global Silverfly.TreeVisualizer

After installing the global dotnet tool, navigate to your directory where the dlls of the parser lives in the terminal. You can view the tree by executing 'silver-tree'

silver-tree -s "let f x y = f(x, y)"

The tool looks for an assembly that contains a parser and parses the input given by the -s option. If the directory contains more than one assembly with more than one parser you can specify which parser type to use by specifying the -p option with the fullname of your parser type with namespace

PreviousRead Eval Print LoopNextCustom Naming Rules

Last updated 7 months ago