Package com.google.minijoe.compiler.ast

Examples of com.google.minijoe.compiler.ast.BinaryOperatorExpression


    // comma expressions are left associative
    while (true) {
      if (nextToken == Token.OPERATOR_COMMA) {
        readToken(Token.OPERATOR_COMMA);
        Expression right = parseAssignmentExpression(inFlag);
        left = new BinaryOperatorExpression(left, right, Token.OPERATOR_COMMA);
      } else {
        return left;
      }
    }
  }
View Full Code Here


    // bitwise or expressions are left associative
    while (true) {
      if (nextToken == Token.OPERATOR_BITWISEOR) {
        readToken(Token.OPERATOR_BITWISEOR);
        right = parseBitwiseXorExpression(inFlag);
        left = new BinaryOperatorExpression(left, right, Token.OPERATOR_BITWISEOR);
      } else {
        return left;
      }
    }
  }
View Full Code Here

    // bitwise xor expressions are left associative
    while (true) {
      if (nextToken == Token.OPERATOR_BITWISEXOR) {
        readToken(Token.OPERATOR_BITWISEXOR);
        right = parseBitwiseAndExpression(inFlag);
        left = new BinaryOperatorExpression(left, right, Token.OPERATOR_BITWISEXOR);
      } else {
        return left;
      }
    }
  }
View Full Code Here

    // bitwise and expressions are left associative
    while (true) {
      if (nextToken == Token.OPERATOR_BITWISEAND) {
        readToken(Token.OPERATOR_BITWISEAND);
        right = parseEqualityExpression(inFlag);
        left = new BinaryOperatorExpression(left, right, Token.OPERATOR_BITWISEAND);
      } else {
        return left;
      }
    }
  }
View Full Code Here

    // equality expressions are left associative
    while (true) {
      if (nextToken == Token.OPERATOR_EQUALEQUAL) {
        readToken(Token.OPERATOR_EQUALEQUAL);
        right = parseRelationalExpression(inFlag);
        left = new BinaryOperatorExpression(left, right, Token.OPERATOR_EQUALEQUAL);
      } else if (nextToken == Token.OPERATOR_NOTEQUAL) {
        readToken(Token.OPERATOR_NOTEQUAL);
        right = parseRelationalExpression(inFlag);
        left = new BinaryOperatorExpression(left, right, Token.OPERATOR_NOTEQUAL);
      } else if (nextToken == Token.OPERATOR_EQUALEQUALEQUAL) {
        readToken(Token.OPERATOR_EQUALEQUALEQUAL);
        right = parseRelationalExpression(inFlag);
        left = new BinaryOperatorExpression(left, right, Token.OPERATOR_EQUALEQUALEQUAL);
      } else if (nextToken == Token.OPERATOR_NOTEQUALEQUAL) {
        readToken(Token.OPERATOR_NOTEQUALEQUAL);
        right = parseRelationalExpression(inFlag);
        left = new BinaryOperatorExpression(left, right, Token.OPERATOR_NOTEQUALEQUAL);
      } else {
        return left;
      }
    }
  }
View Full Code Here

    // relational expressions are left associative
    while (true) {
      if (nextToken == Token.OPERATOR_LESSTHAN) {
        readToken(Token.OPERATOR_LESSTHAN);
        right = parseShiftExpression();
        left = new BinaryOperatorExpression(left, right, Token.OPERATOR_LESSTHAN);
      } else if (nextToken == Token.OPERATOR_GREATERTHAN) {
        readToken(Token.OPERATOR_GREATERTHAN);
        right = parseShiftExpression();
        left = new BinaryOperatorExpression(left, right, Token.OPERATOR_GREATERTHAN);
      } else if (nextToken == Token.OPERATOR_LESSTHANOREQUAL) {
        readToken(Token.OPERATOR_LESSTHANOREQUAL);
        right = parseShiftExpression();
        left = new BinaryOperatorExpression(left, right, Token.OPERATOR_LESSTHANOREQUAL);
      } else if (nextToken == Token.OPERATOR_GREATERTHANOREQUAL) {
        readToken(Token.OPERATOR_GREATERTHANOREQUAL);
        right = parseShiftExpression();
        left = new BinaryOperatorExpression(left, right, Token.OPERATOR_GREATERTHANOREQUAL);
      } else if (nextToken == Token.KEYWORD_INSTANCEOF) {
        readToken(Token.KEYWORD_INSTANCEOF);
        right = parseShiftExpression();
        left = new BinaryOperatorExpression(left, right, Token.KEYWORD_INSTANCEOF);
      } else if (inFlag && nextToken == Token.KEYWORD_IN) {
        readToken(Token.KEYWORD_IN);
        right = parseShiftExpression();
        left = new BinaryOperatorExpression(left, right, Token.KEYWORD_IN);
      } else {
        return left;
      }
    }
  }
View Full Code Here

    // shift expressions are left associative
    while (true) {
      if (nextToken == Token.OPERATOR_SHIFTLEFT) {
        readToken(Token.OPERATOR_SHIFTLEFT);
        right = parseAdditionExpression();
        left = new BinaryOperatorExpression(left, right, Token.OPERATOR_SHIFTLEFT);
      } else if (nextToken == Token.OPERATOR_SHIFTRIGHT) {
        readToken(Token.OPERATOR_SHIFTRIGHT);
        right = parseAdditionExpression();
        left = new BinaryOperatorExpression(left, right, Token.OPERATOR_SHIFTRIGHT);
      } else if (nextToken == Token.OPERATOR_SHIFTRIGHTUNSIGNED) {
        readToken(Token.OPERATOR_SHIFTRIGHTUNSIGNED);
        right = parseAdditionExpression();
        left = new BinaryOperatorExpression(left, right, Token.OPERATOR_SHIFTRIGHTUNSIGNED);
      } else {
        return left;
      }
    }
  }
View Full Code Here

    // addition expressions are left associative
    while (true) {
      if (nextToken == Token.OPERATOR_PLUS) {
        readToken(Token.OPERATOR_PLUS);
        right = parseMultiplyExpression();
        left = new BinaryOperatorExpression(left, right, Token.OPERATOR_PLUS);
      } else if (nextToken == Token.OPERATOR_MINUS) {
        readToken(Token.OPERATOR_MINUS);
        right = parseMultiplyExpression();
        left = new BinaryOperatorExpression(left, right, Token.OPERATOR_MINUS);
      } else {
        return left;
      }
    }
  }
View Full Code Here

    // multiplicative expressions are left associative
    while (true) {
      if (nextToken == Token.OPERATOR_MULTIPLY) {
        readToken(Token.OPERATOR_MULTIPLY);
        right = parseUnaryExpression();
        left = new BinaryOperatorExpression(left, right, Token.OPERATOR_MULTIPLY);
      } else if (nextToken == Token.OPERATOR_DIVIDE) {
        readToken(Token.OPERATOR_DIVIDE);
        right = parseUnaryExpression();
        left = new BinaryOperatorExpression(left, right, Token.OPERATOR_DIVIDE);
      } else if (nextToken == Token.OPERATOR_MODULO) {
        readToken(Token.OPERATOR_MODULO);
        right = parseUnaryExpression();
        left = new BinaryOperatorExpression(left, right, Token.OPERATOR_MODULO);
      } else {
        return left;
      }
    }
  }
View Full Code Here

      if (expression != null) {
        if (result == null) {
          result = expression;
        } else {
          result = new BinaryOperatorExpression(result, expression, Token.OPERATOR_COMMA);
        }
      }
    }

    return result;
View Full Code Here

TOP

Related Classes of com.google.minijoe.compiler.ast.BinaryOperatorExpression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.