[antlr-interest] ANTLR 3.0ea5 released
Terence Parr
parrt at cs.usfca.edu
Tue Jul 5 12:07:59 PDT 2005
Howdy. A few bug fixes and nice reorganization internally yields 3.0ea5
http://www.antlr.org/download/antlr-3.0ea4.tar.gz
http://www.antlr.org/download/examples-v3.tar.gz
Jean will release another version of ANTLRWorks soon.
Here is the change list in the README.txt file:
---------------
3.0ea5 - July 5, 2005
* Using '\n' in a parser grammar resulted in a nonescaped version of
'\n' in the token names table making compilation fail. I fixed this
by reorganizing/cleaning up portion of ANTLR that deals with
literals. See comment org.antlr.codegen.Target.
* Target.getMaxCharValue() did not use the appropriate max value
constant.
* ALLCHAR was a constant when it should use the Target max value
def. set complement for wildcard also didn't use the Target def.
Generally cleaned up the max char value stuff.
* Code gen didn't deal with ASTLabelType properly...I think even the
3.0ea4 example tree parser was broken! :(
* Added a few more unit tests dealing with escaped literals
-------------
Oh and for fun, here is an SMTP grammar (simplified) that I may use
for my lectures in India coming up. It's a nice example using
literals in the grammar
grammar SMTP;
requests : request* "QUIT" '\n';
request : hello from to data ;
hello : "HELO " host '\n' ;
from : "MAIL FROM: " addr '\n' ;
to : "RCPT TO: " addr '\n' ;
data : DATA ;
host : ID ('.' ID)* ;
addr : ID '@' host ;
ID : 'a'..'z' ('0'..'9'|'a'..'z')* ;
DATA : "DATA" '\n' ( options {greedy=false;}: . )* '\n' '.' '\n' ;
Here is some sample input:
HELO cs.usfca.edu
MAIL FROM: parrt at foo.com
RCPT TO: parrt at bar.com
DATA
hi Ter, I'm in India!
.
QUIT
Ter
--
CS Professor & Grad Director, University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Cofounder, http://www.jguru.com
More information about the antlr-interest
mailing list