Package com.google.minijoe.compiler

Examples of com.google.minijoe.compiler.Token


    if (boe.leftExpression instanceof NumberLiteral
        && boe.rightExpression instanceof NumberLiteral) {
      double left = ((NumberLiteral) boe.leftExpression).value;
      double right = ((NumberLiteral) boe.rightExpression).value;

      Token op = boe.operator;

      if (op == Token.OPERATOR_PLUS) {
        return new NumberLiteral(left + right);
      } else if (op == Token.OPERATOR_MINUS) {
        return new NumberLiteral(left - right);
View Full Code Here


    uoe.subExpression = uoe.subExpression.visitExpression(this);

    if (uoe.subExpression instanceof NumberLiteral) {
      double value = ((NumberLiteral) uoe.subExpression).value;
      Token op = uoe.operator;

      if (op == Token.OPERATOR_MINUS) {
        return new NumberLiteral (-value);
      } else if (op == Token.OPERATOR_PLUS) {
        return new NumberLiteral(value);
View Full Code Here

TOP

Related Classes of com.google.minijoe.compiler.Token

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.