end of prac3 no bonus
This commit is contained in:
@@ -34,7 +34,7 @@ public final class StdEnvironment {
|
||||
|
||||
public static ConstDeclaration falseDecl, trueDecl, maxintDecl;
|
||||
|
||||
public static UnaryOperatorDeclaration notDecl;
|
||||
public static UnaryOperatorDeclaration notDecl, barDecl;
|
||||
|
||||
public static BinaryOperatorDeclaration andDecl, orDecl, addDecl, subtractDecl, multiplyDecl, divideDecl,
|
||||
moduloDecl, equalDecl, unequalDecl, lessDecl, notlessDecl, greaterDecl, notgreaterDecl;
|
||||
@@ -43,4 +43,6 @@ public final class StdEnvironment {
|
||||
|
||||
public static FuncDeclaration chrDecl, ordDecl, eolDecl, eofDecl;
|
||||
|
||||
//public static Object barDecl;
|
||||
|
||||
}
|
||||
|
||||
@@ -953,6 +953,9 @@ public final class Checker implements ActualParameterVisitor<FormalParameter, Vo
|
||||
StdEnvironment.booleanType);
|
||||
StdEnvironment.notlessDecl = declareStdBinaryOp(">=", StdEnvironment.integerType, StdEnvironment.integerType,
|
||||
StdEnvironment.booleanType);
|
||||
|
||||
//PRAC3 # Here we are adding the barDecl, Unary op. that takes 1 val and returns 1 val
|
||||
StdEnvironment.barDecl = declareStdUnaryOp("|", StdEnvironment.integerType, StdEnvironment.integerType);
|
||||
|
||||
StdEnvironment.charDecl = declareStdType("Char", StdEnvironment.charType);
|
||||
StdEnvironment.chrDecl = declareStdFunc("chr",
|
||||
|
||||
@@ -162,7 +162,9 @@ public class LayoutVisitor implements ActualParameterVisitor<Void, DrawingTree>,
|
||||
|
||||
@Override
|
||||
public DrawingTree visitRepeatCommand(RepeatCommand ast, Void obj) {
|
||||
return null;
|
||||
var d1 = ast.E.visit(this);
|
||||
var d2 = ast.C.visit(this);
|
||||
return layoutBinary("RepeatCom.", d1, d2);
|
||||
}
|
||||
|
||||
// Expressions
|
||||
|
||||
Reference in New Issue
Block a user