private void visitList(List<ASTNode> list) { for (ASTNode node : list) { (node).accept(this); } }
protected IASTFragment createFragment(ASTNode node) { fFragment = null; node.accept(this); return fFragment; }
public static ArrayList<LambdaExpression> perform(ASTNode node) { LambdaExpressionsFinder finder = new LambdaExpressionsFinder(); node.accept(finder); return finder.fNodes; }
public static Set<String> perform(ASTNode[] nodes) { UsedNamesCollector collector = new UsedNamesCollector(); for (int i = 0; i < nodes.length; i++) { nodes[i].accept(collector); } return collector.result; }
@Override public boolean visit(BreakStatement node) { this.result.append("break"); //$NON-NLS-1$ ASTNode label= getChildNode(node, BreakStatement.LABEL_PROPERTY); if (label != null) { this.result.append(' '); label.accept(this); } this.result.append(';'); return false; }
@Override public boolean visit(ContinueStatement node) { this.result.append("continue"); //$NON-NLS-1$ ASTNode label= getChildNode(node, ContinueStatement.LABEL_PROPERTY); if (label != null) { this.result.append(' '); label.accept(this); } this.result.append(';'); return false; }
@Override public boolean visit(SuperFieldAccess node) { ASTNode qualifier= getChildNode(node, SuperFieldAccess.QUALIFIER_PROPERTY); if (qualifier != null) { qualifier.accept(this); this.result.append('.'); } this.result.append("super."); //$NON-NLS-1$ getChildNode(node, SuperFieldAccess.NAME_PROPERTY).accept(this); return false; }
@Override public boolean visit(SwitchCase node) { ASTNode expression= getChildNode(node, SwitchCase.EXPRESSION_PROPERTY); if (expression == null) { this.result.append("default"); //$NON-NLS-1$ } else { this.result.append("case "); //$NON-NLS-1$ expression.accept(this); } this.result.append(':'); return false; }
public boolean check() { fResult = true; fExpression.getAssociatedNode().accept(this); return fResult; } }
@Override public boolean visit(CreationReference node) { getChildNode(node, CreationReference.TYPE_PROPERTY).accept(this); this.result.append("::"); //$NON-NLS-1$ visitList(node, CreationReference.TYPE_ARGUMENTS_PROPERTY, Util.EMPTY_STRING, String.valueOf('<'), String.valueOf('>')); this.result.append("new"); //$NON-NLS-1$ return false; }
@Override public boolean visit(InfixExpression node) { getChildNode(node, InfixExpression.LEFT_OPERAND_PROPERTY).accept(this); this.result.append(' '); String operator= getAttribute(node, InfixExpression.OPERATOR_PROPERTY).toString(); this.result.append(operator); this.result.append(' '); getChildNode(node, InfixExpression.RIGHT_OPERAND_PROPERTY).accept(this); String separator= ' ' + operator + ' '; visitList(node, InfixExpression.EXTENDED_OPERANDS_PROPERTY, separator, separator, Util.EMPTY_STRING); return false; }
@Override public boolean visit(PrefixExpression node) { this.result.append(getAttribute(node, PrefixExpression.OPERATOR_PROPERTY).toString()); getChildNode(node, PrefixExpression.OPERAND_PROPERTY).accept(this); return false; }
@Override public boolean visit(ParameterizedType node) { getChildNode(node, ParameterizedType.TYPE_PROPERTY).accept(this); this.result.append('<'); visitList(node, ParameterizedType.TYPE_ARGUMENTS_PROPERTY, ", "); //$NON-NLS-1$ this.result.append('>'); return false; }
/** * Appends a standard Java source code representation of this subtree to the given * string buffer. * * @param buffer the string buffer to append to */ final void appendPrintString(StringBuffer buffer) { NaiveASTFlattener printer = new NaiveASTFlattener(); accept(printer); buffer.append(printer.getResult()); }
@Override public boolean visit(NameQualifiedType node) { getChildNode(node, NameQualifiedType.QUALIFIER_PROPERTY).accept(this); this.result.append('.'); if (node.getAST().apiLevel() >= JLS8_INTERNAL) { visitList(node, NameQualifiedType.ANNOTATIONS_PROPERTY, String.valueOf(' '), Util.EMPTY_STRING, String.valueOf(' ')); } getChildNode(node, NameQualifiedType.NAME_PROPERTY).accept(this); return false; }
public void process(ASTNode node) { try { fFlowContext.setLoopReentranceMode(true); node.accept(this); } finally { fFlowContext.setLoopReentranceMode(false); } }
public FlowInfo perform(ASTNode[] selectedNodes) { FlowContext context = getFlowContext(); GenericSequentialFlowInfo result = createSequential(); for (int i = 0; i < selectedNodes.length; i++) { ASTNode node = selectedNodes[i]; node.accept(this); result.merge(getFlowInfo(node), context); } return result; }