예제 #1
0
    def execute(self, environment):
        if self.isBlock:
            op = operation.Ternary(
                self.temp,
                self.exp1,
                self.exp2,
                self.exp3,
                self.operator,
                self.row,
                self.column,
            )
            return op.execute(environment)

        c3d = ""
        val1 = self.exp1.execute(environment)
        c3d += val1.temp
        c3d += " " + operators.get(self.operator, self.operator) + " "
        val2 = self.exp2.execute(environment)
        c3d += val2.temp
        c3d += " AND "
        val3 = self.exp3.execute(environment)
        c3d += val3.temp
        return C3D(val1.value + val2.value + val3.value, c3d, self.row, self.column)
예제 #2
0
def TernaryOperation(temp, exp1, exp2, exp3, operator, row, column):
    return operation.Ternary(temp, exp1, exp2, exp3, operator, row, column)