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

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


       */
      JMethod nullMethod = x.getNullMethod();
      polymorphicNames.put(nullMethod,
          objectScope.declareName(nullMethod.getName()));
      JField nullField = x.getNullField();
      JsName nullFieldName = objectScope.declareName(nullField.getName());
      polymorphicNames.put(nullField, nullFieldName);
      names.put(nullField, nullFieldName);

      /*
       * put nullMethod in the global scope, too; it's the replacer for clinits
View Full Code Here


      // Make a name for my package if it doesn't already exist
      String packageName = getPackageName(x.getName());
      if (packageName != null && packageName.length() > 0) {
        if (packageNames.get(packageName) == null) {
          String ident = "package_" + packageName.replace('.', '_');
          JsName jsName = topScope.declareName(ident);
          packageNames.put(packageName, jsName);
        }
      }

      push(myScope);
View Full Code Here

      // my polymorphic name
      String name = x.getName();
      if (!x.isStatic()) {
        if (getPolyName(x) == null) {
          String mangleName = mangleNameForPoly(x);
          JsName polyName = interfaceScope.declareName(mangleName, name);
          polymorphicNames.put(x, polyName);
        }
      }

      if (x.isAbstract()) {
        // just push a dummy scope that we can pop in endVisit
        push(null);
        return false;
      }

      // my global name
      JsName globalName;
      if (x.getEnclosingType() == null) {
        globalName = topScope.declareName(name);
      } else {
        String mangleName = mangleNameForGlobal(x);
        globalName = topScope.declareName(mangleName, name);
View Full Code Here

      // my polymorphic name
      String name = x.getName();
      if (!x.isStatic()) {
        if (getPolyName(x) == null) {
          String mangleName = mangleNameForPoly(x);
          JsName polyName = interfaceScope.declareName(mangleName, name);
          polymorphicNames.put(x, polyName);
        }
      }

      // set my global name now that we have a name allocator
      String fnName = mangleNameForGlobal(x);
      JsName globalName = topScope.declareName(fnName, name);
      x.getFunc().setName(globalName);
      names.put(x, globalName);

      return false;
    }
View Full Code Here

      // These are left in when cast checking is disabled.
    }

    @Override
    public void endVisit(JClassLiteral x, Context ctx) {
      JsName classLit = names.get(x.getField());
      push(classLit.makeRef(x.getSourceInfo()));
    }
View Full Code Here

        globalStmts.add(vars);
      }

      for (JNode node : x.getArtificialRescues()) {
        if (node instanceof JMethod) {
          JsName jsName = names.get(node);
          if (jsName != null) {
            JsFunction func = (JsFunction) jsName.getStaticRef();
            func.setArtificiallyRescued(true);
          }
        }
      }
     
View Full Code Here

      } else {
        // the variable is setup during clinit, no need to initialize here
        push(null);
      }
      JsExpression rhs = (JsExpression) pop();
      JsName name = names.get(x);

      if (x.isStatic()) {
        // setup a var for the static
        JsVar var = new JsVar(x.getSourceInfo(), name);
        var.setInitExpr(rhs);
        push(var);
      } else {
        // for non-statics, only setup an assignment if needed
        if (rhs != null) {
          JsNameRef fieldRef = name.makeRef(x.getSourceInfo());
          fieldRef.setQualifier(globalTemp.makeRef(x.getSourceInfo()));
          JsExpression asg = createAssignment(fieldRef, rhs);
          push(new JsExprStmt(x.getSourceInfo(), asg));
        } else {
          push(null);
View Full Code Here

    }

    @Override
    public void endVisit(JFieldRef x, Context ctx) {
      JField field = x.getField();
      JsName jsFieldName = names.get(field);
      JsNameRef nameRef = jsFieldName.makeRef(x.getSourceInfo());
      JsExpression curExpr = nameRef;

      /*
       * Note: the comma expressions here would cause an illegal tree state if
       * the result expression ended up on the lhs of an assignment. A hack in
View Full Code Here

        nameString = "N" + nameString.substring(1);
      } else {
        nameString = "P" + nameString;
      }
      nameString += "_longLit";
      JsName longLit = topScope.declareName(nameString);
      longLits.put(x.getValue(), longLit);
      longObjects.put(longLit, longLiteralAllocation);
      push(longLit.makeRef(x.getSourceInfo()));
    }
View Full Code Here

       * the same-named local var twice.
       */
      JsVars vars = new JsVars(x.getSourceInfo());
      Set<String> alreadySeen = new HashSet<String>();
      for (int i = 0; i < locals.size(); ++i) {
        JsName name = names.get(x.getLocals().get(i));
        String ident = name.getIdent();
        if (!alreadySeen.contains(ident)) {
          alreadySeen.add(ident);
          vars.add(new JsVar(x.getSourceInfo(), name));
        }
      }
View Full Code Here

TOP

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

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.