Examples of ReturnStmt


Examples of com.google.caja.parser.js.ReturnStmt

      return newChildren != null
          ? new Block(n.getFilePosition(), newChildren) : n;
    } else if (n instanceof SwitchStmt) {
      return optimizeSwitch((SwitchStmt) n);
    } else if (n instanceof ReturnStmt) {
      ReturnStmt rs = (ReturnStmt) n;
      Expression returnValue = rs.getReturnValue();
      Expression optReturnValue = returnValue != null
          ? (Expression) optimize(returnValue, false)
          : null;
      if (optReturnValue != null && returnValue != null  // 2nd implied by 1st
          && "undefined".equals(returnValue.typeOf())
          && optReturnValue.simplifyForSideEffect() == null) {
        return new ReturnStmt(rs.getFilePosition(), null);
      } else if (optReturnValue != returnValue) {
        return new ReturnStmt(rs.getFilePosition(), optReturnValue);
      }
      return rs;
    } else {
      List<? extends ParseTreeNode> children = n.children();
      int nChildren = children.size();
View Full Code Here

Examples of com.google.caja.parser.js.ReturnStmt

            }
            Statement newChild;
            assert joined != null// because start < end, loop assigns it
            FilePosition exprPos = joined.getFilePosition();
            if (s instanceof ReturnStmt) {
              newChild = new ReturnStmt(exprPos, joined);
            } else if (s instanceof ThrowStmt) {
              newChild = new ThrowStmt(exprPos, joined);
            } else {
              newChild = new ExpressionStmt(exprPos, joined);
            }
View Full Code Here

Examples of com.google.caja.parser.js.ReturnStmt

            new FormalParam(new Identifier(unk, "x")),
            new FormalParam(
                SyntheticNodes.s(new Identifier(unk, "y___")))),
        new Block(
            unk,
            Arrays.<Statement>asList(new ReturnStmt(
                unk,
                Operation.createInfix(
                    Operator.MULTIPLICATION,
                    Operation.createInfix(
                        Operator.ADDITION,
View Full Code Here

Examples of com.google.caja.parser.js.ReturnStmt

      return newChildren != null
          ? new Block(n.getFilePosition(), newChildren) : n;
    } else if (n instanceof SwitchStmt) {
      return optimizeSwitch((SwitchStmt) n);
    } else if (n instanceof ReturnStmt) {
      ReturnStmt rs = (ReturnStmt) n;
      Expression returnValue = rs.getReturnValue();
      Expression optReturnValue = returnValue != null
          ? (Expression) optimize(returnValue, false)
          : null;
      if (optReturnValue != null && returnValue != null  // 2nd implied by 1st
          && "undefined".equals(returnValue.typeOf())
          && optReturnValue.simplifyForSideEffect() == null) {
        return new ReturnStmt(rs.getFilePosition(), null);
      } else if (optReturnValue != returnValue) {
        return new ReturnStmt(rs.getFilePosition(), optReturnValue);
      }
      return rs;
    } else {
      List<? extends ParseTreeNode> children = n.children();
      int nChildren = children.size();
View Full Code Here

Examples of com.google.caja.parser.js.ReturnStmt

            }
            Statement newChild;
            assert joined != null// because start < end, loop assigns it
            FilePosition exprPos = joined.getFilePosition();
            if (s instanceof ReturnStmt) {
              newChild = new ReturnStmt(exprPos, joined);
            } else if (s instanceof ThrowStmt) {
              newChild = new ThrowStmt(exprPos, joined);
            } else {
              newChild = new ExpressionStmt(exprPos, joined);
            }
View Full Code Here

Examples of japa.parser.ast.stmt.ReturnStmt

        return Boolean.TRUE;
    }

    public Boolean visit(ReturnStmt n1, Node arg) {
        ReturnStmt n2 = (ReturnStmt) arg;

        if (!nodeEquals(n1.getExpr(), n2.getExpr())) {
            return Boolean.FALSE;
        }

        return Boolean.TRUE;
    }
View Full Code Here

Examples of japa.parser.ast.stmt.ReturnStmt

                ;
        }
        jj_consume_token(SEMICOLON);
        {
            if (true) {
                return new ReturnStmt(line, column, token.endLine, token.endColumn, expr);
            }
        }
        throw new Error("Missing return statement in function");
    }
View Full Code Here

Examples of japa.parser.ast.stmt.ReturnStmt

  @Override
  public Node visit(ReturnStmt _n, Object _arg) {
    Expression expr = cloneNodes(_n.getExpr(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);

    ReturnStmt r = new ReturnStmt(
        _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
        expr
    );
    r.setComment(comment);
    return r;
  }
View Full Code Here

Examples of japa.parser.ast.stmt.ReturnStmt

    return Boolean.TRUE;
  }

  @Override public Boolean visit(final ReturnStmt n1, final Node arg) {
    final ReturnStmt n2 = (ReturnStmt) arg;

    if (!nodeEquals(n1.getExpr(), n2.getExpr())) {
      return Boolean.FALSE;
    }

    return Boolean.TRUE;
  }
View Full Code Here

Examples of soot.jimple.ReturnStmt

                    continue; // only methods that return XML (FIXME: Will
                              // exclude more specific types like Element)
                Body body = m.retrieveActiveBody();
                for (Unit unit : body.getUnits()) {
                    if (unit instanceof ReturnStmt) {
                        ReturnStmt stmt = (ReturnStmt) unit;
                        hotspots.add(stmt.getOpBox());
                        hotspot2method.put(stmt.getOpBox(), m);
                    }
                }
            }
        }
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.