Menu

Take boolean expression.

Help
2014-09-19
2014-09-22
  • Alexandre Locci Martins

    Hello

    I wold like to know if is possible take the boolean expression from
    BranchStatement or LoopStatement. For example:

    if (A || B)

    The return is {A,B}.
    Thank you.

    --
    Alexandre

     
  • Tobias Gutzmann

    Tobias Gutzmann - 2014-09-19

    Hi,

    That's of course possible, you can traverse the entire AST, but...

    It's getting to a point where it's more important to ask you "what do you want to accomplish" instead of helping you step-by-step.
    So, what's the final goal you want to accomplish?

    To answer you initial question: A || B is represented in Recoder as an instance of BinaryOr, and that you can just query for its AST children.

    Regards,
    Tobias

     
    • Alexandre Locci Martins

      Hello Tobias

      Thank you for your help.
      My goal is take a branch as if (A || B && C || (X > 10) ==true) and split
      the boolean expression in basic conditions. For the above expression there
      are 4 conditions A, B, C and (X>10)==true. I need a list with those
      conditions.
      I am writing a paper and I need this information about great systems like
      apache, for example.
      I believe recoder is the best tool to do it.
      Regards,

      Alexandre

      2014-09-19 20:26 GMT-03:00 Tobias Gutzmann tgutzmann@users.sf.net:

      Hi,

      That's of course possible, you can traverse the entire AST, but...

      It's getting to a point where it's more important to ask you "what do you
      want to accomplish" instead of helping you step-by-step.
      So, what's the final goal you want to accomplish?

      To answer you initial question: A || B is represented in Recoder as an
      instance of BinaryOr, and that you can just query for its AST children.

      Regards,
      Tobias


      Take boolean expression.
      https://sourceforge.net/p/recoder/discussion/88904/thread/c2db1069/?limit=25#d29f


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/recoder/discussion/88904/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

      --
      Alexandre

       

Log in to post a comment.