Parse a search condition into an expression tree

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
2
down vote

favorite












I had to implement a parser according to a given grammar as part of a school project. However, only the program execution was graded and I want to know if my code adheres to best practices. I would really appreciate it if you could give me pointers on how to improve my code.



Search conditions are of the form: a + b < 10 OR c = 1. The following code parses the search condition into an expression tree. The input to the function is a vector of the tokens in the search condition.



void recursiveSplit(node *parent, vector<string> const &tokens, string delimiter) 
/* Given a string, parse it into an expression tree with nodes as the
* operators and the children as the operands */
if (tokens.size() == 1)
/* Base case for the recursion, the leaf nodes are either strings or
* integers */
node *mathNode;
mathNode = new node(tokens[0]);
parent->subTree.push_back(mathNode);
return;
else
vector<string>::const_iterator it;
for (it = tokens.begin(); it != tokens.end(); it++)
if (*it == delimiter)
break;


if (it != tokens.end())
/* Case 1 :delimiter was found */
node *delimNode;
delimNode = new node(delimiter);
parent->subTree.push_back(delimNode);
vector<string> leftTokens(tokens.begin(), it), rightTokens(it+1, tokens.end());
string newDelimiter = switchDelimiter(delimiter);
recursiveSplit(delimNode, leftTokens, newDelimiter);
/* In rightTokens, we still need to search for the current
* delimiter since we may have multiple instances of the delimiter
* */
recursiveSplit(delimNode, rightTokens, delimiter);
else
// delimiter is not found
string newDelimiter = switchDelimiter(delimiter);
recursiveSplit(parent, tokens, newDelimiter);




string switchDelimiter(string delimiter)
/* Return the next delimiter based on the priority. The priority of
* operations is : OR, AND, <, >, =, +, -, * */
char delim;
if (delimiter == "OR") ';
else if (delimiter == "AND")
delim = '&';
else
delim = delimiter[0];


switch(delim) ':
return "AND";
case '&':
return "<";
case '<':
return ">";
case '>':
return "=";
case '=':
return "+";
case '+':
return "-";
case '-':
return "*";
case '*':
return " ";



node *createTree(const string& searchStrBuf)
string buf;
stringstream ss(searchStrBuf);
vector<string> tokens;
while(ss >> buf)
if ((buf != ")") && (buf != "("))
tokens.push_back(buf);


node *root = new node("searchTreeRoot");
recursiveSplit(root, tokens, "OR");
return root;


class node
public:
string nodeType;
vector<node *> subTree;

node(string strNodeType)
nodeType = strNodeType;

;






