Generate the initial assumption set for a function or method. This is
essentially made up of the precondition(s) for that function or method.

@param declaration
@return
18262
private AssumptionSet generateFunctionOrMethodAssumptionSet(WyilFile.Decl.FunctionOrMethod declaration,
			LocalEnvironment environment) {
		Tuple<WyilFile.Decl.Variable> parameters = declaration.getParameters();
		Expr[] preconditions = new Expr[declaration.getRequires().size()];
		Expr[] arguments = new Expr[parameters.size()];
		// Translate parameters as arguments to invocation
		for (int i = 0; i != arguments.length; ++i) {
			WyilFile.Decl.Variable var = parameters.get(i);
			WyalFile.VariableDeclaration versionedVar = environment.read(var);
			arguments[i] = new Expr.VariableAccess(versionedVar);
		}
		//
		for (int i = 0; i != preconditions.length; ++i) {
			WyalFile.Name name = convert(declaration.getQualifiedName(), "_requires_" + i, declaration.getName());
			preconditions[i] = new Expr.Invoke(null, name, null, arguments);
		}
		// Add all the preconditions as assupmtions
		return AssumptionSet.ROOT.add(preconditions);
	}
707771
private Statement store(final Expression expr, final Optional<Label> firstVarInstruction) {
    expr.checkAssignableTo(resultType());
    return new Statement() {
      @Override
      protected void doGen(CodeBuilder adapter) {
        expr.gen(adapter);
        if (firstVarInstruction.isPresent()) {
          adapter.mark(firstVarInstruction.get());
        }
        adapter.visitVarInsn(resultType().getOpcode(Opcodes.ISTORE), index());
      }
    };
  }
1325049
private void initTypeParameterBindings()
    {
        //
        // Get an iterator to both the declared type arguments and the original type
        // declaration on the associated control interface
        //
        DeclaredType fieldType = (DeclaredType)_fieldDecl.getType();
        Iterator<TypeMirror> paramBoundIter = fieldType.getActualTypeArguments().iterator();

        TypeDeclaration intfDecl = (TypeDeclaration)_controlIntf.getTypeDeclaration();
        Iterator<TypeParameterDeclaration> paramDeclIter = 
                                            intfDecl.getFormalTypeParameters().iterator();

        //
        // Iterate through them in parallel, creating a mapping from the original formal
        // type parameter name to the actual bound type.  In parallel, also build up a
        // representation of the bound type declaration.
        //
        // NOTE: If no type binding is done on the field declaration, then loop below
        // will not execute and no mappings/empty bound decl will be the result.
        //
        StringBuffer sb = new StringBuffer();
        boolean isFirst = true;
        while (paramBoundIter.hasNext())
        {
            TypeMirror paramBound = paramBoundIter.next();
            TypeParameterDeclaration paramDecl = paramDeclIter.next();

            //
            // Save a mapping from the formal type name to the bound mirror type
            //
            _typeBindingMap.put(paramDecl.getSimpleName(), paramBound);

            if (isFirst)
            {
                sb.append("<");
                isFirst = false;
            }
            else
                sb.append(", ");
            sb.append(paramBound);
        }
        if (!isFirst)
            sb.append(">");
        
        _boundParameterDecl = sb.toString();
    }
338440
def pre(cond):
    
    cond_args, cond_varargs, cond_varkw, cond_defaults = inspect.getargspec(cond)
    source = inspect.getsource(cond).strip()

    def inner(f):
        if enabled:
            # deal with the real function, not a wrapper
            f = getattr(f, 'wrapped_fn', f)

            # need to check if 'self' is the first arg,
            # since @pre doesn't want the self param
            member_function = is_member_function(f)

            # need metadata for checking defaults
            method_args, method_defaults = inspect.getargspec(f)[0::3]

            def check_condition(args, kwargs):
                cond_kwargs = {}

                if method_defaults is not None and len(method_defaults) > 0 \
                and len(method_args) - len(method_defaults) <= len(args) < len(method_args):
                    args += method_defaults[len(args) - len(method_args):]

                # collection the args
                for name, value in zip(cond_args, args[member_function:]):
                    cond_kwargs[name] = value

                # collect the remaining kwargs
                for name in cond_args:
                    if name not in cond_kwargs:
                        cond_kwargs[name] = kwargs.get(name)

                # test the precondition
                if not cond(**cond_kwargs):
                    # otherwise raise the exception
                    raise AssertionError('Precondition failure, %s' % source)

            # append to the rest of the preconditions attached to this method
            if not hasattr(f, 'preconditions'):
                f.preconditions = []
            f.preconditions.append(check_condition)

            return check(f)
        else:
            return f

    return inner
