@Override public void visitSkip(JCSkip node) { if (hasFlag(FlagKey.SKIP_IS_DECL)) { set(node, new EmptyDeclaration()); } else { set(node, new EmptyStatement()); } }
public void emptyDeclarationMustHaveNoModifiers(EmptyDeclaration node) { Modifiers modifiers = node.astModifiers(); if (!modifiers.astKeywords().isEmpty() || !modifiers.astAnnotations().isEmpty()) { node.addMessage(error(MODIFIERS_MODIFIER_NOT_ALLOWED, "Empty Declarations cannot have modifiers.")); } }
@Override public boolean visitEmptyDeclaration(EmptyDeclaration node) { if (node.getParent() instanceof CompilationUnit) { return posSet(node, treeMaker.Skip()); } return set(node, posNone(treeMaker.Block(0, List.<JCStatement>nil()))); } };
public void emptyDeclarationMustHaveNoModifiers(EmptyDeclaration node) { Modifiers modifiers = node.astModifiers(); if (!modifiers.astKeywords().isEmpty() || !modifiers.astAnnotations().isEmpty()) { node.addMessage(error(MODIFIERS_MODIFIER_NOT_ALLOWED, "Empty Declarations cannot have modifiers.")); } }
@Override public boolean visitEmptyDeclaration(EmptyDeclaration node) { if (node.getParent() instanceof CompilationUnit) { return posSet(node, treeMaker.Skip()); } return set(node, posNone(treeMaker.Block(0, List.<JCStatement>nil()))); } };
public void emptyDeclarationMustHaveNoModifiers(EmptyDeclaration node) { Modifiers modifiers = node.astModifiers(); if (!modifiers.astKeywords().isEmpty() || !modifiers.astAnnotations().isEmpty()) { node.addMessage(error(MODIFIERS_MODIFIER_NOT_ALLOWED, "Empty Declarations cannot have modifiers.")); } }
@Override public void visitSkip(JCSkip node) { if (hasFlag(FlagKey.SKIP_IS_DECL)) { set(node, new EmptyDeclaration()); } else { set(node, new EmptyStatement()); } }
@Override public boolean visitEmptyDeclaration(EmptyDeclaration node) { if (node.getParent() instanceof CompilationUnit) { return posSet(node, treeMaker.Skip()); } return set(node, posNone(treeMaker.Block(0, List.<JCStatement>nil()))); } };
@Override public void visitSkip(JCSkip node) { if (hasFlag(FlagKey.SKIP_IS_DECL)) { set(node, new EmptyDeclaration()); } else { set(node, new EmptyStatement()); } }
public Node createEmptyDeclaration() { return posify(new EmptyDeclaration()); } }
public Node createEmptyDeclaration() { return posify(new EmptyDeclaration()); } }
public Node createEmptyDeclaration() { return posify(new EmptyDeclaration()); } }
@Override public void visitBlock(JCBlock node) { Node n; Block b = new Block(); fillList(node.stats, b.rawContents()); setPos(node, b); if (hasFlag(FlagKey.BLOCKS_ARE_INITIALIZERS)) { if ((node.flags & Flags.STATIC) != 0) { n = setPos(node, new StaticInitializer().astBody(b)); } else { // For some strange reason, solitary ; in a type body are represented not as JCSkips, but as JCBlocks with no endpos. Don't ask me why! if (b.rawContents().isEmpty() && node.endpos == -1) { n = setPos(node, new EmptyDeclaration()); } else { n = setPos(node, new InstanceInitializer().astBody(b)); } } } else { n = b; } set(node, n); }
@Override public void visitBlock(JCBlock node) { Node n; Block b = new Block(); fillList(node.stats, b.rawContents()); setPos(node, b); if (hasFlag(FlagKey.BLOCKS_ARE_INITIALIZERS)) { if ((node.flags & Flags.STATIC) != 0) { n = setPos(node, new StaticInitializer().astBody(b)); } else { // For some strange reason, solitary ; in a type body are represented not as JCSkips, but as JCBlocks with no endpos. Don't ask me why! if (b.rawContents().isEmpty() && node.endpos == -1) { n = setPos(node, new EmptyDeclaration()); } else { n = setPos(node, new InstanceInitializer().astBody(b)); } } } else { n = b; } set(node, n); }
@Override public void visitBlock(JCBlock node) { Node n; Block b = new Block(); fillList(node.stats, b.rawContents()); setPos(node, b); if (hasFlag(FlagKey.BLOCKS_ARE_INITIALIZERS)) { if ((node.flags & Flags.STATIC) != 0) { n = setPos(node, new StaticInitializer().astBody(b)); } else { // For some strange reason, solitary ; in a type body are represented not as JCSkips, but as JCBlocks with no endpos. Don't ask me why! if (b.rawContents().isEmpty() && node.endpos == -1) { n = setPos(node, new EmptyDeclaration()); } else { n = setPos(node, new InstanceInitializer().astBody(b)); } } } else { n = b; } set(node, n); }