Hi,

Here's my first attempt at an ANTLR project. For practice, I just want 
to read a file with lowercase words and print them. I feed it "hi there 
how are you"
All that the program prints is "hi".

Many thanks in advance,

PG

grammar pg;

doc
:    a = word {System.out.println($a.value);} ( WS b = word 
{System.out.println($b.value);}  )*;

word    returns[String value]
:LETTERS  {$value = $LETTERS.text;}  ;

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

LETTERS:    ('a'..'z')+;

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to