简体   繁体   中英

Target unrecognized escape sequence error

I have used AntlrWorks 1.4 before to generate parser and lexer for C# target. Now I am starting a new project and I try to use antlrworks1.5. But the generated lexer has lots of escape sequence error in the C# code. I tried the 1.4 version and it works fine.

Basically, the error is, in the 1.5 generated code, it has invalid escapes like "\\1\\2\\3" while they are "\\x01\\x02\\x03" in the 1.4 generated code.

Is there a way to solve this problem on 1.5 version? Or I have to stick with the 1.4 version.

The C# port of ANTLR 3 is not tested to work with ANTLRWorks or when using the Java version of the tool for code generation. It is only tested for using the MSBuild integration and/or Antlr3.exe to generate code. Any behavior that suggests that ANTLRWorks and/or the Java version of the ANTLR Tool can be used to generate code for the CSharp3 or CSharp2 targets is merely coincidental.

You can download the C# port along with documentation for configuring a C# project to build your grammars automatically at the following site:

http://www.antlr.org/wiki/display/ANTLR3/Antlr3CSharpReleases

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM