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


Java MemberEnter类代码示例

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


MemberEnter类属于com.sun.tools.javac.comp包,在下文中一共展示了MemberEnter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import com.sun.tools.javac.comp.MemberEnter; //导入依赖的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

示例2: findIdent

import com.sun.tools.javac.comp.MemberEnter; //导入依赖的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

示例3: getQueryCallExpression

import com.sun.tools.javac.comp.MemberEnter; //导入依赖的package包/类
/**
 * Returns a {@link JCMethodInvocation} node which calls the query call method defined
 * by the defineQueryCallMethod method.
 * <p>
 * The returned node is intended to replace the {@link JCSqlQuery} node, as it is a normal
 * method call that can be handled appropriately.
 * @param memberEnter The current MemberEnter instance to enter live-generated code.
 * @return A {@link JCMethodInvocation} node which is intended to replace the {@link JCSqlQuery} node. 
 */
public JCMethodInvocation getQueryCallExpression(MemberEnter memberEnter) {
	MethodCallCodeGenerator codeGenerator = new MethodCallCodeGenerator();
	String queryCall = codeGenerator.getQueryCall(this);

	// create expression parse node from string
	JCExpression queryCallExpression = Reifier.getInstance().reifyExpression(queryCall);

	if (queryCallExpression instanceof JCMethodInvocation) {
		// enter it to symbol table
		queryCallExpression.accept(memberEnter);

		// note: attribution will happen in the calling method in the Attr
		// class, as this will need the expected type
		return (JCMethodInvocation) queryCallExpression;
	}
	// tbd: checked exception handling
	throw new RuntimeException("Parsed query call expression is no method invocation");
}
 
开发者ID:sebastianoe,项目名称:s4j,代码行数:28,代码来源:JCSqlQuery.java

示例4: TreeScannerStateful

import com.sun.tools.javac.comp.MemberEnter; //导入依赖的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

示例5: preRegister

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

示例6: preRegister

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

示例7: init

import com.sun.tools.javac.comp.MemberEnter; //导入依赖的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

示例8: preRegister

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

示例9: init

import com.sun.tools.javac.comp.MemberEnter; //导入依赖的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

示例10: getMemberEnterDotEnv

import com.sun.tools.javac.comp.MemberEnter; //导入依赖的package包/类
private static Field getMemberEnterDotEnv() {
	if (memberEnterDotEnv != null) return memberEnterDotEnv;
	try {
		Field f = MemberEnter.class.getDeclaredField("env");
		f.setAccessible(true);
		memberEnterDotEnv = f;
	} catch (NoSuchFieldException e) {
		return null;
	}
	
	return memberEnterDotEnv;
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:13,代码来源:JavacResolution.java

示例11: getEnvOfMemberEnter

import com.sun.tools.javac.comp.MemberEnter; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private static Env<AttrContext> getEnvOfMemberEnter(MemberEnter memberEnter) {
	Field f = getMemberEnterDotEnv();
	try {
		return (Env<AttrContext>) f.get(memberEnter);
	} catch (Exception e) {
		return null;
	}
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:10,代码来源:JavacResolution.java

示例12: setEnvOfMemberEnter

import com.sun.tools.javac.comp.MemberEnter; //导入依赖的package包/类
private static void setEnvOfMemberEnter(MemberEnter memberEnter, Env<AttrContext> env) {
	Field f = getMemberEnterDotEnv();
	try {
		f.set(memberEnter, env);
	} catch (Exception e) {
		return;
	}
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:9,代码来源:JavacResolution.java

示例13: memberEnterAndAttribute

import com.sun.tools.javac.comp.MemberEnter; //导入依赖的package包/类
private void memberEnterAndAttribute(JCTree copy, Env<AttrContext> env, Context context) {
	MemberEnter memberEnter = MemberEnter.instance(context);
	Env<AttrContext> oldEnv = getEnvOfMemberEnter(memberEnter);
	setEnvOfMemberEnter(memberEnter, env);
	try {
		copy.accept(memberEnter);
	} catch (Exception ignore) {
		// intentionally ignored; usually even if this step fails, val will work (but not for val in method local inner classes and anonymous inner classes).
		AssertionLogger.assertLog("member enter failed.", ignore);
	} finally {
		setEnvOfMemberEnter(memberEnter, oldEnv);
	}
	attrib(copy, env);
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:15,代码来源:JavacResolution.java

示例14: JavacTrees

import com.sun.tools.javac.comp.MemberEnter; //导入依赖的package包/类
private JavacTrees(Context context) {
    context.put(JavacTrees.class, this);
    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:unktomi,项目名称:form-follows-function,代码行数:12,代码来源:JavacTrees.java

示例15: preRegister

import com.sun.tools.javac.comp.MemberEnter; //导入依赖的package包/类
public static void preRegister(final Context context) {
    context.put(memberEnterKey, new Context.Factory<MemberEnter>() {
           public MemberEnter make() {
               return new JavadocMemberEnter(context);
           }
    });
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:8,代码来源:JavadocMemberEnter.java


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