/lezer-tree-visualizer

A basic tool for debugging lezer syntax trees in the console

Primary LanguageTypeScript

lezer-tree-visualizer

CodeMirror 6 Documentation npm (scoped)

A basic tool for debugging syntax trees by visualizing them. This module exports two functions, one for directly printing to the console and another one for storing the formatted string (without color formatting).

This modules supports both native consoles and the web. This library detects if it is run in the browser or Node.

Example

This is a simple Java program which can be parsed with lezer-java:

package tests;

import java.lang.String;

/**
 * Test
 */
public class Test {
  public static void main(String[] args) {
    System.out.println("Hello world!");
  }
}

When printing the syntax tree to the console:

Java Tree