share|improve this question



























    up vote
    2
    down vote

    favorite












    I had to implement a parser according to a given grammar as part of a school project. However, only the program execution was graded and I want to know if my code adheres to best practices. I would really appreciate it if you could give me pointers on how to improve my code.



    Search conditions are of the form: a + b < 10 OR c = 1. The following code parses the search condition into an expression tree. The input to the function is a vector of the tokens in the search condition.



    void recursiveSplit(node *parent, vector<string> const &tokens, string delimiter) 
    /* Given a string, parse it into an expression tree with nodes as the
    * operators and the children as the operands */
    if (tokens.size() == 1)
    /* Base case for the recursion, the leaf nodes are either strings or
    * integers */
    node *mathNode;
    mathNode = new node(tokens[0]);
    parent->subTree.push_back(mathNode);
    return;
    else
    vector<string>::const_iterator it;
    for (it = tokens.begin(); it != tokens.end(); it++)
    if (*it == delimiter)
    break;


    if (it != tokens.end())
    /* Case 1 :delimiter was found */
    node *delimNode;
    delimNode = new node(delimiter);
    parent->subTree.push_back(delimNode);
    vector<string> leftTokens(tokens.begin(), it), rightTokens(it+1, tokens.end());
    string newDelimiter = switchDelimiter(delimiter);
    recursiveSplit(delimNode, leftTokens, newDelimiter);
    /* In rightTokens, we still need to search for the current
    * delimiter since we may have multiple instances of the delimiter
    * */
    recursiveSplit(delimNode, rightTokens, delimiter);
    else
    // delimiter is not found
    string newDelimiter = switchDelimiter(delimiter);
    recursiveSplit(parent, tokens, newDelimiter);




    string switchDelimiter(string delimiter)
    /* Return the next delimiter based on the priority. The priority of
    * operations is : OR, AND, <, >, =, +, -, * */
    char delim;
    if (delimiter == "OR") ';
    else if (delimiter == "AND")
    delim = '&';
    else
    delim = delimiter[0];


    switch(delim) ':
    return "AND";
    case '&':
    return "<";
    case '<':
    return ">";
    case '>':
    return "=";
    case '=':
    return "+";
    case '+':
    return "-";
    case '-':
    return "*";
    case '*':
    return " ";



    node *createTree(const string& searchStrBuf)
    string buf;
    stringstream ss(searchStrBuf);
    vector<string> tokens;
    while(ss >> buf)
    if ((buf != ")") && (buf != "("))
    tokens.push_back(buf);


    node *root = new node("searchTreeRoot");
    recursiveSplit(root, tokens, "OR");
    return root;


    class node
    public:
    string nodeType;
    vector<node *> subTree;

    node(string strNodeType)
    nodeType = strNodeType;

    ;






    share|improve this question























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      I had to implement a parser according to a given grammar as part of a school project. However, only the program execution was graded and I want to know if my code adheres to best practices. I would really appreciate it if you could give me pointers on how to improve my code.



      Search conditions are of the form: a + b < 10 OR c = 1. The following code parses the search condition into an expression tree. The input to the function is a vector of the tokens in the search condition.



      void recursiveSplit(node *parent, vector<string> const &tokens, string delimiter) 
      /* Given a string, parse it into an expression tree with nodes as the
      * operators and the children as the operands */
      if (tokens.size() == 1)
      /* Base case for the recursion, the leaf nodes are either strings or
      * integers */
      node *mathNode;
      mathNode = new node(tokens[0]);
      parent->subTree.push_back(mathNode);
      return;
      else
      vector<string>::const_iterator it;
      for (it = tokens.begin(); it != tokens.end(); it++)
      if (*it == delimiter)
      break;


      if (it != tokens.end())
      /* Case 1 :delimiter was found */
      node *delimNode;
      delimNode = new node(delimiter);
      parent->subTree.push_back(delimNode);
      vector<string> leftTokens(tokens.begin(), it), rightTokens(it+1, tokens.end());
      string newDelimiter = switchDelimiter(delimiter);
      recursiveSplit(delimNode, leftTokens, newDelimiter);
      /* In rightTokens, we still need to search for the current
      * delimiter since we may have multiple instances of the delimiter
      * */
      recursiveSplit(delimNode, rightTokens, delimiter);
      else
      // delimiter is not found
      string newDelimiter = switchDelimiter(delimiter);
      recursiveSplit(parent, tokens, newDelimiter);




      string switchDelimiter(string delimiter)
      /* Return the next delimiter based on the priority. The priority of
      * operations is : OR, AND, <, >, =, +, -, * */
      char delim;
      if (delimiter == "OR") ';
      else if (delimiter == "AND")
      delim = '&';
      else
      delim = delimiter[0];


      switch(delim) ':
      return "AND";
      case '&':
      return "<";
      case '<':
      return ">";
      case '>':
      return "=";
      case '=':
      return "+";
      case '+':
      return "-";
      case '-':
      return "*";
      case '*':
      return " ";



      node *createTree(const string& searchStrBuf)
      string buf;
      stringstream ss(searchStrBuf);
      vector<string> tokens;
      while(ss >> buf)
      if ((buf != ")") && (buf != "("))
      tokens.push_back(buf);


      node *root = new node("searchTreeRoot");
      recursiveSplit(root, tokens, "OR");
      return root;


      class node
      public:
      string nodeType;
      vector<node *> subTree;

      node(string strNodeType)
      nodeType = strNodeType;

      ;






      share|improve this question













      I had to implement a parser according to a given grammar as part of a school project. However, only the program execution was graded and I want to know if my code adheres to best practices. I would really appreciate it if you could give me pointers on how to improve my code.



      Search conditions are of the form: a + b < 10 OR c = 1. The following code parses the search condition into an expression tree. The input to the function is a vector of the tokens in the search condition.



      void recursiveSplit(node *parent, vector<string> const &tokens, string delimiter) 
      /* Given a string, parse it into an expression tree with nodes as the
      * operators and the children as the operands */
      if (tokens.size() == 1)
      /* Base case for the recursion, the leaf nodes are either strings or
      * integers */
      node *mathNode;
      mathNode = new node(tokens[0]);
      parent->subTree.push_back(mathNode);
      return;
      else
      vector<string>::const_iterator it;
      for (it = tokens.begin(); it != tokens.end(); it++)
      if (*it == delimiter)
      break;


      if (it != tokens.end())
      /* Case 1 :delimiter was found */
      node *delimNode;
      delimNode = new node(delimiter);
      parent->subTree.push_back(delimNode);
      vector<string> leftTokens(tokens.begin(), it), rightTokens(it+1, tokens.end());
      string newDelimiter = switchDelimiter(delimiter);
      recursiveSplit(delimNode, leftTokens, newDelimiter);
      /* In rightTokens, we still need to search for the current
      * delimiter since we may have multiple instances of the delimiter
      * */
      recursiveSplit(delimNode, rightTokens, delimiter);
      else
      // delimiter is not found
      string newDelimiter = switchDelimiter(delimiter);
      recursiveSplit(parent, tokens, newDelimiter);




      string switchDelimiter(string delimiter)
      /* Return the next delimiter based on the priority. The priority of
      * operations is : OR, AND, <, >, =, +, -, * */
      char delim;
      if (delimiter == "OR") ';
      else if (delimiter == "AND")
      delim = '&';
      else
      delim = delimiter[0];


      switch(delim) ':
      return "AND";
      case '&':
      return "<";
      case '<':
      return ">";
      case '>':
      return "=";
      case '=':
      return "+";
      case '+':
      return "-";
      case '-':
      return "*";
      case '*':
      return " ";



      node *createTree(const string& searchStrBuf)
      string buf;
      stringstream ss(searchStrBuf);
      vector<string> tokens;
      while(ss >> buf)
      if ((buf != ")") && (buf != "("))
      tokens.push_back(buf);


      node *root = new node("searchTreeRoot");
      recursiveSplit(root, tokens, "OR");
      return root;


      class node
      public:
      string nodeType;
      vector<node *> subTree;

      node(string strNodeType)
      nodeType = strNodeType;

      ;








      share|improve this question












      share|improve this question




      share|improve this question








      edited Jan 8 at 4:01









      Jamal♦

      30.1k11114225




      30.1k11114225









      asked Jan 6 at 4:39









      vorzawk

      135




      135




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote



          accepted










          You don't show how this is being called. So we have to make some assumptions:



          1. I assume that the search conditions have been parsed into tokens as one-token-per-string in the vector? That is, for search conditions like "a + b < 10 OR c = 1" (your example), the tokens vector looks like "a", "+", "b", "<", "10", "OR", "c", "=", "1" .


          2. I assume that the node type contains a vector<node *> called subTree.


          3. You also don't specify if you expect the resulting tree to be a binary tree or not. Your code is written that way, but it doesn't seem to be a requirement. Other than the relational operators, the rest of your operators could easily handle more than two operands: a OR b OR c, 1 + 2 + 3, etc. I assume that the tree must be binary, since you coded it that way.


          With those assumptions, I observe:



          1. You are not handling the case of a zero-length tokens vector. This would be an empty input, or an error of some kind.


          2. You are not handling syntax errors at all, really. What should your code be returning for something like a + * b?


          3. You are using recursion when it is not necessary. Specifically, your switchDelimiter function is really just a way to hide iteration. It would be better, IMO, to write your code to loop over the delimiters instead of calling a function and then recursing with the same tokens and a new delimiter.


          4. You are using recursion when it is not necessary. Specifically, your "right subtree" case recurses with the same delimiter, and it + 1. That's a sign that you can just continue your existing loop, after updating the parent node to a new value. (You will have to move your "new node" code inside the loop, though.)


          5. 3.




          share|improve this answer





















          • I can't seem to figure out how to write my code with iterations. I make a loop over the delimiters and for each delimiter, I add all its occurrences to the tree. But then, I need to connect the next delimiter to its parent node, how do I choose the parent node among the multiple instances found earlier?
            – vorzawk
            Jan 13 at 20:40










          • You don't. When you find a delimiter, you recurse to build a subtree for the left node using a higher-precedence delimiter (you can pass the current delimiter, or just let it run). That recursion should produce your left subtree going from tokens.begin() up to the current it location. When you come back from the recursion, update your parent node to point to the node you just created, and keep looping. Because you update parent, the next delimiter will create a new right subtree.
            – Austin Hastings
            Jan 13 at 21:00











          Your Answer




          StackExchange.ifUsing("editor", function ()
          return StackExchange.using("mathjaxEditing", function ()
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
          );
          );
          , "mathjax-editing");

          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "196"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f184420%2fparse-a-search-condition-into-an-expression-tree%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote



          accepted










          You don't show how this is being called. So we have to make some assumptions:



          1. I assume that the search conditions have been parsed into tokens as one-token-per-string in the vector? That is, for search conditions like "a + b < 10 OR c = 1" (your example), the tokens vector looks like "a", "+", "b", "<", "10", "OR", "c", "=", "1" .


          2. I assume that the node type contains a vector<node *> called subTree.


          3. You also don't specify if you expect the resulting tree to be a binary tree or not. Your code is written that way, but it doesn't seem to be a requirement. Other than the relational operators, the rest of your operators could easily handle more than two operands: a OR b OR c, 1 + 2 + 3, etc. I assume that the tree must be binary, since you coded it that way.


          With those assumptions, I observe:



          1. You are not handling the case of a zero-length tokens vector. This would be an empty input, or an error of some kind.


          2. You are not handling syntax errors at all, really. What should your code be returning for something like a + * b?


          3. You are using recursion when it is not necessary. Specifically, your switchDelimiter function is really just a way to hide iteration. It would be better, IMO, to write your code to loop over the delimiters instead of calling a function and then recursing with the same tokens and a new delimiter.


          4. You are using recursion when it is not necessary. Specifically, your "right subtree" case recurses with the same delimiter, and it + 1. That's a sign that you can just continue your existing loop, after updating the parent node to a new value. (You will have to move your "new node" code inside the loop, though.)


          5. 3.




          share|improve this answer





















          • I can't seem to figure out how to write my code with iterations. I make a loop over the delimiters and for each delimiter, I add all its occurrences to the tree. But then, I need to connect the next delimiter to its parent node, how do I choose the parent node among the multiple instances found earlier?
            – vorzawk
            Jan 13 at 20:40










          • You don't. When you find a delimiter, you recurse to build a subtree for the left node using a higher-precedence delimiter (you can pass the current delimiter, or just let it run). That recursion should produce your left subtree going from tokens.begin() up to the current it location. When you come back from the recursion, update your parent node to point to the node you just created, and keep looping. Because you update parent, the next delimiter will create a new right subtree.
            – Austin Hastings
            Jan 13 at 21:00















          up vote
          0
          down vote



          accepted










          You don't show how this is being called. So we have to make some assumptions:



          1. I assume that the search conditions have been parsed into tokens as one-token-per-string in the vector? That is, for search conditions like "a + b < 10 OR c = 1" (your example), the tokens vector looks like "a", "+", "b", "<", "10", "OR", "c", "=", "1" .


          2. I assume that the node type contains a vector<node *> called subTree.


          3. You also don't specify if you expect the resulting tree to be a binary tree or not. Your code is written that way, but it doesn't seem to be a requirement. Other than the relational operators, the rest of your operators could easily handle more than two operands: a OR b OR c, 1 + 2 + 3, etc. I assume that the tree must be binary, since you coded it that way.


          With those assumptions, I observe:



          1. You are not handling the case of a zero-length tokens vector. This would be an empty input, or an error of some kind.


          2. You are not handling syntax errors at all, really. What should your code be returning for something like a + * b?


          3. You are using recursion when it is not necessary. Specifically, your switchDelimiter function is really just a way to hide iteration. It would be better, IMO, to write your code to loop over the delimiters instead of calling a function and then recursing with the same tokens and a new delimiter.


          4. You are using recursion when it is not necessary. Specifically, your "right subtree" case recurses with the same delimiter, and it + 1. That's a sign that you can just continue your existing loop, after updating the parent node to a new value. (You will have to move your "new node" code inside the loop, though.)


          5. 3.




          share|improve this answer





















          • I can't seem to figure out how to write my code with iterations. I make a loop over the delimiters and for each delimiter, I add all its occurrences to the tree. But then, I need to connect the next delimiter to its parent node, how do I choose the parent node among the multiple instances found earlier?
            – vorzawk
            Jan 13 at 20:40










          • You don't. When you find a delimiter, you recurse to build a subtree for the left node using a higher-precedence delimiter (you can pass the current delimiter, or just let it run). That recursion should produce your left subtree going from tokens.begin() up to the current it location. When you come back from the recursion, update your parent node to point to the node you just created, and keep looping. Because you update parent, the next delimiter will create a new right subtree.
            – Austin Hastings
            Jan 13 at 21:00













          up vote
          0
          down vote



          accepted







          up vote
          0
          down vote



          accepted






          You don't show how this is being called. So we have to make some assumptions:



          1. I assume that the search conditions have been parsed into tokens as one-token-per-string in the vector? That is, for search conditions like "a + b < 10 OR c = 1" (your example), the tokens vector looks like "a", "+", "b", "<", "10", "OR", "c", "=", "1" .


          2. I assume that the node type contains a vector<node *> called subTree.


          3. You also don't specify if you expect the resulting tree to be a binary tree or not. Your code is written that way, but it doesn't seem to be a requirement. Other than the relational operators, the rest of your operators could easily handle more than two operands: a OR b OR c, 1 + 2 + 3, etc. I assume that the tree must be binary, since you coded it that way.


          With those assumptions, I observe:



          1. You are not handling the case of a zero-length tokens vector. This would be an empty input, or an error of some kind.


          2. You are not handling syntax errors at all, really. What should your code be returning for something like a + * b?


          3. You are using recursion when it is not necessary. Specifically, your switchDelimiter function is really just a way to hide iteration. It would be better, IMO, to write your code to loop over the delimiters instead of calling a function and then recursing with the same tokens and a new delimiter.


          4. You are using recursion when it is not necessary. Specifically, your "right subtree" case recurses with the same delimiter, and it + 1. That's a sign that you can just continue your existing loop, after updating the parent node to a new value. (You will have to move your "new node" code inside the loop, though.)


          5. 3.




          share|improve this answer













          You don't show how this is being called. So we have to make some assumptions:



          1. I assume that the search conditions have been parsed into tokens as one-token-per-string in the vector? That is, for search conditions like "a + b < 10 OR c = 1" (your example), the tokens vector looks like "a", "+", "b", "<", "10", "OR", "c", "=", "1" .


          2. I assume that the node type contains a vector<node *> called subTree.


          3. You also don't specify if you expect the resulting tree to be a binary tree or not. Your code is written that way, but it doesn't seem to be a requirement. Other than the relational operators, the rest of your operators could easily handle more than two operands: a OR b OR c, 1 + 2 + 3, etc. I assume that the tree must be binary, since you coded it that way.


          With those assumptions, I observe:



          1. You are not handling the case of a zero-length tokens vector. This would be an empty input, or an error of some kind.


          2. You are not handling syntax errors at all, really. What should your code be returning for something like a + * b?


          3. You are using recursion when it is not necessary. Specifically, your switchDelimiter function is really just a way to hide iteration. It would be better, IMO, to write your code to loop over the delimiters instead of calling a function and then recursing with the same tokens and a new delimiter.


          4. You are using recursion when it is not necessary. Specifically, your "right subtree" case recurses with the same delimiter, and it + 1. That's a sign that you can just continue your existing loop, after updating the parent node to a new value. (You will have to move your "new node" code inside the loop, though.)


          5. 3.





          share|improve this answer













          share|improve this answer



          share|improve this answer











          answered Jan 8 at 3:38









          Austin Hastings

          6,1591130




          6,1591130











          • I can't seem to figure out how to write my code with iterations. I make a loop over the delimiters and for each delimiter, I add all its occurrences to the tree. But then, I need to connect the next delimiter to its parent node, how do I choose the parent node among the multiple instances found earlier?
            – vorzawk
            Jan 13 at 20:40










          • You don't. When you find a delimiter, you recurse to build a subtree for the left node using a higher-precedence delimiter (you can pass the current delimiter, or just let it run). That recursion should produce your left subtree going from tokens.begin() up to the current it location. When you come back from the recursion, update your parent node to point to the node you just created, and keep looping. Because you update parent, the next delimiter will create a new right subtree.
            – Austin Hastings
            Jan 13 at 21:00

















          • I can't seem to figure out how to write my code with iterations. I make a loop over the delimiters and for each delimiter, I add all its occurrences to the tree. But then, I need to connect the next delimiter to its parent node, how do I choose the parent node among the multiple instances found earlier?
            – vorzawk
            Jan 13 at 20:40










          • You don't. When you find a delimiter, you recurse to build a subtree for the left node using a higher-precedence delimiter (you can pass the current delimiter, or just let it run). That recursion should produce your left subtree going from tokens.begin() up to the current it location. When you come back from the recursion, update your parent node to point to the node you just created, and keep looping. Because you update parent, the next delimiter will create a new right subtree.
            – Austin Hastings
            Jan 13 at 21:00
















          I can't seem to figure out how to write my code with iterations. I make a loop over the delimiters and for each delimiter, I add all its occurrences to the tree. But then, I need to connect the next delimiter to its parent node, how do I choose the parent node among the multiple instances found earlier?
          – vorzawk
          Jan 13 at 20:40




          I can't seem to figure out how to write my code with iterations. I make a loop over the delimiters and for each delimiter, I add all its occurrences to the tree. But then, I need to connect the next delimiter to its parent node, how do I choose the parent node among the multiple instances found earlier?
          – vorzawk
          Jan 13 at 20:40












          You don't. When you find a delimiter, you recurse to build a subtree for the left node using a higher-precedence delimiter (you can pass the current delimiter, or just let it run). That recursion should produce your left subtree going from tokens.begin() up to the current it location. When you come back from the recursion, update your parent node to point to the node you just created, and keep looping. Because you update parent, the next delimiter will create a new right subtree.
          – Austin Hastings
          Jan 13 at 21:00





          You don't. When you find a delimiter, you recurse to build a subtree for the left node using a higher-precedence delimiter (you can pass the current delimiter, or just let it run). That recursion should produce your left subtree going from tokens.begin() up to the current it location. When you come back from the recursion, update your parent node to point to the node you just created, and keep looping. Because you update parent, the next delimiter will create a new right subtree.
          – Austin Hastings
          Jan 13 at 21:00













           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f184420%2fparse-a-search-condition-into-an-expression-tree%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          Greedy Best First Search implementation in Rust

          Function to Return a JSON Like Objects Using VBA Collections and Arrays

          C++11 CLH Lock Implementation