SearchOperand ParseAndExpression() { SearchOperand op1 = ParseAndGExpression(); SearchOperand op2; while (pos != searchRequest.Text.Length && searchRequest.Text[pos] == ' ') { pos++; } while (pos != searchRequest.Text.Length && (searchRequest.Text[pos] == '*' || searchRequest.Text[pos] == '^')) { switch (searchRequest.Text[pos]) { case '*': pos++; op2 = ParseAndGExpression(); op1.Add(op2, "*"); break; case '^': pos++; op2 = ParseAndGExpression(); op1.Add(op2, "^"); break; } } return(op1); }
SearchOperand ParseOrExpression() { SearchOperand op1 = ParseAndExpression(); SearchOperand op2; while (pos != searchRequest.Text.Length && searchRequest.Text[pos] == ' ') { pos++; } while (pos != searchRequest.Text.Length && searchRequest.Text[pos] == '+') { pos++; op2 = ParseAndExpression(); op1.Add(op2, "+"); } return(op1); }
SearchOperand ParseAnd_Expression() { SearchOperand op1 = ParseTerm(); SearchOperand op2; while (pos != searchRequest.Text.Length && searchRequest.Text[pos] == ' ') { pos++; } while (pos != searchRequest.Text.Length && searchRequest.Text[pos] == '.') { pos++; if (pos == searchRequest.Text.Length || searchRequest.Text[pos] != ' ') { throw new RequestParsingException(); } op2 = ParseTerm(); op1.Add(op2, ". "); } return(op1); }