[antlr-interest] How to write '\v' in antlr grammar?
Albert Huh
albert.huh at embarcadero-ca.com
Thu Mar 27 08:54:51 PST 2003
are you sure '\v' is a valid escape sequence in java/c++?
i could be wrong, but i don't think \v means anything at all...
-----Original Message-----
From: zai-qiang.leng at sybase.com [mailto:zai-qiang.leng at sybase.com]
Sent: Thursday, March 27, 2003 3:25 AM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] How to write '\v' in antlr grammar?
Hi,
I have following lexer rules,
protected
ESC
: '~'!
(
'n' {$setText('\n');}
| 'r' {$setText('\r');}
| 'v' {$setText('\v');} //If I
change the '\v' to ''(empty char), all is ok.
| 't' {$setText('\t');}
| 'f' {$setText('\f');}
| 'b' {$setText('\b');}
| ('0'..'2') (Digit) (Digit)
);
but when I compile it via antlr, I got following errors:
NTLR Parser Generator Version 2.7.1 1989-2000 jGuru.com
error: Token stream error reading
grammar(s):antlr.TokenStreamRecognitionException: unexpected char: v
TokenStreamException: unexpected char: v
Error executing c:\winnt\system32\cmd.exe.
Can anyone tell me how to solve this?
Thanks
Zaiqiang
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list