I know, you don't like be already)) Excuse me for my annoyance, but currently it's very important for me to understand some antlr features.
I have my own AST (on C++)... I use C target, because there are no another ways. At first I didn't use AST building... but it was difficult to support different problems... Currently I think to do the following: create AST and convert this AST to my own... But I have a problem with TREE PARSER GRAMMAR. !!!FIRST SITUATION!!! rule [returns MySuperNode res] : ^ a=ruleA, b=ruleB, c=ruleC,... z=ruleZ TOKEN1 { res = f(a.res, b.res, c.res, ..., z.res); }; a, b, c, ..., z - subtries OF MY TREE, pointers. If at the end of rule the exaption is occured (at the matching of the token), rule will report an error and return. AND ALL POINTERS WILL BE FORGOTTEN. Is there standard method for C target, to survive from memory leaks?? Use auto_ptr's? !!!SECOND SITUATION!!! rule [returns MySuperNode res] : ^ a=ruleA, b=ruleB, c=ruleC,... z=ruleZ // without TOKEN1 { res = f(a.res, b.res, c.res, ..., z.res); }; If at the end of rule the exaption is occured (at the matching of the ruleC), BUT HASEXCEPTION() will be equal FALSE!!! because error was processed in rileZ... And "{ res = f(a.res, b.res, c.res, ..., z.res); };" will be processed with z.res=GARBAGE. SOO... HOW CAN I DISCARD ACTION PROCESSING IF ERROR WAS FIRED IN CHILD SUBTREE?? thank u =) -- Best regards, Michael List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to il-antlr-interest@googlegroups.com To unsubscribe from this group, send email to il-antlr-interest+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en -~----------~----~----~----~------~----~------~--~---