for (;;)
{
if (p.parseString("=="))
{
processAdditiveExpression();
Node expr = new Node(Node.OPERATOR, "==");
expr.insertChildNode(stack.pop());
expr.insertChildNode(stack.pop());
stack.push(expr);
}
else if (p.parseString("!="))
{
processAdditiveExpression();
Node expr = new Node(Node.OPERATOR, "!=");
expr.insertChildNode(stack.pop());
expr.insertChildNode(stack.pop());
stack.push(expr);
}
else if (p.parseString("="))
{
// Assignment operator is invalid (user probably meant to specify "==")
throw new QueryCompilerSyntaxException("Invalid operator \"=\". Did you mean to use \"==\"?");
}
else if (p.parseString("<="))
{
processAdditiveExpression();
Node expr = new Node(Node.OPERATOR, "<=");
expr.insertChildNode(stack.pop());
expr.insertChildNode(stack.pop());
stack.push(expr);
}
else if (p.parseString(">="))
{
processAdditiveExpression();
Node expr = new Node(Node.OPERATOR, ">=");
expr.insertChildNode(stack.pop());
expr.insertChildNode(stack.pop());
stack.push(expr);
}
else if (p.parseChar('<'))
{
processAdditiveExpression();
Node expr = new Node(Node.OPERATOR, "<");
expr.insertChildNode(stack.pop());
expr.insertChildNode(stack.pop());
stack.push(expr);
}
else if (p.parseChar('>'))
{
processAdditiveExpression();
Node expr = new Node(Node.OPERATOR, ">");
expr.insertChildNode(stack.pop());
expr.insertChildNode(stack.pop());
stack.push(expr);
}
else if (p.parseString("instanceof"))
{
processAdditiveExpression();
Node expr = new Node(Node.OPERATOR, "instanceof");
expr.insertChildNode(stack.pop());
expr.insertChildNode(stack.pop());
stack.push(expr);
}
else
{
break;