All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.checkerframework.dataflow.expression.JavaExpressionScanner Maven / Gradle / Ivy

Go to download

dataflow-nullaway is a dataflow framework based on the javac compiler. It differs from the org.checkerframework:dataflow artifact in two ways. First, the packages in this artifact have been renamed to org.checkerframework.nullaway.*. Second, unlike the dataflow artifact, this artifact contains the dependencies it requires.

There is a newer version: 3.48.3
Show newest version
package org.checkerframework.dataflow.expression;

import java.util.List;
import org.checkerframework.checker.nullness.qual.Nullable;

/**
 * A simple scanner for {@link JavaExpression}.
 *
 * @param 

the parameter passed to the scan methods */ public abstract class JavaExpressionScanner

extends JavaExpressionVisitor { /** * Scans the JavaExpression. * * @param javaExpression the expression to scan * @param p parameter to pass */ public void scan(JavaExpression javaExpression, P p) { visit(javaExpression, p); } /** * Scans each JavaExpression in {@code expressions}. * * @param expressions a list of JavaExpressions to scan * @param p pameter to pass */ public void scan(List expressions, P p) { for (JavaExpression expression : expressions) { if (expression != null) { visit(expression, p); } } } @Override protected Void visitArrayAccess(ArrayAccess arrayAccessExpr, P p) { visit(arrayAccessExpr.getArray(), p); visit(arrayAccessExpr.getIndex(), p); return null; } @Override protected Void visitArrayCreation(ArrayCreation arrayCreationExpr, P p) { scan(arrayCreationExpr.getDimensions(), p); scan(arrayCreationExpr.getInitializers(), p); return null; } @Override protected Void visitBinaryOperation(BinaryOperation binaryOpExpr, P p) { visit(binaryOpExpr.getLeft(), p); visit(binaryOpExpr.getRight(), p); return null; } @Override protected Void visitClassName(ClassName classNameExpr, P p) { return null; } @Override protected Void visitFormalParameter(FormalParameter parameterExpr, P p) { return null; } @Override protected Void visitFieldAccess(FieldAccess fieldAccessExpr, P p) { visit(fieldAccessExpr.getReceiver(), p); return null; } @Override protected Void visitLocalVariable(LocalVariable localVarExpr, P p) { return null; } @Override protected Void visitMethodCall(MethodCall methodCallExpr, P p) { visit(methodCallExpr.getReceiver(), p); scan(methodCallExpr.getArguments(), p); return null; } @Override protected Void visitThisReference(ThisReference thisExpr, P p) { return null; } @Override protected Void visitSuperReference(SuperReference superExpr, P p) { return null; } @Override protected Void visitUnaryOperation(UnaryOperation unaryOpExpr, P p) { visit(unaryOpExpr.getOperand(), p); return null; } @Override protected Void visitUnknown(Unknown unknownExpr, P p) { return null; } @Override protected Void visitValueLiteral(ValueLiteral literalExpr, P p) { return null; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy