use of net.taken.redsnake.tree.Variable in project redsnake by Taken0711.
the class IfTest method createIfWithAssignments.
private static If createIfWithAssignments(String variableName, boolean condition, int trueValue, int falseValue) {
Variable var = mockVariable(variableName);
Expression cond = mockExpression(new RedsBoolean(condition));
StatementList thenBody = new StatementList(ImmutableList.of(new Assignment(mockVariable(variableName), mockExpression(trueValue))));
StatementList elseBody = new StatementList(ImmutableList.of(new Assignment(mockVariable(variableName), mockExpression(falseValue))));
return new If(cond, thenBody, elseBody);
}
use of net.taken.redsnake.tree.Variable in project redsnake by Taken0711.
the class AssignmentTest method createAssignment.
public static Assignment createAssignment(String name, int value) {
Variable var = mockVariable(name);
Expression expr = mockExpression(value);
return new Assignment(var, expr);
}
Aggregations