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?


In reply to Re: XML::Twig recursive constructor calls and local() by mirod
in thread XML::Twig recursive constructor calls and local() by princepawn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.