[antlr-interest] Regarding the C Target

vincent cheung hellknows2008 at hotmail.com
Fri Mar 6 21:14:05 PST 2009



Hi, I have been using ANTLR v3 to develop a scripting system for a few months. I have the following questions

1) Wildcard doesn't seem to work in tree grammar, it doesn't match subtree when its supposed to. It seems that it only matches a single node at a time. If I replace the the wildcard occurences in the grammar file with the following node then it works:

// any single node or tree
asnot
 : ^((~(UP | DOWN)) asnot*)  // in 3.1.1, ^(. asnot*) will work
 | .
 ;
 
2) The pop of the common tree node stream doesn't seem to work. If I change the implementation to the following then it works:
 
ANTLR3_INT32 retVal;
retVal = ANTLR3_UINT32_CAST(ctns->nodeStack->peek(ctns->nodeStack));
ctns->nodeStack->pop(ctns->nodeStack);
ctns->tnstream->istream->seek(ctns->tnstream->istream, retVal);
return retVal;
 
3) The token text information of imaginary nodes is lost in 3.1.2. Not sure how it works in 3.1.1, but the reason for why it doesn't in 3.1.2 is that the the token's strFactory isn't set up. 
 
4) Attempted to use PUSHSTREAM to implement include file mechanism, but failed. The reason is that the token factory's setInputStream isn't set up properly.
 
 
Thanks

_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090307/d7ae5b91/attachment.html 


More information about the antlr-interest mailing list