How to recognize special characters with Gocc?

Hi, I am trying to do a lexical and parser. When I have \ * as input I should be able to ignore it, however I am not able to indicate in Gocc the escape character \ inside the lexical analyzer. I thought it could be with ‘\’ but it doesn’t work.

!whitespace: '\t' | '\n' | '\r' | ' ' ;
!comment:        '#' { . } '\n' ;
jump:    '\\' '*' ;

When trying to generate the files I get the following message.

Parse error: Error: char_lit(9) '\\' @ 5:21, expected one of: :

How can I read the special characters?

Thanks

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.