[antlr-interest] Tom, a question

Bryan S Follins asalh at mindspring.com
Thu Jul 16 23:10:48 PDT 2009


Tom,

 

How can I add a rule to the code below which would allow me to enter a
number (like a zip code?)

 

I can already enter letters.

 

OK...The following is ANTLR Code

 

grammar T;

 

r     :     'call' ID ';'     {System.out.println("invoke "+$ID.text);};

ID    :     'a'..'z'+;

WS    :     (' ' | '\n' | '\r')+ {$channel=HIDDEN;};

 

Bryan

 

"When you have eliminated the impossible, whatever remains, however
improbable, must be the truth."

--Sherlock Holmes from Sir Arthur Conan Doyle's The Sign of Four.

 

I AM an information warrior...

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090716/eda3e708/attachment.html 


More information about the antlr-interest mailing list