Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
zspitz committed Nov 13, 2019
2 parents 38aa545 + 595df20 commit afeb89f
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* List of tokens (error tokens are highlighted in red)
* Treeview of rule contexts and terminal nodes (error nodes in red)
* Properties of selected treeview node (properties not declared in the Antlr namespace are checked)
* Source view
* Input text, or the text from the current channel positioned as in the input
* Selection sync, when selecting in the token list, the tree view, or the source text.

![Selection sync](selection-sync.gif)
Expand All @@ -29,18 +29,20 @@
## Requirements

* Visual Studio 2017 or 2019
(If you're using an older version of VS, you could probably use the visualizer as well. Compile against the appropriate version of Microsoft.VisualStudio.DebuggerVisualizers.dll.)
(This is not a hard dependency; the visualizer can probably be compiled against an older version of Microsoft.VisualStudio.DebuggerVisualizers.dll and used with the relevant VS version.)
* Supports the current Antlr.Runtime.Standard.DLL (4.7.2) as well as the older Antlr.Runtime.DLL (4.6.6).

## Installation

1. Download the ZIP file matching your version of Visual Studio (2019 or 2017) from the [releases](https://github.com/zspitz/ANTLR4ParseTreeVisualizer/releases) page. You may need to [unblock the ZIP file](https://github.com/zspitz/ExpressionToString/wiki/Troubleshooting-visualizer-installation).
2. Unzip the contents of the ZIP file into one of Visual Studio's recognized visualizer folders. You don't have to restart VS, just make sure VS is not currently in a debugging session:
2. Unzip the contents of the ZIP file into one of Visual Studio's recognized visualizer folders:

* _VisualStudioInstallPath_`\Common7\Packages\Debugger\Visualizers`
* `My Documents\Visual Studio `_Version_`\Visualizers`

You can also compile the source yourself (`2019.sln` or `2017.sln`) and place the output DLLs in one of the visualizer folder.
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 (`2019.sln` or `2017.sln`) and place the output DLLs in one of the visualizer folders.

If you are debugging .NET Core applications, you may also need to put an additional copy of the visualizer files in a subfolder called `netstandard2.0`, under the folder where you installed the visualizer.

Expand All @@ -50,7 +52,7 @@ If you are debugging .NET Core applications, you may also need to put an additio
2. Hover over an instance of one of the visualizer target types (`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.
3. Click on the magnifying glass to the right of the expression.
4. You may need to choose a lexer class if you are visualizing a `string` and there are multiple lexers in the debugged assemblies; and you haven't already done so.
5. You may need to choose a parser class from the settings, if you are visualizing a `BufferedTokenStream` or a `string`, or the debugged assemblies have multiple parser classes; you will also need to choose a parsing method. (These choices persist between sessions, so if you've already chosen, there's no need to do so again.)
5. You may need to choose a parser class and a parser method from the settings, if you are visualizing a `BufferedTokenStream` or a `string`, and the debugged assemblies have multiple parser classes. (These choices persist between sessions, so if you've already chosen, there's no need to do so again.)

![Visualizing a string](visualize-string.gif)

Expand All @@ -60,10 +62,11 @@ If you are debugging .NET Core applications, you may also need to put an additio
* Suggest ideas and enhancements ([issues](https://github.com/zspitz/ANTLR4ParseTreeVisualizer/issues/new))
* Notify about bugs ([issues](https://github.com/zspitz/ANTLR4ParseTreeVisualizer/issues/new))
* Provide screenshots which could be used to demonstrate different features of the visualizer (also via ([issues](https://github.com/zspitz/ANTLR4ParseTreeVisualizer/issues/new)))
* Feel free to star the project
* Star the project
* Spread the word
* Provide feedback to Microsoft about [these limitations to the visualizer API](https://github.com/zspitz/ExpressionToString/wiki/External-issues)

## Roadmap

* [Parsing errors in a separate pane](https://github.com/zspitz/ANTLR4ParseTreeVisualizer/issues/24)
* Live window, perhaps as a VS extension. It should be possible to select a lexer class from a lexer assembly, a parser class from a parser assembly, and display the resultant token stream and parse tree.
* [Standalone viewer](https://github.com/zspitz/ANTLR4ParseTreeVisualizer/issues/19)

0 comments on commit afeb89f

Please sign in to comment.