package gw.rating.flow.domain uses gw.lang.reflect.IType uses java.lang.Integer uses gw.util.Pair abstract class CalcStepOperand { protected var _opType : CalcStepOperatorType as readonly OperatorType protected var _numberOfLeftParentheses: int as readonly LeftParenthesis protected var _numberOfRightParentheses: int as readonly RightParenthesis protected var _highlightElement : RateRoutineHighlightElement as readonly HighlightElement protected var _start : Pair as readonly Start protected var _end : Pair as readonly End property get CodeSize(): int { return 1 } construct(opType : CalcStepOperatorType, numLeft: int, numRight: int) { _opType = opType _numberOfLeftParentheses = numLeft _numberOfRightParentheses = numRight } abstract function getDataType(context: GenerationContext) : IType abstract property get OperandType() : CalcStepOperandType final function generate(context: GenerationContext) { _start = context.beginCodeGen() context.append("(".repeat(_numberOfLeftParentheses)) generateCode(context) context.append(")".repeat(_numberOfRightParentheses)) _end = context.endCodeGen() } abstract function generateCode(context: GenerationContext) }