ANTLRworks 1.5 C# Unicode Codegen

60 views
Skip to first unread message

wish...@gmail.com

unread,
Jan 11, 2013, 4:36:48 AM1/11/13
to antlr-di...@googlegroups.com
Hi!

I have a mixed grammar which uses the NOT operator at a Lexer rule to be able to range over UTF8 including special chars:

OTHERCHAR : ~('<'|'{');


This generates... though I see some code like this in a C# target with the following codegen opts:

options
{
language=CSharp3;
output=ast;
}

The C# 3 code:

private class DFA3 : DFA
{
private const string DFA3_eotS =
"\2\uffff\1\15\1\17\1\uffff\1\23\1\26\7\uffff\1\20\5\uffff\1\20\5\uffff"+
[...]
};


In C# these sequences cannot be processed, because they're not Unicode escape sequences.
Do I have to change the codegen template now or is there an option which I'm missing?

Best,
Marius

Sam Harwell

unread,
Jan 16, 2013, 4:45:24 AM1/16/13
to antlr-di...@googlegroups.com
I haven't released an update to the C# port of ANTLR which corresponds to the recently released 3.5 version. This update will be coming soon, after which point you'll be able to use Antlr3.exe (the C# port of the ANTLR tool) to generate your code for both the CSharp2 and CSharp3 targets.

I'll make sure the code generation for these targets does not use the invalid escape sequences you refer to below, but once I do you'll definitely need to generate code for both of these targets using the updated Antlr3.exe.

Thank you,
--
Sam Harwell
Owner, Lead Developer
http://tunnelvisionlabs.com
--




Reply all
Reply to author
Forward
0 new messages