...
Code Block |
---|
@lexer::namespace { My.Custom.NameSpace.For.Lexers } @parser::namespace { My.Custom.NameSpace.For.ParsersInclTreeParsers } |
Syntactic differences from the Java target
The C# target uses language features like properties as the official coding guidelines which cause the general documentation to differ from what can be really used for the C# target. The rule of thumb is, that the attributes of rules are accessed with a capital letter at the beginning. Nonetheless there are exceptions so the goal is to have a comprehensive overview. If there are any errors, please fix them or send an email to the mailing list.
Java Syntax | C# Syntax | Notes |
---|---|---|
text | Text |
|
start | Start | Untested |
stop | Stop | Untested |
tree | Tree | Untested |
st | st |
|
type | Type | Untested |
line | Line | Untested |
pos | Pos | Untested |
channel | Channel | Untested |
$x.size() | $x.Count |
|
Debugging 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 (see the examples-v3 archive for sample driver programs)
- 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 title Warning ANTLRWorks remote debugging has only been tested for C# Parsers. TreeParsers and Lexers should work but...
...