[antlr-interest] Antlr syntax reference

Sam Kuper sam.kuper at uclmail.net
Tue Jun 24 11:59:42 PDT 2008


Dear Steven,

2008/6/24 Steven D. Vormwald <sdvormwa at mtu.edu>:

> I could be wrong about this, but I believe ANTLR recognizes the same
> character escapes in strings that java does:
>
> '\n' is newline
> '\r' is carriage return
> '\t' is tab
> '\uXXXX' is the unicode character at codepoint XXXX (in hex)
> '\\' is backslash
>
> and so on.  From http://www.antlr.org/wiki/display/ANTLR3/Grammars (Lexer
> Rules section), you can see examples of the '\t' and '\uXXXX' being used.  I
> don't think this is a rule, as much as a convention for inserting "special"
> characters in strings.
>

Right you are. Thought I'd already searched for '\n' on
http://www.antlr.org/wiki/display/ANTLR3/Grammars - I must have searched for
'/n' - oops (I've obviously been having a long day... :-/ ).

Thanks for picking this up for me! It's answered my request :)

Sam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080624/97af2eed/attachment.html 


More information about the antlr-interest mailing list