Antlr4BuildTasks icon indicating copy to clipboard operation
Antlr4BuildTasks copied to clipboard

Questions about syntax parsing

Open UtOpiiAa opened this issue 1 year ago • 2 comments

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 ;

UtOpiiAa avatar Mar 09 '24 07:03 UtOpiiAa

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

kaby76 avatar Mar 09 '24 10:03 kaby76

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: @.***>

UtOpiiAa avatar Mar 12 '24 02:03 UtOpiiAa