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


Java Enter类代码示例

本文整理汇总了Java中com.sun.tools.javac.comp.Enter的典型用法代码示例。如果您正苦于以下问题:Java Enter类的具体用法?Java Enter怎么用?Java Enter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Enter类属于com.sun.tools.javac.comp包,在下文中一共展示了Enter类的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: clear

import com.sun.tools.javac.comp.Enter; //导入依赖的package包/类
void clear() {
    drop(Arguments.argsKey);
    drop(DiagnosticListener.class);
    drop(Log.outKey);
    drop(Log.errKey);
    drop(JavaFileManager.class);
    drop(JavacTask.class);

    if (ht.get(Log.logKey) instanceof ReusableLog) {
        //log already inited - not first round
        ((ReusableLog)Log.instance(this)).clear();
        Enter.instance(this).newRound();
        ((ReusableJavaCompiler)ReusableJavaCompiler.instance(this)).clear();
        Types.instance(this).newRound();
        Check.instance(this).newRound();
        Modules.instance(this).newRound();
        Annotate.instance(this).newRound();
        CompileStates.instance(this).clear();
        MultiTaskListener.instance(this).clear();

        //find if any of the roots have redefined java.* classes
        Symtab syms = Symtab.instance(this);
        pollutionScanner.scan(roots, syms);
        roots.clear();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:27,代码来源:ReusableContext.java

示例5: clear

import com.sun.tools.javac.comp.Enter; //导入依赖的package包/类
void clear() {
    drop(Arguments.argsKey);
    drop(DiagnosticListener.class);
    drop(Log.outKey);
    drop(JavaFileManager.class);
    drop(JavacTask.class);

    if (ht.get(Log.logKey) instanceof ReusableLog) {
        //log already inited - not first round
        ((ReusableLog)Log.instance(this)).clear();
        Enter.instance(this).newRound();
        ((ReusableJavaCompiler)ReusableJavaCompiler.instance(this)).clear();
        Types.instance(this).newRound();
        Check.instance(this).newRound();
        CompileStates.instance(this).clear();
        MultiTaskListener.instance(this).clear();

        //find if any of the roots have redefined java.* classes
        Symtab syms = Symtab.instance(this);
        pollutionScanner.scan(roots, syms);
        roots.clear();
    }
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:24,代码来源:ReusableContext.java

示例6: 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

示例7: infer

import com.sun.tools.javac.comp.Enter; //导入依赖的package包/类
/**
 * Returns the inferred method type of the template based on the given actual argument types.
 *
 * @throws NoInstanceException if no instances of the specified type variables would allow the
 *         {@code actualArgTypes} to match the {@code expectedArgTypes}
 */
private Type infer(Warner warner,
    Inliner inliner,
    List<Type> freeTypeVariables,
    List<Type> expectedArgTypes,
    Type returnType,
    List<Type> actualArgTypes) throws NoInstanceException {
  Symtab symtab = inliner.symtab();
  MethodType methodType =
      new MethodType(expectedArgTypes, returnType, List.<Type>nil(), symtab.methodClass);
  Enter enter = inliner.enter();
  MethodSymbol methodSymbol =
      new MethodSymbol(0, inliner.asName("__m__"), methodType, symtab.unknownSymbol);
  return inliner.infer().instantiateMethod(enter.getEnv(methodType.tsym),
      freeTypeVariables,
      methodType,
      methodSymbol,
      actualArgTypes,
      autoboxing(),
      false,
      warner);
}
 
开发者ID:sivakumar-kailasam,项目名称:refactor-faster,代码行数:28,代码来源:Template.java

示例8: findIdent

import com.sun.tools.javac.comp.Enter; //导入依赖的package包/类
/** Finds a declaration with the given name and type that is in scope at the current location. */
public static Symbol findIdent(String name, VisitorState state, KindSelector kind) {
  ClassType enclosingClass = ASTHelpers.getType(state.findEnclosing(ClassTree.class));
  if (enclosingClass == null || enclosingClass.tsym == null) {
    return null;
  }
  Env<AttrContext> env = Enter.instance(state.context).getClassEnv(enclosingClass.tsym);
  MethodTree enclosingMethod = state.findEnclosing(MethodTree.class);
  if (enclosingMethod != null) {
    env = MemberEnter.instance(state.context).getMethodEnv((JCMethodDecl) enclosingMethod, env);
  }
  try {
    Method method =
        Resolve.class.getDeclaredMethod("findIdent", Env.class, Name.class, KindSelector.class);
    method.setAccessible(true);
    Symbol result =
        (Symbol) method.invoke(Resolve.instance(state.context), env, state.getName(name), kind);
    return result.exists() ? result : null;
  } catch (ReflectiveOperationException e) {
    throw new LinkageError(e.getMessage(), e);
  }
}
 
开发者ID:google,项目名称:error-prone,代码行数:23,代码来源:FindIdentifiers.java

示例9: 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

示例10: 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

示例11: 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

示例12: 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

示例13: 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

示例14: preRegister

import com.sun.tools.javac.comp.Enter; //导入依赖的package包/类
public static void preRegister(Context context) {
    context.put(enterKey, new Context.Factory<Enter>() {
        public Enter make(Context c) {
            return new NBEnter(c);
        }
    });
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:NBEnter.java

示例15: preRegister

import com.sun.tools.javac.comp.Enter; //导入依赖的package包/类
public static void preRegister(final Context context) {
    context.put(enterKey, new Context.Factory<Enter>() {
        public Enter make(Context c) {
            return new NBJavadocEnter(c);
        }
    });
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:NBJavadocEnter.java


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