From 33613a85afc4b1481367fbe92a17ee59c240250b Mon Sep 17 00:00:00 2001 From: Sven Eisenhauer Date: Fri, 10 Nov 2023 15:11:48 +0100 Subject: add new repo --- .../src/swa/prakt3/ArithmeticOperation.java | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 Master/Software Architektur/SWA_Prakt3/src/swa/prakt3/ArithmeticOperation.java (limited to 'Master/Software Architektur/SWA_Prakt3/src/swa/prakt3/ArithmeticOperation.java') diff --git a/Master/Software Architektur/SWA_Prakt3/src/swa/prakt3/ArithmeticOperation.java b/Master/Software Architektur/SWA_Prakt3/src/swa/prakt3/ArithmeticOperation.java new file mode 100755 index 0000000..fca2f9a --- /dev/null +++ b/Master/Software Architektur/SWA_Prakt3/src/swa/prakt3/ArithmeticOperation.java @@ -0,0 +1,28 @@ +package swa.prakt3; + +public abstract class ArithmeticOperation extends ArithmeticExpression{ + protected ArithmeticExpression operand1; + protected ArithmeticExpression operand2; + protected String operationSign; + public ArithmeticOperation(ArithmeticExpression operand1 + ,ArithmeticExpression operand2){ + this.operand1 = operand1; + this.operand2 = operand2; + this.type = ExprType.OPER; + } + public String getOperationSign() { + return operationSign; + } + public ArithmeticExpression getLeftOperand() { + return operand1; + } + public ArithmeticExpression getRightOperand() { + return operand2; + } + @Override + public Number accept(Visitor v, Iterator it) { + this.v = v; + return v.visit(this, it); + } + public abstract Number doOperation(Number op1, Number op2); +} -- cgit v1.2.3