Example usage for org.eclipse.jdt.core.dom VariableDeclarationExpression getAST

List of usage examples for org.eclipse.jdt.core.dom VariableDeclarationExpression getAST

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.dom VariableDeclarationExpression getAST.

Prototype

public final AST getAST() 

Source Link

Document

Returns this node's AST.

Usage

From source file:at.bestsolution.fxide.jdt.corext.dom.ASTFlattener.java

License:Open Source License

@Override
public boolean visit(VariableDeclarationExpression node) {
    if (node.getAST().apiLevel() >= JLS3) {
        printModifiers(node.modifiers());
    }//from w  w  w . ja  va2 s .  co m
    node.getType().accept(this);
    this.fBuffer.append(" ");//$NON-NLS-1$
    for (Iterator<VariableDeclarationFragment> it = node.fragments().iterator(); it.hasNext();) {
        VariableDeclarationFragment f = it.next();
        f.accept(this);
        if (it.hasNext()) {
            this.fBuffer.append(", ");//$NON-NLS-1$
        }
    }
    return false;
}

From source file:coloredide.utils.CopiedNaiveASTFlattener.java

License:Open Source License

public boolean visit(VariableDeclarationExpression node) {
    if (node.getAST().apiLevel() >= AST.JLS3) {
        printModifiers(node.modifiers());
    }/*from w w  w.  j  a va  2s  . c o m*/
    node.getType().accept(this);
    this.buffer.append(" ");//$NON-NLS-1$
    for (Iterator it = node.fragments().iterator(); it.hasNext();) {
        VariableDeclarationFragment f = (VariableDeclarationFragment) it.next();
        f.accept(this);
        if (it.hasNext()) {
            this.buffer.append(", ");//$NON-NLS-1$
        }
    }
    return false;
}

From source file:lang.java.jdt.internal.JdtAstToRascalAstConverter.java

License:Open Source License

public boolean visit(VariableDeclarationExpression node) {

    java.util.Map.Entry<IValueList, IValueList> extendedModifiers;
    if (node.getAST().apiLevel() == AST.JLS2) {
        extendedModifiers = new java.util.AbstractMap.SimpleEntry<IValueList, IValueList>(
                parseModifiers(node.getModifiers()), new IValueList(values));
    } else {/* www  .  j  av a2s . co  m*/
        extendedModifiers = parseExtendedModifiers(node.modifiers());
    }

    IValue type = visitChild(node.getType());

    IValueList fragments = new IValueList(values);
    for (Iterator it = node.fragments().iterator(); it.hasNext();) {
        VariableDeclarationFragment f = (VariableDeclarationFragment) it.next();
        fragments.add(visitChild(f));
    }

    ownValue = constructRascalNode(node, extendedModifiers.getKey().asList(),
            extendedModifiers.getValue().asList(), type, fragments.asList());
    return false;
}

From source file:org.codemucker.jmutate.ast.JAstFlattener.java

License:Open Source License

public boolean visit(VariableDeclarationExpression node) {
    if (node.getAST().apiLevel() == JLS2) {
        printModifiers(node.getModifiers());
    }//from w ww.  jav a2 s  .c om
    if (node.getAST().apiLevel() >= JLS3) {
        printModifiers(node.modifiers());
    }
    node.getType().accept(this);
    this.buffer.append(" ");//$NON-NLS-1$
    for (Iterator it = node.fragments().iterator(); it.hasNext();) {
        VariableDeclarationFragment f = (VariableDeclarationFragment) it.next();
        f.accept(this);
        if (it.hasNext()) {
            this.buffer.append(", ");//$NON-NLS-1$
        }
    }
    return false;
}