Package com.google.minijoe.compiler.ast

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


      }
    }
  }

  private Expression parseAssignmentExpression(boolean inFlag) throws CompilerException {
    Expression left = parseConditionalExpression(inFlag);

    // assignment expressions are right associative
    if (nextToken == Token.OPERATOR_ASSIGNMENT) {
      readToken();
      return new AssignmentExpression(left, parseAssignmentExpression(inFlag));
View Full Code Here


      return left;
    }
  }

  private Expression parseConditionalExpression(boolean inFlag) throws CompilerException {
    Expression expression = parseLogicalOrExpression(inFlag);

    // conditional expressions are right associative
    if (nextToken == Token.OPERATOR_CONDITIONAL) {
      readToken(Token.OPERATOR_CONDITIONAL);
      Expression trueExpression = parseAssignmentExpression(inFlag);
      readToken(Token.OPERATOR_COLON);
      Expression falseExpression = parseAssignmentExpression(inFlag);
      return new ConditionalExpression(expression, trueExpression, falseExpression);
    } else {
      return expression;
    }
  }
View Full Code Here

      return expression;
    }
  }

  private Expression parseLogicalOrExpression(boolean inFlag) throws CompilerException {
    Expression left = parseLogicalAndExpression(inFlag);
    Expression right;

    // logical or expressions are left associative
    while (true) {
      if (nextToken == Token.OPERATOR_LOGICALOR) {
        readToken(Token.OPERATOR_LOGICALOR);
View Full Code Here

      }
    }
  }

  private Expression parseLogicalAndExpression(boolean inFlag) throws CompilerException {
    Expression left = parseBitwiseOrExpression(inFlag);
    Expression right;

    // logical and expressions are left associative
    while (true) {
      if (nextToken == Token.OPERATOR_LOGICALAND) {
        readToken(Token.OPERATOR_LOGICALAND);
View Full Code Here

      }
    }
  }

  private Expression parseBitwiseOrExpression(boolean inFlag) throws CompilerException {
    Expression left = parseBitwiseXorExpression(inFlag);
    Expression right;

    // bitwise or expressions are left associative
    while (true) {
      if (nextToken == Token.OPERATOR_BITWISEOR) {
        readToken(Token.OPERATOR_BITWISEOR);
View Full Code Here

      }
    }
  }

  private Expression parseBitwiseXorExpression(boolean inFlag) throws CompilerException {
    Expression left = parseBitwiseAndExpression(inFlag);
    Expression right;

    // bitwise xor expressions are left associative
    while (true) {
      if (nextToken == Token.OPERATOR_BITWISEXOR) {
        readToken(Token.OPERATOR_BITWISEXOR);
View Full Code Here

      }
    }
  }

  private Expression parseBitwiseAndExpression(boolean inFlag) throws CompilerException {
    Expression left = parseEqualityExpression(inFlag);
    Expression right;

    // bitwise and expressions are left associative
    while (true) {
      if (nextToken == Token.OPERATOR_BITWISEAND) {
        readToken(Token.OPERATOR_BITWISEAND);
View Full Code Here

      }
    }
  }

  private Expression parseEqualityExpression(boolean inFlag) throws CompilerException {
    Expression left = parseRelationalExpression(inFlag);
    Expression right;

    // equality expressions are left associative
    while (true) {
      if (nextToken == Token.OPERATOR_EQUALEQUAL) {
        readToken(Token.OPERATOR_EQUALEQUAL);
View Full Code Here

      }
    }
  }

  private Expression parseRelationalExpression(boolean inFlag) throws CompilerException {
    Expression left = parseShiftExpression();
    Expression right;

    // relational expressions are left associative
    while (true) {
      if (nextToken == Token.OPERATOR_LESSTHAN) {
        readToken(Token.OPERATOR_LESSTHAN);
View Full Code Here

      }
    }
  }

  private Expression parseShiftExpression() throws CompilerException {
    Expression left = parseAdditionExpression();
    Expression right;

    // shift expressions are left associative
    while (true) {
      if (nextToken == Token.OPERATOR_SHIFTLEFT) {
        readToken(Token.OPERATOR_SHIFTLEFT);
View Full Code Here

TOP

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

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.