Generate AVariableExp with corresponding definition
178155
protected AVariableExp getVarExp(ILexNameToken name, PDefinition vardef)
	{
		AVariableExp var = new AVariableExp();
		var.setName(name.clone());
		var.setOriginal(name.getFullName());
		var.setVardef(vardef.clone());
		return var;
	}
759266
def gen_variable_completions(self, word, env):
        
        # ignore the first character, which is a dollar sign
        var = word[1:]
        for k in env:
            if k.startswith(var):
                yield "$" + k
1322938
private PExp getImpliesExists(AMapCompMapExp exp, ILexNameToken finmap,
			ILexNameToken findex)
	{
		AExistsExp exists = new AExistsExp();
		exists.setBindList(getSetBindList(finmap, findex));
		exists.setPredicate(getExistsPredicate(exp, finmap, findex));
		return exists;
	}
845701
@SuppressWarnings("static-method")
	protected XExpression _generate(XNullLiteral literal, IAppendable it, IExtraLanguageGeneratorContext context) {
		appendReturnIfExpectedReturnedExpression(it, context);
		it.append("None"); //$NON-NLS-1$
		return literal;
	}
1016257
function compile (extension, content, options, fn) {
    // allow optional options argument
    if (_.isFunction(options)) {
      fn = options;
      options = {};
    }

    var config = _.clone(compile.configuration)
      , args = flags.slice(0)
      , buffer = ''
      , errors = ''
      , compressor;

    if (compile.configuration.type) {
      config.type = extension;
    }

    // generate the --key value options, both the key and the value should added
    // seperately to the `args` array or the child_process will chocke.
    Object.keys(config).filter(function filter (option) {
      return config[option];
    }).forEach(function format (option) {
      var bool = _.isBoolean(config[option]);

      if (!bool || config[option]) {
        args.push('--' + option);
        if (!bool) args.push(config[option]);
      }
    });

    // apply the configuration
    _.extend(config, options);

    // spawn the shit and set the correct encoding
    compressor = spawn(type, args);
    compressor.stdout.setEncoding('utf8');
    compressor.stderr.setEncoding('utf8');

    /**
     * Buffer up the results so we can concat them once the compression is
     * finished.
     *
     * @param {Buffer} chunk
     * @api private
     */

    compressor.stdout.on('data', function data (chunk) {
      buffer += chunk;
    });

    compressor.stderr.on('data', function data (err) {
      errors += err;
    });

    /**
     * The compressor has finished can we now process the data and see if it was
     * a success.
     *
     * @param {Number} code
     * @api private
     */

    compressor.on('close', function close (code) {
      // invalid states
      if (errors.length) return fn(new Error(errors));
      if (code !== 0) return fn(new Error('process exited with code ' + code));
      if (!buffer.length) return fn(new Error('no data returned ' + type + args));

      // correctly processed the data
      fn(null, buffer);
    });

    // write out the content that needs to be minified
    compressor.stdin.end(content);
  }
383117
protected XExpression _generate(XIfExpression ifStatement, IAppendable it, IExtraLanguageGeneratorContext context) {
		it.append("if "); //$NON-NLS-1$
		generate(ifStatement.getIf(), it, context);
		it.append(":"); //$NON-NLS-1$
		it.increaseIndentation().newLine();
		if (ifStatement.getThen() != null) {
			generate(ifStatement.getThen(), context.getExpectedExpressionType(), it, context);
		} else if (context.getExpectedExpressionType() == null) {
			it.append("pass"); //$NON-NLS-1$
		} else {
			it.append("return ").append(toDefaultValue(context.getExpectedExpressionType().toJavaCompliantTypeReference())); //$NON-NLS-1$
		}
		it.decreaseIndentation();
		if (ifStatement.getElse() != null) {
			it.newLine().append("else:"); //$NON-NLS-1$
			it.increaseIndentation().newLine();
			generate(ifStatement.getElse(), context.getExpectedExpressionType(), it, context);
			it.decreaseIndentation();
		} else if (context.getExpectedExpressionType() != null) {
			it.newLine().append("else:"); //$NON-NLS-1$
			it.increaseIndentation().newLine();
			it.append("return ").append(toDefaultValue(context.getExpectedExpressionType().toJavaCompliantTypeReference())); //$NON-NLS-1$
			it.decreaseIndentation();
		}
		return ifStatement;
	}
1217684
def EXt(self, xp):
        """"""
        return (1. - self.rho) * self.mu + self.rho * xp
1364767
protected void _generate(SarlClass clazz, IExtraLanguageGeneratorContext context) {
		final JvmDeclaredType jvmType = getJvmModelAssociations().getInferredType(clazz);
		final PyAppendable appendable = createAppendable(jvmType, context);
		if (generateTypeDeclaration(
				this.qualifiedNameProvider.getFullyQualifiedName(clazz).toString(),
				clazz.getName(), clazz.isAbstract(),
				getSuperTypes(clazz.getExtends(), clazz.getImplements()),
				getTypeBuilder().getDocumentation(clazz),
				true,
				clazz.getMembers(), appendable, context, null)) {
			final QualifiedName name = getQualifiedNameProvider().getFullyQualifiedName(clazz);
			writeFile(name, appendable, context);
		}
	}
