1) I know that there is a syntax for constructing an imaginary node based on a single real token, but I'm wondering if there is some convenient way for me to initialize my node such that it spans all of the tokens matched...
So, for example in the following: primary_expression_start primary_expression_part* ->^(AST_PRIMARY_EXPRESSION primary_expression_start primary_expression_part*) I'd like my ASTPrimaryExpresion node to correspond to start and stop tokens and text for the whole matched expression. Of course I can implement that with a custom node, or action, but I am wondering if there is some easy way that I'm missing (maybe using parenthesis?) I am also wondering if that wouldn't be a reasonable default behavior for imaginary nodes, to represent the span of tokens that they contain by start and stop token and text value spanning all of them. 2) I am actually using heterogeneous node types and so my rule looks like this: primary_expression_start primary_expression_part* ->^(AST_PRIMARY_EXPRESSION<ASTPrimaryExpression> primary_expression_start primary_expression_part*) I am wondering if in the future we could do away with having to declare a token type for the imaginary node as well as reference the heterogeneous node type... i.e. could we just implicitly create a node type for it... I guess I could just use a single bogus "MYNODE" type or something everywhere, but it just seems wrong. thanks, Pat Niemeyer 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.
