@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); } }
@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(); }
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)); }
protected JCModuleDecl(JCModifiers mods, ModuleKind kind, JCExpression qualId, List<JCDirective> directives) { this.mods = mods; this.kind = kind; this.qualId = qualId; this.directives = directives; }
@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; }
@Override @DefinedBy(Api.COMPILER_TREE) public ModuleKind getModuleType() { return kind; }
JCModuleDecl ModuleDef(JCModifiers mods, ModuleKind kind, JCExpression qualId, List<JCDirective> directives);