277531
def generate(self, vars=None, env=None):
        """"""
        def defined(v, default=None):
            _v = default
            if v in vars:
                _v = vars[v]
            elif v in env:
                _v = env[v]
            return _v

        namespace = {
            # __name__ and __loader__ allow the traceback mechanism to find
            # the generated source code.
            "defined": defined,
            #fix RuntimeWarning: Parent module 'a/b/c' not found while handling absolute import warning
            "__name__": self.name.replace('.', '_'),
            # "__name__": self.name,
            "__loader__": ObjectDict(get_source=lambda name: self.code),
        }
        namespace.update(default_namespace)
        namespace.update(env or {})
        namespace.update(self.namespace)
        namespace.update(vars or {})
        namespace['_vars'] = vars
        exec_in(self.compiled, namespace)
        execute = namespace["_tt_execute"]
        # Clear the traceback module's cache of source data now that
        # we've generated a new template (mainly for this module's
        # unittests, where different tests reuse the same name).
        linecache.clearcache()
        return execute()
587609
def generate(env):
    """"""
    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)

    for suffix in ASSuffixes:
        static_obj.add_action(suffix, SCons.Defaults.ASAction)
        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)

    for suffix in ASPPSuffixes:
        static_obj.add_action(suffix, SCons.Defaults.ASPPAction)
        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)

    env['AS']        = 'nasm'
    env['ASFLAGS']   = SCons.Util.CLVar('')
    env['ASPPFLAGS'] = '$ASFLAGS'
    env['ASCOM']     = '$AS $ASFLAGS -o $TARGET $SOURCES'
    env['ASPPCOM']   = '$CC $ASPPFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES'
223856
protected AVariableExp getVarExp(ILexNameToken name, PType type)
	{
		AVariableExp var = getVarExp(name);
		var.setType(type.clone());
		return var;
	}
204419
def visit_ifexp(self, node, parent):
        """"""
        newnode = nodes.IfExp(node.lineno, node.col_offset, parent)
        newnode.postinit(
            self.visit(node.test, newnode),
            self.visit(node.body, newnode),
            self.visit(node.orelse, newnode),
        )
        return newnode
490488
function GENERATE_METHOD(name, spec, parent) {
  name = name.replace(/!+$/, '');
  return GENERATE_DOC(spec.description + '\n'
    + '@method ' + name + '\n'
    + (parent ? ('@for ' + parent + '\n') : '@for common\n')
    + _.reduce(spec.params, function(memo, paramSpec, paramName) {
        return memo + '@param {' + GENERATE_TYPE(paramSpec.type) + '} ' + paramName + ' ' + paramSpec.description + '\n'; 
      }, '')
    + ( !_.isEmpty(spec.return) ? ('@return {' + GENERATE_TYPE(spec.return.type) + '} ' + spec.return.description + '\n') : ''));
}
978595
private WyalFile.VariableDeclaration[] generateQuantifierTypePattern(WyilFile.Expr.Quantifier expr,
			LocalEnvironment environment) {
		//
		Tuple<WyilFile.Decl.Variable> params = expr.getParameters();
		WyalFile.VariableDeclaration[] vardecls = new WyalFile.VariableDeclaration[params.size()];
		for (int i = 0; i != params.size(); ++i) {
			WyilFile.Decl.Variable var = params.get(i);
			vardecls[i] = environment.read(var);
		}
		return vardecls;
	}
986198
protected AVariableExp getVarExp(ILexNameToken name)
	{
		AVariableExp var = new AVariableExp();
		var.setName(name.clone());
		var.setOriginal(name.getFullName());
		return var;
	}
119894
def visit_IfExp(self, node: AST, dfltChaining: bool = True) -> str:
        """"""
        with self.op_man(node):
            src = " if ".join((self.visit(node.body, dfltChaining=False),
                               " else ".join((self.visit(node.test),
                                              self.visit(node.orelse)))))
            return self.wrap_expr(src, dfltChaining)
150709
function transExpr(expContent, toFunc) {
  var ret
  expContent = expContent.trim().replace(/\"/g, '\'')
  if (!textParser.isExpr(expContent)) {
    ret = expContent
  }
  else {
    ret = []
    var tokens = textParser.parseText(expContent)
    var isSingle = tokens.length === 1
    tokens.forEach(function (token) {
      if (token.tag) {
        var res = expParser.parseExpression(token.value)
        if (!isSingle) {
          res = '(' + res + ')'
        }
        ret.push(res)
      }
      else {
        ret.push('\'' + token.value + '\'')
      }
    })
    ret = ret.join(' + ')
    if (toFunc !== false) {
      ret = eval('(function () {return ' + ret + '})')
    }
  }
  return ret
}