use of org.abs_models.frontend.ast.AssignStmt in project abstools by abstools.
the class FrontendTest method getTypeOfNthAssignment.
protected Type getTypeOfNthAssignment(Model m, int n) {
int count = 0;
for (Stmt s : m.getMainBlock().getStmts()) {
Type t = null;
if (s instanceof AssignStmt) {
AssignStmt as = (AssignStmt) s;
t = as.getValue().getType();
} else if (s instanceof VarDeclStmt) {
VarDeclStmt vd = (VarDeclStmt) s;
if (vd.getVarDecl().hasInitExp()) {
t = vd.getVarDecl().getInitExp().getType();
}
}
if (t != null) {
count++;
if (count == n) {
return t;
}
}
}
return null;
}
use of org.abs_models.frontend.ast.AssignStmt in project abstools by abstools.
the class AbsASTBuilderUtil method getVAssign.
public static final AssignStmt getVAssign(VarOrFieldUse v, Exp exp) {
AssignStmt s = new AssignStmt();
s.setVar(v);
s.setValue(exp);
return s;
}
Aggregations