What would be the benefit of introducing and then requiring those interfaces? Might make sense when you want to do automatic tree traversal, but maybe not when you want to create any kind of object where you might not even have a (single) parent or a flat list of children. Would it be possible to have both? Tree interfaces for homogeneous, normalized trees that can be processed further using ANTLR and whatever you want to generate if you do not want further ANTLR processing?
- Oliver 2011/9/4 Terence Parr <[email protected]>: > Hi. Currently v3 requires nothing of your tree nodes; all you have to do is > give me an adapter that says how to create them and navigate them and > manipulate them. Users can set up ASTLabelType as an option so that $x in > actions has the user's type instead of plain object. > > Sam Harwell and I were talking today about restructuring all of the tree > interfaces. We're breaking it up into a hierarchy with Tree interface at the > top. Tree just says you can get a payload, some children, and parent. > ParseTree and AST split off as sub interfaces. We were thinking that it's > pretty silly to use simple object when we could require the minimal Tree > interface so at least code could display or navigate them. The reason I went > with plain object originally was so people could use any existing object they > have, even if they only have binary for it. This seems like a fairly extreme > example and, in the worst case, somebody could wrap those objects so they > were suitable for use with ANTLR. More than likely, somebody in that > situation would simply use actions to construct the trees they want. Most > trees not built for antlr expect everything in the constructor, whereas antlr > has to build up the trees piecemeal as it parses. > > So, does anybody object to ANTLR assuming Tree in the parser if you are > building trees and then AST in the tree parsers? > > Ter > > List: http://www.antlr.org/mailman/listinfo/antlr-interest > Unsubscribe: > http://www.antlr.org/mailman/options/antlr-interest/your-email-address > 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 [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.
