use of org.abs_models.frontend.ast.VarDecl in project abstools by abstools.
the class VarResolutionTest method testLocalVar.
@Test
public void testLocalVar() {
Exp e = getSecondExp("interface I { } { I i = null; i = i; }");
VarUse u = (VarUse) e;
VarDecl decl = (VarDecl) u.getDecl();
assertEquals("i", decl.getName());
}
use of org.abs_models.frontend.ast.VarDecl in project abstools by abstools.
the class JavaGeneratorHelper method isLocalVarUse.
/**
* checks if astNode is a use of a local variable or parameter
*/
private static boolean isLocalVarUse(ASTNode<?> astNode) {
if (astNode instanceof VarUse) {
VarUse v = (VarUse) astNode;
VarOrFieldDecl decl = v.getDecl();
if (decl instanceof VarDecl || decl instanceof ParamDecl) {
return !(decl.getParent() instanceof LetExp);
}
}
return false;
}
Aggregations