public static void replaceAll(final AstNode tree) { for (final AstNode node : tree.getDescendants()) { if (node instanceof CommentStatement) { node.getParent().insertChildBefore( node, new Comment(((CommentStatement) node).getComment()), Roles.COMMENT ); node.remove(); } } }
public static void replaceAll(final AstNode tree) { for (final AstNode node : tree.getDescendants()) { if (node instanceof CommentStatement) { node.getParent().insertChildBefore( node, new Comment(((CommentStatement) node).getComment()), Roles.COMMENT ); node.remove(); } } }
public static void replaceAll(final AstNode tree) { for (final AstNode node : tree.getDescendants()) { if (node instanceof CommentStatement) { node.getParent().insertChildBefore( node, new Comment(((CommentStatement) node).getComment()), Roles.COMMENT ); node.remove(); } } }
); block.addChild(new Comment(" ", CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" This method could not be decompiled.", CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" ", CommentType.SingleLine), Roles.COMMENT); ); block.addChild(new Comment(" Original Bytecode:", CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" ", CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(line.replace("\t", " "), CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" ", CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" Could not show original bytecode, likely due to the same error.", CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" ", CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" The error that occurred was:", CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" ", CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" " + line.replace("\t", " "), CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" ", CommentType.SingleLine), Roles.COMMENT);
); block.addChild(new Comment(" ", CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" This method could not be decompiled.", CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" ", CommentType.SingleLine), Roles.COMMENT); ); block.addChild(new Comment(" Original Bytecode:", CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" ", CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(line.replace("\t", " "), CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" ", CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" Could not show original bytecode, likely due to the same error.", CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" ", CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" The error that occurred was:", CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" ", CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" " + line.replace("\t", " "), CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" ", CommentType.SingleLine), Roles.COMMENT);
); block.addChild(new Comment(" ", CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" This method could not be decompiled.", CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" ", CommentType.SingleLine), Roles.COMMENT); ); block.addChild(new Comment(" Original Bytecode:", CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" ", CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(line.replace("\t", " "), CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" ", CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" Could not show original bytecode, likely due to the same error.", CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" ", CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" The error that occurred was:", CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" ", CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" " + line.replace("\t", " "), CommentType.SingleLine), Roles.COMMENT); block.addChild(new Comment(" ", CommentType.SingleLine), Roles.COMMENT);
public AstBuilder(final DecompilerContext context) { _context = VerifyArgument.notNull(context, "context"); final String headerText = context.getSettings().getOutputFileHeaderText(); if (!StringUtilities.isNullOrWhitespace(headerText)) { final List<String> lines = StringUtilities.split(headerText, false, '\n'); for (final String line : lines) { _compileUnit.addChild(new Comment(" " + line.trim(), CommentType.SingleLine), Roles.COMMENT); } _compileUnit.addChild(new UnixNewLine(), Roles.NEW_LINE); } _packagePlaceholder = new TextNode(); _compileUnit.addChild(_packagePlaceholder, Roles.TEXT); if (_context.getUserData(Keys.AST_BUILDER) == null) { _context.putUserData(Keys.AST_BUILDER, this); } }
public AstBuilder(final DecompilerContext context) { _context = VerifyArgument.notNull(context, "context"); final String headerText = context.getSettings().getOutputFileHeaderText(); if (!StringUtilities.isNullOrWhitespace(headerText)) { final List<String> lines = StringUtilities.split(headerText, false, '\n'); for (final String line : lines) { _compileUnit.addChild(new Comment(" " + line.trim(), CommentType.SingleLine), Roles.COMMENT); } _compileUnit.addChild(new UnixNewLine(), Roles.NEW_LINE); } _packagePlaceholder = new TextNode(); _compileUnit.addChild(_packagePlaceholder, Roles.TEXT); if (_context.getUserData(Keys.AST_BUILDER) == null) { _context.putUserData(Keys.AST_BUILDER, this); } }
public AstBuilder(final DecompilerContext context) { _context = VerifyArgument.notNull(context, "context"); final String headerText = context.getSettings().getOutputFileHeaderText(); if (!StringUtilities.isNullOrWhitespace(headerText)) { final List<String> lines = StringUtilities.split(headerText, false, '\n'); for (final String line : lines) { _compileUnit.addChild(new Comment(" " + line.trim(), CommentType.SingleLine), Roles.COMMENT); } _compileUnit.addChild(new UnixNewLine(), Roles.NEW_LINE); } _packagePlaceholder = new TextNode(); _compileUnit.addChild(_packagePlaceholder, Roles.TEXT); if (_context.getUserData(Keys.AST_BUILDER) == null) { _context.putUserData(Keys.AST_BUILDER, this); } }