[antlr-interest] text associated with production

Andrew Deren andrew at adersoftware.com
Tue Apr 15 09:01:42 PDT 2003


But I think the problem with that approach would be that you will have some
things stripped out (like white space if you have that skipped)

One possible solution I think would be to get position of the first token
and position and length of the last token in a group, and then using that
information get the text data from the input.

-----Original Message-----
From: mzukowski at yci.com [mailto:mzukowski at yci.com] 
Sent: Tuesday, April 15, 2003 9:13 AM
To: antlr-interest at yahoogroups.com

Antlr doesn't do this for you.  You need to collect the tokens and get the
text out of them yourself.  Or build a tree in that rule and get the text
from the nodes in the tree.

Monty

-----Original Message-----
From: Nitin Gupta [mailto:nitin_bitkmc at yahoo.com]
Sent: Tuesday, April 15, 2003 6:02 AM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] text associated with production


Hi all
i want to get complete text associated with productions as we can do for
tokens. lets say following is a production
forStatement: forKeyword LPAREN initial semiColon 
final semiColon step RPAREN StatementBlock ;
i want to get the complete text associated with forStatement as we can do
for LPAREN and RPAREN.
Is there any such option in antlr.
Thanks and regards
Nitin Gupta





Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo. 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 

 

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