Java 类com.sun.source.tree.ModuleTree.ModuleKind 实例源码

项目:openjdk-jdk10    文件:Pretty.java   
@Override
public void visitModuleDef(JCModuleDecl tree) {
    try {
        printDocComment(tree);
        printAnnotations(tree.mods.annotations);
        if (tree.getModuleType() == ModuleKind.OPEN) {
            print("open ");
        }
        print("module ");
        printExpr(tree.qualId);
        if (tree.directives == null) {
            print(";");
        } else {
            printBlock(tree.directives);
        }
        println();
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
}
项目:openjdk-jdk10    文件:Modules.java   
@Override
public void visitModuleDef(JCModuleDecl tree) {
    sym = Assert.checkNonNull(tree.sym);

    if (tree.getModuleType() == ModuleKind.OPEN) {
        sym.flags.add(ModuleFlags.OPEN);
    }
    sym.flags_field |= (tree.mods.flags & Flags.DEPRECATED);

    sym.requires = List.nil();
    sym.exports = List.nil();
    sym.opens = List.nil();
    tree.directives.forEach(t -> t.accept(this));
    sym.requires = sym.requires.reverse();
    sym.exports = sym.exports.reverse();
    sym.opens = sym.opens.reverse();
    ensureJavaBase();
}
项目:moduletools    文件:JavacModuleParser.java   
public void visitModule(ModuleTree node, TreeVisitor<?, ?> visitor) {
  String name = qualifiedString(node.getName());
  int flags = node.getModuleType() == ModuleKind.OPEN? ACC_OPEN: 0;

  mv = moduleClassVisitor.visitModule(name, flags, null);

  node.getDirectives().forEach(n -> accept(visitor, n));
}
项目:openjdk-jdk10    文件:JCTree.java   
protected JCModuleDecl(JCModifiers mods, ModuleKind kind,
        JCExpression qualId, List<JCDirective> directives) {
    this.mods = mods;
    this.kind = kind;
    this.qualId = qualId;
    this.directives = directives;
}
项目:openjdk-jdk10    文件:TreeMaker.java   
@Override
public JCModuleDecl ModuleDef(JCModifiers mods, ModuleKind kind,
        JCExpression qualid, List<JCDirective> directives) {
    JCModuleDecl tree = new JCModuleDecl(mods, kind, qualid, directives);
    tree.pos = pos;
    return tree;
}
项目:pro    文件:JavacModuleParser.java   
public void visitModule(ModuleTree node, TreeVisitor<?, ?> visitor) {
  String name = qualifiedString(node.getName());
  int flags = node.getModuleType() == ModuleKind.OPEN? ACC_OPEN: 0;

  mv = moduleClassVisitor.visitModule(name, flags, null);

  node.getDirectives().forEach(n -> accept(visitor, n));
}
项目:openjdk-jdk10    文件:JCTree.java   
@Override @DefinedBy(Api.COMPILER_TREE)
public ModuleKind getModuleType() {
    return kind;
}
项目:openjdk-jdk10    文件:JCTree.java   
JCModuleDecl ModuleDef(JCModifiers mods, ModuleKind kind, JCExpression qualId, List<JCDirective> directives);