[antlr-interest] Transforming Comments along with trees
dsfsdf fdsfdsf
eddie_antlr at yahoo.co.uk
Mon Nov 15 02:29:06 PST 2004
hi
no i am not setting my comment to be skipped in my lexer.
After i do my parsing build up my source tree and tree walk,and
i can see the hidden tokens.
When i try and verify the tree and do my passes no hidden tokens present.
Should i be setting my comment to a specific type in my lexer?
thanks
ed
Terence Parr <parrt at cs.usfca.edu> wrote:
On Nov 12, 2004, at 7:41 AM, dsfsdf fdsfdsf wrote:
> Hi
> What do you mean by the tree input output thing?
> I have been transforming my Source Tree and the comments do
> not appear to have been automatically brought acorss.
> My code is something like this.
>
> ASTPass1.setLocalIntelligence(li);
> ASTPass1.setASTNodeClass("antlr.CommonASTWithHiddenTokens");
> ASTPass1.select(sourceASTAnalyzer.getAST());
> t = (CommonASTWithHiddenTokens) ASTPass1.getAST();
> showTree(t,"first pass")
>
> In my ASTPass.g file will i have to handle comments manualy there?
Does your lexer allow comments to return or do you set Token.SKIP?
Mostly likely that is the issue.
Terence
--
CS Professor & Grad Director, University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Cofounder, http://www.jguru.com
Cofounder, http://www.knowspam.net enjoy email again!
Yahoo! Groups Links
---------------------------------
Moving house? Beach bar in Thailand? New Wardrobe? Win £10k with Yahoo! Mail to make your dream a reality.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20041115/a81b2857/attachment.html
More information about the antlr-interest
mailing list