本文整理汇总了Java中com.sun.tools.javac.comp.Enter.instance方法的典型用法代码示例。如果您正苦于以下问题:Java Enter.instance方法的具体用法?Java Enter.instance怎么用?Java Enter.instance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.tools.javac.comp.Enter
的用法示例。
在下文中一共展示了Enter.instance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Types
import com.sun.tools.javac.comp.Enter; //导入方法依赖的package包/类
protected Types(Context context) {
context.put(typesKey, this);
syms = Symtab.instance(context);
names = Names.instance(context);
Source source = Source.instance(context);
allowBoxing = source.allowBoxing();
allowCovariantReturns = source.allowCovariantReturns();
allowObjectToPrimitiveCast = source.allowObjectToPrimitiveCast();
reader = ClassReader.instance(context);
chk = Check.instance(context);
enter = Enter.instance(context);
capturedName = names.fromString("<captured wildcard>");
messages = JavacMessages.instance(context);
diags = JCDiagnostic.Factory.instance(context);
functionDescriptorLookupError = new FunctionDescriptorLookupError();
noWarnings = new Warner(null);
}
示例2: init
import com.sun.tools.javac.comp.Enter; //导入方法依赖的package包/类
private void init(Context context) {
modules = Modules.instance(context);
attr = Attr.instance(context);
enter = Enter.instance(context);
elements = JavacElements.instance(context);
log = Log.instance(context);
resolve = Resolve.instance(context);
treeMaker = TreeMaker.instance(context);
memberEnter = MemberEnter.instance(context);
names = Names.instance(context);
types = Types.instance(context);
docTreeMaker = DocTreeMaker.instance(context);
parser = ParserFactory.instance(context);
syms = Symtab.instance(context);
fileManager = context.get(JavaFileManager.class);
JavacTask t = context.get(JavacTask.class);
if (t instanceof JavacTaskImpl)
javacTaskImpl = (JavacTaskImpl) t;
}
示例3: Types
import com.sun.tools.javac.comp.Enter; //导入方法依赖的package包/类
protected Types(Context context) {
context.put(typesKey, this);
syms = Symtab.instance(context);
names = Names.instance(context);
Source source = Source.instance(context);
allowObjectToPrimitiveCast = source.allowObjectToPrimitiveCast();
allowDefaultMethods = source.allowDefaultMethods();
mapCapturesToBounds = source.mapCapturesToBounds();
chk = Check.instance(context);
enter = Enter.instance(context);
capturedName = names.fromString("<captured wildcard>");
messages = JavacMessages.instance(context);
diags = JCDiagnostic.Factory.instance(context);
functionDescriptorLookupError = new FunctionDescriptorLookupError();
noWarnings = new Warner(null);
}
示例4: Types
import com.sun.tools.javac.comp.Enter; //导入方法依赖的package包/类
protected Types(Context context) {
context.put(typesKey, this);
syms = Symtab.instance(context);
names = Names.instance(context);
Source source = Source.instance(context);
allowBoxing = source.allowBoxing();
allowCovariantReturns = source.allowCovariantReturns();
allowObjectToPrimitiveCast = source.allowObjectToPrimitiveCast();
allowDefaultMethods = source.allowDefaultMethods();
reader = ClassReader.instance(context);
chk = Check.instance(context);
enter = Enter.instance(context);
capturedName = names.fromString("<captured wildcard>");
messages = JavacMessages.instance(context);
diags = JCDiagnostic.Factory.instance(context);
functionDescriptorLookupError = new FunctionDescriptorLookupError();
noWarnings = new Warner(null);
}
示例5: TreeScannerStateful
import com.sun.tools.javac.comp.Enter; //导入方法依赖的package包/类
public TreeScannerStateful(CompilationTask task, JCCompilationUnit jcc) {
this.jcc = jcc ;
trees = Trees.instance(task);
treesC = (JavacTrees)trees;
//Rabbit hole to Wonderland
context = ((BasicJavacTask)task).getContext() ;
this.task = ((BasicJavacTask)task) ;
//Initialize magical classes !
make = TreeMaker.instance(context) ;
names = Names.instance(context) ;
syms = Symtab.instance(context);
types = Types.instance(context) ;
typesC = JavacTypes.instance(context) ;
attr = Attr.instance(context) ;
enter = Enter.instance(context) ;
resolve = Resolve.instance(context) ;
memberEnter = MemberEnter.instance(context) ;
javacElements = JavacElements.instance(context) ;
info = TreeInfo.instance(context) ;
sourcePositions = trees.getSourcePositions();
elements = ((JavacTask)task).getElements();
elementsC = (JavacElements)elements;
}
示例6: PostFlowAnalysis
import com.sun.tools.javac.comp.Enter; //导入方法依赖的package包/类
private PostFlowAnalysis(Context ctx) {
log = Log.instance(ctx);
types = Types.instance(ctx);
enter = Enter.instance(ctx);
names = Names.instance(ctx);
syms = Symtab.instance(ctx);
outerThisStack = List.nil();
}
示例7: parseType
import com.sun.tools.javac.comp.Enter; //导入方法依赖的package包/类
/**Parses given type in given context.
*
* @param expr type specification
* @param scope in which simple names should be resolved
* @return parsed {@link TypeMirror} or null if the given specification cannot be parsed
*/
public TypeMirror parseType(String expr, TypeElement scope) {
Enter enter = Enter.instance(info.impl.getJavacTask().getContext());
com.sun.tools.javac.tree.TreeMaker jcMaker = com.sun.tools.javac.tree.TreeMaker.instance(info.impl.getJavacTask().getContext());
int oldPos = jcMaker.pos;
try {
if (enter.getClassEnv((Symbol.TypeSymbol)scope) == null) {
if (info.getTrees().getTree(scope) == null)
return null;
}
return info.impl.getJavacTask().parseType(expr, scope);
} finally {
jcMaker.pos = oldPos;
}
}
示例8: attributeThis
import com.sun.tools.javac.comp.Enter; //导入方法依赖的package包/类
public static VariableElement attributeThis(CompilationInfo info, TreePath tp) {
//XXX:
while (tp != null) {
if (TreeUtilities.CLASS_TREE_KINDS.contains(tp.getLeaf().getKind())) {
Element currentElement = info.getTrees().getElement(tp);
if (currentElement == null || !(currentElement instanceof ClassSymbol)) return null;
Enter enter = Enter.instance(JavaSourceAccessor.getINSTANCE().getJavacTask(info).getContext());
Env<AttrContext> env = enter.getEnv((ClassSymbol) currentElement);
if (env == null) return null;
for (Element el : env.info.getLocalElements()) {
if (el.getSimpleName().contentEquals("this")) {
return (VariableElement) el;
}
}
return null;
}
tp = tp.getParentPath();
}
return null;
}
示例9: attributeTree
import com.sun.tools.javac.comp.Enter; //导入方法依赖的package包/类
private static TypeMirror attributeTree(JavacTaskImpl jti, Tree tree, Scope scope,
final List<Diagnostic<? extends JavaFileObject>> errors, @NullAllowed final Diagnostic.Kind filter) {
Log log = Log.instance(jti.getContext());
JavaFileObject prev = log.useSource(new DummyJFO());
Enter enter = Enter.instance(jti.getContext());
Log.DiagnosticHandler discardHandler = new Log.DiscardDiagnosticHandler(log) {
private Diagnostic.Kind f = filter == null ? Diagnostic.Kind.ERROR : filter;
@Override
public void report(JCDiagnostic diag) {
if (diag.getKind().compareTo(f) >= 0) {
errors.add(diag);
}
}
};
// ArgumentAttr argumentAttr = ArgumentAttr.instance(jti.getContext());
// ArgumentAttr.LocalCacheContext cacheContext = argumentAttr.withLocalCacheContext();
try {
// enter.shadowTypeEnvs(true);
Attr attr = Attr.instance(jti.getContext());
Env<AttrContext> env = ((JavacScope) scope).getEnv();
if (tree instanceof JCTree.JCExpression) {
return attr.attribExpr((JCTree) tree,env, Type.noType);
}
return attr.attribStat((JCTree) tree,env);
} finally {
// cacheContext.leave();
log.useSource(prev);
log.popDiagnosticHandler(discardHandler);
// enter.shadowTypeEnvs(false);
}
}
示例10: init
import com.sun.tools.javac.comp.Enter; //导入方法依赖的package包/类
private void init(Context context) {
attr = Attr.instance(context);
enter = Enter.instance(context);
elements = JavacElements.instance(context);
log = Log.instance(context);
resolve = Resolve.instance(context);
treeMaker = TreeMaker.instance(context);
memberEnter = MemberEnter.instance(context);
javacTaskImpl = context.get(JavacTaskImpl.class);
}
示例11: setContext
import com.sun.tools.javac.comp.Enter; //导入方法依赖的package包/类
/**
* Use a new context. May be called from outside to update
* internal state for a new annotation-processing round.
*/
public void setContext(Context context) {
context.put(JavacElements.class, this);
javaCompiler = JavaCompiler.instance(context);
syms = Symtab.instance(context);
names = Names.instance(context);
types = Types.instance(context);
enter = Enter.instance(context);
}
示例12: init
import com.sun.tools.javac.comp.Enter; //导入方法依赖的package包/类
private void init(Context context) {
attr = Attr.instance(context);
enter = Enter.instance(context);
elements = JavacElements.instance(context);
log = Log.instance(context);
resolve = Resolve.instance(context);
treeMaker = TreeMaker.instance(context);
memberEnter = MemberEnter.instance(context);
names = Names.instance(context);
types = Types.instance(context);
JavacTask t = context.get(JavacTask.class);
if (t instanceof JavacTaskImpl)
javacTaskImpl = (JavacTaskImpl) t;
}
示例13: JavacElements
import com.sun.tools.javac.comp.Enter; //导入方法依赖的package包/类
protected JavacElements(Context context) {
context.put(JavacElements.class, this);
javaCompiler = JavaCompiler.instance(context);
syms = Symtab.instance(context);
modules = Modules.instance(context);
names = Names.instance(context);
types = Types.instance(context);
enter = Enter.instance(context);
resolve = Resolve.instance(context);
JavacTask t = context.get(JavacTask.class);
javacTaskImpl = t instanceof JavacTaskImpl ? (JavacTaskImpl) t : null;
log = Log.instance(context);
Source source = Source.instance(context);
allowModules = source.allowModules();
}
示例14: JavacElements
import com.sun.tools.javac.comp.Enter; //导入方法依赖的package包/类
protected JavacElements(Context context) {
context.put(JavacElements.class, this);
javaCompiler = JavaCompiler.instance(context);
syms = Symtab.instance(context);
modules = Modules.instance(context);
names = Names.instance(context);
types = Types.instance(context);
enter = Enter.instance(context);
JavacTask t = context.get(JavacTask.class);
javacTaskImpl = t instanceof JavacTaskImpl ? (JavacTaskImpl) t : null;
compileStates = CompileStates.instance(context);
}
示例15: Types
import com.sun.tools.javac.comp.Enter; //导入方法依赖的package包/类
protected Types(Context context) {
context.put(typesKey, this);
syms = Symtab.instance(context);
names = Names.instance(context);
Source source = Source.instance(context);
allowObjectToPrimitiveCast = source.allowObjectToPrimitiveCast();
allowDefaultMethods = source.allowDefaultMethods();
chk = Check.instance(context);
enter = Enter.instance(context);
capturedName = names.fromString("<captured wildcard>");
messages = JavacMessages.instance(context);
diags = JCDiagnostic.Factory.instance(context);
functionDescriptorLookupError = new FunctionDescriptorLookupError();
noWarnings = new Warner(null);
}