Gary R. Van Sickle wrote:
No, it doesn't, it returns a struct, declared in the rule that is called.From: Richard Thrippleton When I have a rule of the form
It would not work, these things are not allocated and you don;t want
them to be either.ANTLR has always initialized things and it does so via a table. I don't have control at the finer level, but anyway, the thing is that you need to use pointers anyway and so initializing to NULL is not an issue. I need to get this into the docs I guess. There isn't anything that you can legitimately put in to the return that cannot be initialized to NULL basically, so if you get this error, it means you need to look at what you are putting into the return/scope/whatever structure and change it to something that can be initialized to NULL. The semantics will be trivially different for your code, but will follow the gestalt of ANTLR and the way the C runtime rules are implemented. There is always a tradeoff between performance (which is what we want) and flexibility to use any kind of structure/declaration in the target language, but here we are programming a grammar, not a standalone C or C++ program and so there are rules to follow that are more restrictive than a freeform C/C++ program. Jim Jim --~--~---------~--~----~------------~-------~--~----~ 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
