當前位置: 首頁>>代碼示例>>Java>>正文


Java Type.noType方法代碼示例

本文整理匯總了Java中com.sun.tools.javac.code.Type.noType方法的典型用法代碼示例。如果您正苦於以下問題:Java Type.noType方法的具體用法?Java Type.noType怎麽用?Java Type.noType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.sun.tools.javac.code.Type的用法示例。


在下文中一共展示了Type.noType方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: speculativeType

import com.sun.tools.javac.code.Type; //導入方法依賴的package包/類
@Override
Type speculativeType(Symbol msym, MethodResolutionPhase phase) {
    if (pertinentToApplicability) {
        for (Map.Entry<ResultInfo, Type> _entry : speculativeTypes.entrySet()) {
            DeferredAttrContext deferredAttrContext = _entry.getKey().checkContext.deferredAttrContext();
            if (deferredAttrContext.phase == phase && deferredAttrContext.msym == msym) {
                return _entry.getValue();
            }
        }
        return Type.noType;
    } else {
        return super.speculativeType(msym, phase);
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:15,代碼來源:ArgumentAttr.java

示例2: Operators

import com.sun.tools.javac.code.Type; //導入方法依賴的package包/類
protected Operators(Context context) {
    context.put(operatorsKey, this);
    syms = Symtab.instance(context);
    names = Names.instance(context);
    log = Log.instance(context);
    types = Types.instance(context);
    noOpSymbol = new OperatorSymbol(names.empty, Type.noType, -1, syms.noSymbol);
    initOperatorNames();
    initUnaryOperators();
    initBinaryOperators();
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:12,代碼來源:Operators.java

示例3: makeTwrBlock

import com.sun.tools.javac.code.Type; //導入方法依賴的package包/類
private JCBlock makeTwrBlock(
		List<JCTree> resources, JCBlock block,
		boolean finallyCanCompleteNormally, int depth) {
	if (resources.isEmpty())
		return block;

	// Add resource declaration or expression to block statements
	ListBuffer<JCStatement> stats    = new ListBuffer<>();
	JCTree                  resource = resources.head;
	JCExpression            expr;
	if (resource instanceof JCVariableDecl) {
		JCVariableDecl var = (JCVariableDecl) resource;
		if (var.sym == null) var.sym = new VarSymbol(0, var.name, var.type == null ? Type.noType : var.type,
																	var.type == null ? symtab.noSymbol : var.type.tsym);
		expr = make.Ident(var.sym);
		expr.setType(resource.type);
		stats.add(var);
	} else {
		Assert.check(resource instanceof JCExpression);
		VarSymbol syntheticTwrVar =
				new VarSymbol(SYNTHETIC | FINAL,
								  makeSyntheticName(names.fromString("twrVar" + depth), twrVars),
								  (resource.type.hasTag(BOT)) ?
								  symtab.autoCloseableType : resource.type,
								  currentMethodSym);
		twrVars.enter(syntheticTwrVar);
		JCVariableDecl syntheticTwrVarDecl =
				make.VarDef(syntheticTwrVar, (JCExpression) resource);
		expr = make.Ident(syntheticTwrVar);
		stats.add(syntheticTwrVarDecl);
	}

	// Add primaryException declaration
	VarSymbol primaryException =
			new VarSymbol(SYNTHETIC,
							  makeSyntheticName(names.fromString("primaryException" +
																					 depth), twrVars),
							  symtab.throwableType,
							  currentMethodSym);
	twrVars.enter(primaryException);
	JCVariableDecl primaryExceptionTreeDecl = make.VarDef(primaryException, makeNull());
	stats.add(primaryExceptionTreeDecl);

	// Create catch clause that saves exception and then rethrows it
	VarSymbol param =
			new VarSymbol(FINAL | SYNTHETIC,
							  names.fromString("t" + target.syntheticNameChar()),
							  symtab.throwableType,
							  currentMethodSym);
	JCVariableDecl paramTree   = make.VarDef(param, null);
	JCStatement    assign      = make.Assignment(primaryException, make.Ident(param));
	JCStatement    rethrowStat = make.Throw(make.Ident(param));
	JCBlock        catchBlock  = make.Block(0L, List.of(assign, rethrowStat));
	JCCatch        catchClause = make.Catch(paramTree, catchBlock);

	int oldPos = make.pos;
	make.at(TreeInfo.endPos(block));
	JCBlock finallyClause = makeFinClause(primaryException, expr);
	make.at(oldPos);
	JCTry outerTry = make.Try(makeTwrBlock(resources.tail, block,
														finallyCanCompleteNormally, depth + 1),
									  List.of(catchClause),
									  finallyClause);
	outerTry.finallyCanCompleteNormally = finallyCanCompleteNormally;
	stats.add(outerTry);
	return make.Block(0L, stats.toList());
}
 
開發者ID:prestongarno,項目名稱:trywithres-compat,代碼行數:68,代碼來源:TryTreeTranslator.java

示例4: getTypeByName

import com.sun.tools.javac.code.Type; //導入方法依賴的package包/類
Type getTypeByName(String typeName, List<Type> tparams) {
    return new Type.ClassType(
               Type.noType,
               tparams,
               new Symbol.ClassSymbol(0, names.fromString(typeName), null));
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:7,代碼來源:PackageGenerator.java

示例5: Class

import com.sun.tools.javac.code.Type; //導入方法依賴的package包/類
public ClassType Class(long flags, Type... typeArgs) {
    ClassSymbol csym = new ClassSymbol(flags, syntheticName(), predef.noSymbol);
    csym.type = new ClassType(Type.noType, List.from(typeArgs), csym);
    ((ClassType)csym.type).supertype_field = predef.objectType;
    return (ClassType)csym.type;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:7,代碼來源:TypeHarness.java


注:本文中的com.sun.tools.javac.code.Type.noType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。