[antlr-interest] [C Target] How to skip a whole sub-tree (not just a token)

Mohamed Yousef harrrrpo at gmail.com
Fri Nov 13 04:10:06 PST 2009


Hello all,
i sent before regarding a bug in Control flow  in which a e=. won't define e
, i was suggested by jim to walk tree my self using LT

now i have a problem , consider following

if_expr
    :
      ^(EIF ^(EIF_COND c =expr_g) ^(EIF_THEN e=expr_g)  ) { // examine c and
selectively jump to e }

must be changed to something like

if_expr
    :
      ^(EIF ^(EIF_COND c =expr_g)  { // examine c and selectively jump to e
}  )

and we have a problem
how can we skip the whole EIF_THEN tree (when c is false ) ? , if we try to
use the stopIndex of EIF to jump to it's end
we have the problem that all returned indices ,by all means , don't take UP
& DOWN nodes into accout , where the SEEK macro
takes them into accout
any ideas ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20091113/481d4f1d/attachment.html 


More information about the antlr-interest mailing list