[antlr-interest] Multiple pass tree walking Q
Hill, Robert
rhill03 at eds.com
Tue Oct 3 23:23:40 PDT 2006
I've pretty much gone down the multiple tree parser routes, its a real
pain in the ass though, as if you modify your parser, you then have to
modify all the tree parser grammars too. I must be missing something
here. :(
there must be a rule that ignores a whole branch, but i've tried all
sorts and haven't succeeded ,
ignoreme : ^(.*) ... if only :)
which is why i ended up with 3 tree parse phases. I just get this
nagging feeling im missing the point.
i think everyone's gone on holiday, the list is usually way busier than
this.
cheers,
Rob
--
Rob Hill
EDS - Hallamshire Business Park
F1E/045
Sheffield
T: +44 (0) 114 291 1928
M: +44 (0) 791 732 1227
E: rhill03 at eds.com <mailto:rhill03 at eds.com>
________________________________
From: Henry Butowsky [mailto:henryb at ntlworld.com]
Sent: 03 October 2006 15:46
To: Hill, Robert
Subject: Re: [antlr-interest] Multiple pass tree walking Q
Hi Rob ---
I have a similar problem -- I Have to parse the tree twice
--- And Im not sure to use a single multipurpose tree walker or
use 2 tree parsers --- I will be watching the responses
from the newsgroup !
Regards Henry
Hill, Robert wrote:
I want to make multiple passes over a tree but only
utilise parts of the tree for each pass so I've duplicated the tree
grammar 3 times , adding actions only for the parts that matter at each
pass.
So the question is , how do you ignore (remove) whole
branches of a tree? At the moment if I add a node into the parser output
I have to change all 3 tree walkers in response. If I know that the
tokens that pass 1 will no longer be affected, how can I remove all the
unwanted rules from that grammar so It only looks at the tokens it
needs?
Am I approaching this in the correct manner?
Cheers!
Rob
--
ROB HILL
DWP ACW
EDS Hallamshire Business Park
F1E/045
Sheffield
T: +44 (0) 114 291 1928
M: +44 (0) 790 318 5516
E: rhill03 at eds.com <mailto:rhill03 at eds.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20061004/329f3465/attachment.html
More information about the antlr-interest
mailing list