I modified the an example T.g from the Definitive guide section 9.4 and now
it produces no output.  I only modified the grammar to take multiple
statements.  I did not change the supporting code or input.  Original
grammar from the book works fine and is:

grammar T;
options {output=template;}
s : ID '=' INT ';' -> assign(x={$ID.text},y={$INT.text}) ;
ID: 'a'..'z'+ ;
INT:'0'..'9'+ ;
WS :(' '|'\t'|'\n'|'\r') {skip();} ;

My modified grammar is:

grammar T;
options {output=template;}
s : (stat) + ;
stat : ID '=' INT ';'  -> assign(x={$ID.text},y={$INT.text}) ;
ID: 'a'..'z'+ ;
INT:'0'..'9'+ ;
WS :(' '|'\t'|'\n'|'\r') {skip();} ;

Sample input from the book:
x=101;

What do I need to do to get the same output while supporting multiple
statements?  Why does this produce no output?









-- 
View this message in context: 
http://antlr.1301665.n2.nabble.com/modified-example-T-g-has-no-output-tp5805707p5805707.html
Sent from the ANTLR mailing list archive at Nabble.com.

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