ikegami, thank you for your response. I will try to answer your questions.

I am sorry my code did not work for you. I diffed it against the code on my system and it is working for me. I can offer no explanation for this behavior.

I apologize for not being more forthcoming with my requirements. I had hoped that the example I provided would be enough. This is essentially an “order of operations” problem. The three operations I have are And, Or, and Not. And I basically want to build a tree that will let me handle the terms in order based on the precedence provided by parenthesis with the And and Or at the same level and Not being a little higher. (I know Not is not in my original code, but I was starting small) Take the below generic statement.

(term1) and (term2) and ((term3) or (term4)) and not (term5))

I would like to boil this down into an array I can traverse bottom up getting to the innermost terms first.

So first resolve term3 or term 4

Then resolve the results vs. not term5

Then resolve the results vs term 2 and term 1

I figured traversing a tree structure would be the fastest way to do this but I am open to suggestions.


In reply to Re^2: Can I get some rules help with PARSE::RECDESCENT by DevM
in thread Can I get some rules help with PARSE::RECDESCENT by DevM

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.