Example usage for org.eclipse.jdt.core.dom SuperFieldAccess getName

List of usage examples for org.eclipse.jdt.core.dom SuperFieldAccess getName

Introduction

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

Prototype

public SimpleName getName() 

Source Link

Document

Returns the name of the field accessed in this "super" field access expression.

Usage

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

License:Open Source License

@Override
public boolean visit(SuperFieldAccess node) {
    if (node.getQualifier() != null) {
        node.getQualifier().accept(this);
        this.fBuffer.append(".");//$NON-NLS-1$
    }/*www  . ja  v  a  2 s  .c om*/
    this.fBuffer.append("super.");//$NON-NLS-1$
    node.getName().accept(this);
    return false;
}

From source file:boa.datagen.util.Java7Visitor.java

License:Apache License

@Override
public boolean visit(SuperFieldAccess node) {
    boa.types.Ast.Expression.Builder b = boa.types.Ast.Expression.newBuilder();
    //      b.setPosition(pos.build());
    b.setKind(boa.types.Ast.Expression.ExpressionKind.VARACCESS);
    String name = "super." + node.getName().getFullyQualifiedName();
    if (node.getQualifier() != null)
        name = node.getQualifier().getFullyQualifiedName() + "." + name;
    b.setVariable(name);/*from  w ww  . j av a2s . c  o  m*/
    expressions.push(b.build());
    return false;
}

From source file:ca.mcgill.cs.swevo.jayfx.ASTCrawler.java

License:Open Source License

@Override
public boolean visit(final SuperFieldAccess pNode) {
    final IVariableBinding lBinding = (IVariableBinding) pNode.getName().resolveBinding();

    if (lBinding == null) {
        ASTCrawler.log("Null binding 2 for" + pNode);
        return false;
    }/*from  www  .j  a v a 2s.  c om*/
    this.addAccessRelation(lBinding);

    final Assignment assignment = ASTCrawler.getAssignment(pNode);
    if (assignment != null) {
        this.addSetsRelation(lBinding);

        if (!(assignment.getOperator() == Assignment.Operator.ASSIGN))
            this.addGetsRelation(lBinding);
    } else
        this.addGetsRelation(lBinding);
    return true;
}

From source file:coloredide.utils.CopiedNaiveASTFlattener.java

License:Open Source License

public boolean visit(SuperFieldAccess node) {
    if (node.getQualifier() != null) {
        node.getQualifier().accept(this);
        this.buffer.append(".");//$NON-NLS-1$
    }/*from   ww  w .ja v a  2 s  .  c o  m*/
    this.buffer.append("super.");//$NON-NLS-1$
    node.getName().accept(this);
    return false;
}

From source file:com.google.devtools.j2cpp.gen.CppStatementGenerator.java

License:Open Source License

@Override
public boolean visit(SuperFieldAccess node) {
    buffer.append("super.");
    buffer.append(NameTable.getName(node.getName()));
    return false;
}

From source file:com.google.devtools.j2objc.ast.DebugASTPrinter.java

License:Apache License

@Override
public boolean visit(SuperFieldAccess node) {
    if (node.getQualifier() != null) {
        node.getQualifier().accept(this);
        sb.print(".");
    }// w  ww  .  jav  a 2 s . c om
    sb.print("super.");
    node.getName().accept(this);
    return false;
}

From source file:com.google.googlejavaformat.java.JavaInputAstVisitor.java

License:Apache License

/** Visitor method for {@link SuperFieldAccess}es. */
@Override/* w  w w .  j  av  a 2 s  . c o  m*/
public boolean visit(SuperFieldAccess node) {
    sync(node);
    builder.open(plusFour);
    if (node.getQualifier() != null) {
        node.getQualifier().accept(this);
        builder.breakOp();
        token(".");
    }
    token("super");
    builder.breakOp();
    token(".");
    visit(node.getName());
    builder.close();
    return false;
}

From source file:com.ibm.wala.cast.java.translator.jdt.JDTJava2CAstTranslator.java

License:Open Source License

private CAstNode visit(SuperFieldAccess n, WalkContext context) {
    CAstNode targetNode;//  w  ww  .  j a  v a2 s  . c  o  m
    if (n.getQualifier() == null)
        targetNode = makeNode(context, fFactory, n, CAstNode.SUPER);
    else {
        TypeReference owningTypeRef = fIdentityMapper.getTypeRef(n.getQualifier().resolveTypeBinding());
        targetNode = makeNode(context, fFactory, n, CAstNode.SUPER, fFactory.makeConstant(owningTypeRef));
    }
    return createFieldAccess(targetNode, n.getName().getIdentifier(), n.resolveFieldBinding(), n, context);
}

From source file:edu.cmu.cs.crystal.cfg.eclipse.EclipseCFG.java

License:Open Source License

@Override
public void endVisit(SuperFieldAccess node) {
    EclipseCFGNode field = nodeMap.get(node);
    EclipseCFGNode name = nodeMap.get(node.getName());

    createEdge(name.getEnd(), field);/*from  w ww. j  a  v a2  s.  c  om*/

    if (node.getQualifier() != null) {
        EclipseCFGNode qual = nodeMap.get(node.getQualifier());
        createEdge(qual.getEnd(), name.getStart());
        field.setStart(qual.getStart());
    } else
        field.setStart(name.getStart());
}

From source file:edu.uci.ics.sourcerer.extractor.ast.ReferenceExtractorVisitor.java

License:Open Source License

/**
 * This method writes:// w  ww. jav a  2 s  .c  o  m
 *<ul>
 *  <li>For super field access expressions:
 *  <ul>
 *    <li>Writes relation to <code>IRelationWriter</code>.</li>
 *    <li>Reads relation to <code>IRelationWriter</code>.</li>
 *  </ul></li>
 *</ul>
 */
@Override
public boolean visit(SuperFieldAccess node) {
    // Get the fqn
    String fqn = null;
    IVariableBinding binding = node.resolveFieldBinding();
    if (binding == null) {
        fqn = getUnknownSuperFqn(node.getName().getIdentifier());
    } else {
        ITypeBinding declaringClass = binding.getDeclaringClass();
        if (declaringClass != null) {
            declaringClass = declaringClass.getErasure();
        }
        if (declaringClass == null) {
            fqn = getUnknownSuperFqn(binding.getName());
        } else {
            fqn = getTypeFqn(declaringClass) + "." + binding.getName();
        }
    }

    // Write the relation
    if (inLhsAssignment) {
        relationWriter.writeWrites(fqnStack.getFqn(), fqn, getLocation(node));
    } else {
        relationWriter.writeReads(fqnStack.getFqn(), fqn, getLocation(node));
    }

    return true;
}