432931
private void translateConstantDeclaration(WyilFile.Decl.StaticVariable decl) {
		if (decl.hasInitialiser()) {
			// The environments are needed to prevent clashes between variable
			// versions across verification conditions, and also to type variables
			// used in verification conditions.
			GlobalEnvironment globalEnvironment = new GlobalEnvironment(decl);
			LocalEnvironment localEnvironment = new LocalEnvironment(globalEnvironment);
			List<VerificationCondition> vcs = new ArrayList<>();
			Context context = new Context(wyalFile, AssumptionSet.ROOT, localEnvironment, localEnvironment, null, vcs);
			//
			Pair<Expr, Context> rp = translateExpressionWithChecks(decl.getInitialiser(), null, context);
			generateTypeInvariantCheck(decl.getType(), rp.first(), context);
			// Translate each generated verification condition into an assertion in
			// the underlying WyalFile.
			createAssertions(decl, vcs, globalEnvironment);
		}
	}
1356007
public void setInitialType(Type type) {
        Type initial = getInitialType();
        Type actual = Type.preserveType(initial, type);
        if (actual != null && !actual.equals(initial)) {
            if (initial == null) {
                setType(actual);
            }
            else {
                Iterator<Conversion> it = mConversions.iterator();
                mConversions = new LinkedList<Conversion>();
                // Prefer cast for initial type for correct operation of
                // setInitialType if a conversion needs to be inserted at the
                // beginning.
                mConversions.add(new Conversion(null, actual, true));
                while (it.hasNext()) {
                    Conversion conv = (Conversion)it.next();
                    convertTo(conv.getToType(), conv.isCastPreferred());
                }
            }
        }
    }
265138
function declarationImpliesInitialisation(variable, scope) {
  return variable.name === "arguments" && scope.type === ScopeType.FUNCTION ||
    variable.declarations.some(decl =>
      decl.type === DeclarationType.PARAMETER ||
      decl.type === DeclarationType.FUNCTION_NAME ||
      decl.type === DeclarationType.CATCH
    );
}
392980
protected void generateNonExpressionIfNode(IfNode node) {
    ConditionalBuilder conditional = null;

    for (SoyNode child : node.getChildren()) {
      if (child instanceof IfCondNode) {
        IfCondNode condNode = (IfCondNode) child;

        // Convert predicate.
        Expression predicate = translateExpr(condNode.getExpr());
        // Convert body.
        Statement consequent = visitChildrenReturningCodeChunk(condNode);
        // Add if-block to conditional.
        if (conditional == null) {
          conditional = ifStatement(predicate, consequent);
        } else {
          conditional.addElseIf(predicate, consequent);
        }

      } else if (child instanceof IfElseNode) {
        // Convert body.
        Statement trailingElse = visitChildrenReturningCodeChunk((IfElseNode) child);
        // Add else-block to conditional.
        conditional.setElse(trailingElse);
      } else {
        throw new AssertionError();
      }
    }

    jsCodeBuilder.append(conditional.build());
  }
715085
public StatementBuilder withQualifiers(SnakGroup qualifiers) {
		getQualifierList(qualifiers.getProperty()).addAll(qualifiers);
		return getThis();
	}
1322423
public static void constructTypeQualifierAnnotation(Set<TypeQualifierAnnotation> set, AnnotationValue v) {
        assert set != null;
        TypeQualifierAnnotation tqa = constructTypeQualifierAnnotation(v);
        set.add(tqa);
    }
1143982
function translateDeclarationIntoAssignment(node: Object): Object[] {
  return node.declarations.reduce((acc, declaration) => {
    // Don't translate declaration without initial assignment (e.g. `var a;`)
    if (!declaration.init) {
      return acc;
    }
    acc.push(
      t.expressionStatement(
        t.assignmentExpression("=", declaration.id, declaration.init)
      )
    );
    return acc;
  }, []);
}
1148325
private CodecCipher setInit(Key key, AlgorithmParameters params, AlgorithmParameterSpec spec, Certificate certificate, SecureRandom random)
    {
        this.key         = key;
        this.params      = params;
        this.spec        = spec;
        this.certificate = certificate;
        this.random      = random;

        return this;
    }
