Visual Studio debugging visualizer for ANTLR4 parse trees
Selection sync, when selecting in the token list, the tree view, or the source text.
Filtering the token list, by text, whitespace, or error; or by specific token types:
Filtering the parse tree nodes by text, whitespace, or error nodes; or by specific rule types.
Set a specific node as the root node, either in the current window, or in a new window
You can also embed the same UI in your own applications.
Before installing, you need to determine two things:
Then:
Go to the releases page. Choose the appropriate ZIP file(s) based on the Antlr4 variant and your version of Visual Studio.
For example, if you’re in Visual Studio 2019 and debugging code written against Antlr4.Runtime.Standard
, download the ParseTreeVisualizer.Standard.2019.zip
file.
Note: if you need to, you can download and install all four visualizer variants; they won’t overwrite each other.
You may need to unblock the file.
Unzip the contents of the ZIP file into one of Visual Studio’s recognized visualizer folders:
\Common7\Packages\Debugger\Visualizers
My Documents\Visual Studio
Version\Visualizers
You don’t have to restart VS, just make sure VS is not currently in a debugging session
You can also compile the source yourself (ANTLR4ParseTreeVisualizer.sln
) and place the output DLLs in one of the appropriate visualizer folders.
For VS 2017, the DLLs will end up in either the Visualizers
parent folder, or a single subfolder. For VS 2019, there are additional subfolders for debugging various target frameworks.
Antlr4.Runtime.RuleContext
, Antlr4.Runtime.BufferedTokenStream
, or string
), in the code editor, or the Watch or Locals window. This instance can be exposed by any variable, or any expression; the type of the expression doesn’t matter.string
and there are multiple lexers in the debugged assemblies.BufferedTokenStream
or a string
, and the debugged assemblies have multiple parser classes.Note that these choices — selected lexer, parser and parser method — persist between sessions, so if you’ve already chosen, there’s no need to do so again.