当前位置: 首页>>代码示例>>Java>>正文


Java Enter.instance方法代码示例

本文整理汇总了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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:Types.java

示例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;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:JavacTrees.java

示例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);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:Types.java

示例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);
}
 
开发者ID:ojdkbuild,项目名称:lookaside_java-1.8.0-openjdk,代码行数:19,代码来源:Types.java

示例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;
}
 
开发者ID:metabrain,项目名称:java8-plugin-persitent-local-vars,代码行数:27,代码来源:TreeScannerStateful.java

示例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();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:PostFlowAnalysis.java

示例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;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:TreeUtilities.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:Hacks.java

示例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);
        }
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:33,代码来源:Utilities.java

示例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);
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:11,代码来源:JavacTrees.java

示例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);
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:13,代码来源:JavacElements.java

示例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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:JavacTrees.java

示例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();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:16,代码来源:JavacElements.java

示例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);
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:13,代码来源:JavacElements.java

示例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);
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:16,代码来源:Types.java


注:本文中的com.sun.tools.javac.comp.Enter.instance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。