867395
@CheckReturnValue
  protected Statement genParamTypeChecks(TemplateNode node, String alias) {
    ImmutableList.Builder<Statement> declarations = ImmutableList.builder();
    for (TemplateParam param : node.getAllParams()) {
      String paramName = param.name();
      SoyType paramType = param.type();
      CodeChunk.Generator generator = templateTranslationContext.codeGenerator();
      Expression paramChunk = genCodeForParamAccess(paramName, param);
      JsType jsType = getJsTypeForParamTypeCheck(paramType);
      // The opt_param.name value that will be type-tested.
      String paramAlias = genParamAlias(paramName);
      Expression coerced = jsType.getValueCoercion(paramChunk, generator);
      if (coerced != null) {
        // since we have coercion logic, dump into a temporary
        paramChunk = generator.declarationBuilder().setRhs(coerced).build().ref();
      }
      if (param.hasDefault()) {
        if (coerced == null) {
          paramChunk = generator.declarationBuilder().setRhs(paramChunk).build().ref();
        }
        declarations.add(
            genParamDefault(param, paramChunk, alias, jsType, /* declareStatic= */ true));
      }
      // The param value to assign
      Expression value;
      Optional<Expression> soyTypeAssertion =
          jsType.getSoyTypeAssertion(paramChunk, paramName, generator);
      // The type-cast expression.
      if (soyTypeAssertion.isPresent()) {
        value = soyTypeAssertion.get();
      } else {
        value = paramChunk;
      }

      VariableDeclaration.Builder declarationBuilder =
          VariableDeclaration.builder(paramAlias)
              .setRhs(value)
              .setGoogRequires(jsType.getGoogRequires());
      declarationBuilder.setJsDoc(
          JsDoc.builder()
              .addParameterizedAnnotation(
                  "type", getJsTypeForParamForDeclaration(paramType).typeExpr())
              .build());
      VariableDeclaration declaration = declarationBuilder.build();
      declarations.add(declaration);

      templateTranslationContext
          .soyToJsVariableMappings()
          // TODO(lukes): this should really be declartion.ref() but we cannot do that until
          // everything is on the code chunk api.
          .put(paramName, id(paramAlias));
    }
    return Statement.of(declarations.build());
  }
798599
def p_class_variable_declaration_initial(p):
    ''''''
    if len(p) == 6:
        p[0] = p[1] + [ast.ClassVariable(p[3], p[5], lineno=p.lineno(2))]
    else:
        p[0] = [ast.ClassVariable(p[1], p[3], lineno=p.lineno(1))]
751190
public XFeatureCall createReferenceToSuper() {
		final XExpression expr = getXExpression();
		XtendTypeDeclaration type = EcoreUtil2.getContainerOfType(expr, XtendTypeDeclaration.class);
		JvmType jvmObject = getAssociatedElement(JvmType.class, type, expr.eResource());
		final XFeatureCall superFeature = XbaseFactory.eINSTANCE.createXFeatureCall();
		JvmIdentifiableElement feature;
		if (jvmObject instanceof JvmDeclaredType) {
			feature = ((JvmDeclaredType) jvmObject).getExtendedClass().getType();
		} else {
			feature = findType(expr, getQualifiedName(type)).getType();
			if (feature instanceof JvmDeclaredType) {
				feature = ((JvmDeclaredType) feature).getExtendedClass().getType();
			} else {
				feature = null;
			}
		}
		if (feature == null) {
			return null;
		}
		superFeature.setFeature(feature);
		return superFeature;

	}
875324
function getInstanceInitExpression(initInstanceVars) {
  let expressions = initInstanceVars.map((mv) => {
    let name = mv.name.literalToken;
    return parseExpression `this.${name} = ${mv.initializer}`;
  });
  return createCommaExpression(expressions);
}
390303
public ConstructorFilterBuilder isDefault() {
        add(new NegationConstructorFilter(new ModifierConstructorFilter(Modifier.PUBLIC & Modifier.PROTECTED & Modifier.PRIVATE)));
        return this;
    }