kaby76 / Antlr4BuildTasks

Third-party build tool for 'Official' Antlr4 tool and runtime parsers using .Net. Drop-in replacement for 'Antlr4cs' Antlr4 tool and build rules.
MIT License
75 stars 10 forks source link

Questions about syntax parsing #82

Open UtOpiiAa opened 6 months ago

UtOpiiAa commented 6 months ago

When I analyse my g4 file, an exception is raised : ANT02 error(156): invalid escape sequence \" 。 I don't know how to handle this problem,so I have to delete this '\"'

My full entry is below :

fragment ESC_SEQ : '\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\') | UNICODE_ESC | OCTAL_ESC ;

kaby76 commented 6 months ago

You don't need to "escape" a double quote. So instead of '\"' it should be '"'.

UtOpiiAa commented 6 months ago

Thank you very much!That problem bothered me for a long time because original antlr4 didn't recognize this error.

------------------ 原始邮件 ------------------ 发件人: "kaby76/Antlr4BuildTasks" @.>; 发送时间: 2024年3月9日(星期六) 晚上6:44 @.>; @.**@.>; 主题: Re: [kaby76/Antlr4BuildTasks] Questions about syntax parsing (Issue #82)

You don't need to "escape" a double quote. So instead of '\"' it should be '"'.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>