use of abs.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;
}
use of abs.frontend.ast.VarDecl in project abstools by abstools.
the class InferMain method shouldBeConsidered.
private boolean shouldBeConsidered(LocationTypeVariable ltv) {
ASTNode<?> node = ltv.getNode();
Decl contextDecl = node.getContextDecl();
if (contextDecl != null) {
// Don't print interface annotations in "implements/extends" clauses:
if (node instanceof InterfaceTypeUse && (contextDecl instanceof ClassDecl || contextDecl instanceof InterfaceDecl))
return false;
if (contextDecl.isClass() && !config.contains(Config.CLASSES))
return false;
if (contextDecl.isInterface() && !config.contains(Config.INTERFACES))
return false;
if (contextDecl.isFunction() && !config.contains(Config.FUNCTIONS))
return false;
}
if (node instanceof VarDecl && !config.contains(Config.LOCAL_VAR_DECLS))
return false;
if (node instanceof FieldDecl && !config.contains(Config.FIELDS))
return false;
if (ltv.getAnnotatedType() != null) {
return false;
}
return true;
}
Aggregations