Examples of NumberLiteral


Examples of com.dragome.compiler.ast.NumberLiteral

    Iterator<NumberLiteral> iter= switchCase.getExpressions().iterator();
    if (iter.hasNext())
    {
      while (iter.hasNext())
      {
        NumberLiteral expression= iter.next();
        indent("case ");
        expression.visit(this);
        println(":");
      }
    }
    else
    {
View Full Code Here

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

      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);
      } else if (op == Token.OPERATOR_MULTIPLY) {
        return new NumberLiteral(left * right);
      } else if (op == Token.OPERATOR_DIVIDE) {
        return new NumberLiteral(left / right);
      } else if (op == Token.OPERATOR_MODULO) {
        return new NumberLiteral(left % right);
      }
    }
    return boe;
  }
View Full Code Here

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

    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);
      }
    }
    return uoe;
  }
View Full Code Here

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

      value = Double.NaN;
    }

    readToken();

    return new NumberLiteral(value);
  }
View Full Code Here

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

        new ExpressionStatement(
            new BinaryOperatorExpression(
                new Identifier("foo"),
                new BinaryOperatorExpression(
                    new Identifier("bar"),
                    new NumberLiteral(1.0),
                    Token.OPERATOR_PLUS
                ),
                Token.OPERATOR_EQUALEQUAL
            )
        ),
View Full Code Here

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

        new ExpressionStatement(
            new BinaryOperatorExpression(
                new Identifier("foo"),
                new BinaryOperatorExpression(
                    new Identifier("bar"),
                    new NumberLiteral(1.0),
                    Token.OPERATOR_PLUS
                ),
                Token.OPERATOR_NOTEQUAL
            )
        ),
View Full Code Here

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

        new ExpressionStatement(
            new BinaryOperatorExpression(
                new Identifier("foo"),
                new BinaryOperatorExpression(
                    new Identifier("bar"),
                    new NumberLiteral(1.0),
                    Token.OPERATOR_PLUS
                ),
                Token.OPERATOR_EQUALEQUALEQUAL
            )
        ),
View Full Code Here

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

        new ExpressionStatement(
            new BinaryOperatorExpression(
                new Identifier("foo"),
                new BinaryOperatorExpression(
                    new Identifier("bar"),
                    new NumberLiteral(1.0),
                    Token.OPERATOR_PLUS
                ),
                Token.OPERATOR_NOTEQUALEQUAL
            )
        ),
View Full Code Here

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

        new ExpressionStatement(
            new BinaryOperatorExpression(
                new Identifier("foo"),
                new BinaryOperatorExpression(
                    new Identifier("bar"),
                    new NumberLiteral(1.0),
                    Token.OPERATOR_PLUS
                ),
                Token.OPERATOR_BITWISEAND
            )
        ),
View Full Code Here

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

        new ExpressionStatement(
            new BinaryOperatorExpression(
                new Identifier("foo"),
                new BinaryOperatorExpression(
                    new Identifier("bar"),
                    new NumberLiteral(1.0),
                    Token.OPERATOR_PLUS
                ),
                Token.OPERATOR_BITWISEOR
            )
        ),
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.