Package io.codemodder.ast
Class LocalScope
java.lang.Object
io.codemodder.ast.LocalScope
Contains the expressions and statements that span the scope of a local declaration. See Java Language
Specification - Section 6.3 for how the scope of local declarations is defined. The
nodelists are ordered and the nodes in
expressions happens before the ones in
statements.-
Method Summary
Modifier and TypeMethodDescriptionstatic LocalScopefromForDeclaration(com.github.javaparser.ast.stmt.ForStmt stmt, com.github.javaparser.ast.body.VariableDeclarator vd) Calculates the scope of a local declaration in aForStmt.static LocalScopefromForEachDeclaration(com.github.javaparser.ast.stmt.ForEachStmt stmt) Calculates the scope of a local declaration in aForEachStmt.static LocalScopefromLocalDeclaration(com.github.javaparser.ast.stmt.ExpressionStmt stmt, com.github.javaparser.ast.body.VariableDeclarator vd) Calculates the scope of a local declaration in aExpressionStmt.static LocalScopefromParameter(com.github.javaparser.ast.body.Parameter parameter) Calculates the scope of a local declaration in aParameter.static LocalScopefromTryResource(com.github.javaparser.ast.stmt.TryStmt stmt, com.github.javaparser.ast.body.VariableDeclarator vd) Calculates the scope of a local declaration in aTryStmt.com.github.javaparser.ast.NodeList<com.github.javaparser.ast.expr.Expression>com.github.javaparser.ast.NodeList<com.github.javaparser.ast.stmt.Statement>booleaninScope(com.github.javaparser.ast.Node n) Returns true if and only ifnis contained inscopeStream<com.github.javaparser.ast.Node>stream()
-
Method Details
-
fromTryResource
public static LocalScope fromTryResource(com.github.javaparser.ast.stmt.TryStmt stmt, com.github.javaparser.ast.body.VariableDeclarator vd) Calculates the scope of a local declaration in aTryStmt. -
fromLocalDeclaration
public static LocalScope fromLocalDeclaration(com.github.javaparser.ast.stmt.ExpressionStmt stmt, com.github.javaparser.ast.body.VariableDeclarator vd) Calculates the scope of a local declaration in aExpressionStmt. -
fromForEachDeclaration
Calculates the scope of a local declaration in aForEachStmt. -
fromForDeclaration
public static LocalScope fromForDeclaration(com.github.javaparser.ast.stmt.ForStmt stmt, com.github.javaparser.ast.body.VariableDeclarator vd) Calculates the scope of a local declaration in aForStmt. -
fromParameter
Calculates the scope of a local declaration in aParameter. -
getExpressions
public com.github.javaparser.ast.NodeList<com.github.javaparser.ast.expr.Expression> getExpressions() -
getStatements
public com.github.javaparser.ast.NodeList<com.github.javaparser.ast.stmt.Statement> getStatements() -
stream
-
inScope
public boolean inScope(com.github.javaparser.ast.Node n) Returns true if and only ifnis contained inscope
-