I just found out that pANTLR3_BASE_TREE->getChild() returns the same node in memory, but pANTLR3_BASE_TREE->getText() creates an entirely new pANTLR3_STRING even when called from the same node.
Does anyone have any suggestions for making this function return the same string? I thought it would've returned a single string from a lexer structure. On Fri, Jan 23, 2009 at 7:22 PM, Bot Tiger <[email protected]> wrote: > Hello, I am using the C runtime and experiencing heavy memory usage. > > I am interpreting an AST tree recursively. > > In each interpret call, I am checking the token text by using > pANTLR3_BASE_TREE->getText()->chars. > Am I suppose to manually free this when I am done with it? > > Also, I am recursively calling the children nodes with > pANTLR3_BASE_TREE->getChild(). > Am I also supposed to free these as well? I was assuming that they returned > only 1 copy of the node. > > Thank you. > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en -~----------~----~----~----~------~----~------~--~---
List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
