...
Debugging with ANTLRWorks
The ANTLRWorks tool is written in Java and is only able to debug Java recognizers directly. Nevertheless, you can debug your C# recognizers with ANTLRWorks by using the Remote Debugging feature of ANTLRWorks. In ANTLRWorks, Remote Debugging works by connectiong to a running instance of a debug-instrumented recognizer (generated with the -debug
switch to ANTLR) over the network.
To debug your C# recognizer with ANTLRWorks:
- Generate a debuggable version of your recognizer by specifying the
-debug
option to ANTLR - Create a driver program that creates your recognizer and runs some test input through it
- Compile your driver and recognizer to produce your executable file(s)
- Execute your driver program (it will launch your recognizer and appear to hang - it's just waiting for ANTLRWorks to connect)
- Start ANTLRWorks (or switch to it if it is already running) and click the menu Debugger|Debug Remote...
- Click Connect to accept the default host and port values (
localhost
and49153
respectively) - ANTLRWorks should now start debugging your recognizer!
Warning | ||
---|---|---|
| ||
ANTLRWorks remote debugging has only been tested for C# Parsers. TreeParsers and Lexers should work but... |