Hi, I'm trying to write a grammar for a scripting language, and to do this I'm building an AST of each expression. I have this working fine, for the most part, but I've run into a problem -- I can't seem to figure out how to put right-to-left associative operators into the tree properly. I had this as a guess, but I'm really not sure: r = value | value >> root_node_d[ch_p('=')] >> r; _____________________________________________________________ <a href="http://www.gamedev.net">GameDev.net Email Service</a> - "Plenty of 1's and 0's" _____________________________________________________________ Select your own custom email address for FREE! Get you@yourchoice.com, No Ads, 6MB, IMAP, POP, SMTP & more! http://www.everyone.net/selectmail?campaign=tag
Dan Nuffer wrote:
Hi, I'm trying to write a grammar for a scripting language, and to do this I'm building an AST of each expression. I have this working fine, for the most part, but I've run into a problem -- I can't seem to figure out how to put right-to-left associative operators into the tree properly. I had this as a guess, but I'm really not sure: r = value | value >> root_node_d[ch_p('=')] >> r;
There were some discussions on this topic on this list a while ago. I'm not sure though, what was the result of this discussion, I think, we wanted to add some new directives for that, but do not remember, if this was done. May be you try to search the archives to find the answer? Meanwhile I'll forward this message to the Spirit mailing list, maybe somebody remebers it. Giovanni? Regards Hartmut
participants (2)
-
Dan Nuffer
-
HartmutKaiser@t-online.de