At 01:52 13/12/2008, Sven Van Echelpoel wrote: >Ah, I wondered why there were two forms of the template. Can you
>really pass constructor arguments to nodes created from token >references? Why would you want to use the info of another token >(I can buy the text), as in the following 2 argument call: > >-> $b[ $c, "c" ] I think you've misinterpreted what I was saying. I'm fairly sure that what you've posted there is *not* legal (it doesn't make sense to pass two tokens into one construction expression). As far as I know, the following are the only valid token construction expressions (I could be wrong about some of the specifics, though): -> FOO Copy existing token FOO, or create imaginary token FOO with no context. -> FOO["bar"] Copy existing token FOO but give it "bar" as text, or create imaginary token FOO with "bar" as text and no context. -> FOO[$b] Copy existing token in $b but change the type to FOO. -> FOO[$b, "bar"] Copy existing token in $b but change the type to FOO and the text to "bar". -> $b Copy existing token in $b. -> $b["bar"] Copy existing token in $b, but change the text to "bar". (And unfortunately, the C target can't distinguish between #2 and #3 because the expression can be such that it can't statically tell whether it returns a string or a token.) List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org:8080/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 -~----------~----~----~----~------~----~------~--~---
