Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The ANTLRWorks tool is written in Java and is only able to debug Java recognizers directlynatively. 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.

...

  1. Generate a debuggable version of your recognizer by specifying the -debug option to ANTLR
  2. Create a driver program that creates your recognizer and runs some test input through it (see the examples-v3 archive for sample driver programs)
  3. Compile your driver and recognizer to produce your executable file(s)
  4. Execute your driver program (it will launch your recognizer and appear to hang - it's just waiting for ANTLRWorks to connect)
  5. Start ANTLRWorks (or switch to it if it is already running) and click the menu Debugger|Debug Remote...
  6. Click Connect to accept the default host and port values (localhost and 49153 respectively)
  7. ANTLRWorks should now start debugging your recognizer!
    Warning
    titleWarning

    ANTLRWorks remote debugging has only been tested for C# Parsers. TreeParsers and Lexers should work but...

Note
titleANTLRWorks and ANTLR version compatibility

ANTLRWorks v1.1.x is required for recognizers created with ANTLR v3.0.x only. For recognizers created with ANTLR v3.1.x, you will need ANTLRWorks v1.2.x.

...