in reply to XML::Twig recursive constructor calls and local()

princepawn, I never thought I would say this but it looks to me like you are not radical enough!

Your language is not properly designed, $z=$x+$y should translate into

<set> <var>z</var> <val> <add> <op1><var>x</var></op1> <op2><var>x</var></op2> </add> </val> </set>

Then parsing becomes trivial.

Anything less detailed does not make much sense, as it is still too close to Perl to be completely language independent (what's with the $x? Not to mention that <my>$x $y $z</my> for example does not properly tag each token leading to the repeated use of split in your handlers)

Incidently it looks very much like what you are trying to define would be an XML version of the Perl internal op-tree. Maybe you should try to create an XML version of Perl 6 bytecode. That would probably make more sense than trying to create an ultra-verbose language that might not even map properly into Perl (how do you encode regexps, especially regexps including eval-el code?

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.