Search in sources :

Example 1 with SuperExpr

use of com.github.javaparser.ast.expr.SuperExpr in project checker-framework by typetools.

the class DoubleJavaParserVisitor method visit.

@Override
public void visit(final SuperExpr node1, final Node other) {
    SuperExpr node2 = (SuperExpr) other;
    defaultAction(node1, node2);
    node1.getTypeName().ifPresent(l -> l.accept(this, node2.getTypeName().get()));
}
Also used : SuperExpr(com.github.javaparser.ast.expr.SuperExpr)

Example 2 with SuperExpr

use of com.github.javaparser.ast.expr.SuperExpr in project checker-framework by typetools.

the class JointJavacJavaParserVisitor method visitMemberSelect.

@Override
public Void visitMemberSelect(MemberSelectTree javacTree, Node javaParserNode) {
    if (javaParserNode instanceof FieldAccessExpr) {
        FieldAccessExpr node = (FieldAccessExpr) javaParserNode;
        processMemberSelect(javacTree, node);
        javacTree.getExpression().accept(this, node.getScope());
    } else if (javaParserNode instanceof Name) {
        Name node = (Name) javaParserNode;
        processMemberSelect(javacTree, node);
        assert node.getQualifier().isPresent();
        javacTree.getExpression().accept(this, node.getQualifier().get());
    } else if (javaParserNode instanceof ClassOrInterfaceType) {
        ClassOrInterfaceType node = (ClassOrInterfaceType) javaParserNode;
        processMemberSelect(javacTree, node);
        assert node.getScope().isPresent();
        javacTree.getExpression().accept(this, node.getScope().get());
    } else if (javaParserNode instanceof ClassExpr) {
        ClassExpr node = (ClassExpr) javaParserNode;
        processMemberSelect(javacTree, node);
        javacTree.getExpression().accept(this, node.getType());
    } else if (javaParserNode instanceof ThisExpr) {
        ThisExpr node = (ThisExpr) javaParserNode;
        processMemberSelect(javacTree, node);
        assert node.getTypeName().isPresent();
        javacTree.getExpression().accept(this, node.getTypeName().get());
    } else if (javaParserNode instanceof SuperExpr) {
        SuperExpr node = (SuperExpr) javaParserNode;
        processMemberSelect(javacTree, node);
        assert node.getTypeName().isPresent();
        javacTree.getExpression().accept(this, node.getTypeName().get());
    } else {
        throwUnexpectedNodeType(javacTree, javaParserNode);
    }
    return null;
}
Also used : SuperExpr(com.github.javaparser.ast.expr.SuperExpr) FieldAccessExpr(com.github.javaparser.ast.expr.FieldAccessExpr) ClassExpr(com.github.javaparser.ast.expr.ClassExpr) ClassOrInterfaceType(com.github.javaparser.ast.type.ClassOrInterfaceType) ThisExpr(com.github.javaparser.ast.expr.ThisExpr) SimpleName(com.github.javaparser.ast.expr.SimpleName) Name(com.github.javaparser.ast.expr.Name)

Aggregations

SuperExpr (com.github.javaparser.ast.expr.SuperExpr)2 ClassExpr (com.github.javaparser.ast.expr.ClassExpr)1 FieldAccessExpr (com.github.javaparser.ast.expr.FieldAccessExpr)1 Name (com.github.javaparser.ast.expr.Name)1 SimpleName (com.github.javaparser.ast.expr.SimpleName)1 ThisExpr (com.github.javaparser.ast.expr.ThisExpr)1 ClassOrInterfaceType (com.github.javaparser.ast.type.ClassOrInterfaceType)1