Package com.google.gwt.dev.js.ast

Examples of com.google.gwt.dev.js.ast.JsNumberLiteral


      return (op == JsBinaryOperator.SUB || op == JsUnaryOperator.NEG)
          && (op2 == JsUnaryOperator.DEC || op2 == JsUnaryOperator.NEG)
          || (op == JsBinaryOperator.ADD && op2 == JsUnaryOperator.INC);
    }
    if (arg instanceof JsNumberLiteral) {
      JsNumberLiteral literal = (JsNumberLiteral) arg;
      return (op == JsBinaryOperator.SUB || op == JsUnaryOperator.NEG)
          && (literal.getValue() < 0);
    }
    return false;
  }
View Full Code Here


        }
        SourceInfo sourceInfo = x.getSourceInfo().makeChild(
            GenerateJavaScriptVisitor.class, "Type id assignment");
        JsNameRef fieldRef = typeIdName.makeRef(sourceInfo);
        fieldRef.setQualifier(globalTemp.makeRef(sourceInfo));
        JsNumberLiteral typeIdLit = jsProgram.getNumberLiteral(typeId);
        JsExpression asg = createAssignment(fieldRef, typeIdLit);
        JsExprStmt asgStmt = asg.makeStmt();
        globalStmts.add(asgStmt);
        typeForStatMap.put(asgStmt, x);
      }
View Full Code Here

    return literal.isBooleanTrue();
  }

  @Override
  public byte readByte() {   
    JsNumberLiteral literal = (JsNumberLiteral) decoder.getValues().get(--index);
    return (byte) literal.getValue();
  }
View Full Code Here

    return (byte) literal.getValue();
  }
 
  @Override
  public char readChar() {   
    JsNumberLiteral literal = (JsNumberLiteral) decoder.getValues().get(--index);
    return (char) literal.getValue();
  }
View Full Code Here

    return (char) literal.getValue();
  }
 
  @Override
  public double readDouble() {   
    JsNumberLiteral literal = (JsNumberLiteral) decoder.getValues().get(--index);
    return literal.getValue();
  }
View Full Code Here

    return literal.getValue();
  }
 
  @Override
  public float readFloat() {   
    JsNumberLiteral literal = (JsNumberLiteral) decoder.getValues().get(--index);
    return (float) literal.getValue();
  }
View Full Code Here

    return (float) literal.getValue();
  }
 
  @Override
  public int readInt() {   
    JsNumberLiteral literal = (JsNumberLiteral) decoder.getValues().get(--index);
    return (int) literal.getValue();
  }
View Full Code Here

    return LongLib.longFromBase64(((JsStringLiteral)decoder.getValues().get(--index)).getValue());
  }
 
  @Override
  public short readShort() {   
    JsNumberLiteral literal = (JsNumberLiteral) decoder.getValues().get(--index);
    return (short) literal.getValue();
  }
View Full Code Here

    @Override
    public boolean visit(JsNameRef x, JsContext ctx) {
      String ident = x.getIdent();
     
      if (ident.equals(JS_NAN_LITERAL)) {
        values.add(new JsNumberLiteral(SourceOrigin.UNKNOWN, Double.NaN));
      } else if (ident.equals(JS_INFINITY_LITERAL)) {
        double val = negative ? Double.NEGATIVE_INFINITY : Double.POSITIVE_INFINITY;
        negative = false;
        values.add(new JsNumberLiteral(SourceOrigin.UNKNOWN, val));
      } else {
        throw new RuntimeException("Unexpected identifier: " + ident);
      }

      return true;
View Full Code Here

    }

    @Override
    public boolean visit(JsNumberLiteral x, JsContext ctx) {
      if (negative) {
        x = new JsNumberLiteral(x.getSourceInfo(), -x.getValue());
        negative = false;
      }
      values.add(x);
      return true;
    }
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.js.ast.JsNumberLiteral

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.