import { OclExecutionContext } from '../OclExecutionContext' ; import { LeftRightBasedExpression } from './LeftRightBasedExpression' ; /**
 */ export class OperationCallExpression extends LeftRightBasedExpression { private readonly operator : Operator ; constructor ( operator , left , right ) { super ( left , right ) ; this . operator = operator ; } evaluate ( visitor , localVariables ? ) { const { left , right } = this . _evaluateLeftRightExpression ( visitor , localVariables ) ; switch ( this . operator ) { case Operator . NOT_EQUAL : return left !== right ; case Operator . EQUAL : return left === right ; case Operator . LESS_EQUAL_THAN : return left <= right ; case Operator . GREATER_EQUAL_THAN : return left >= right ; case Operator . GREATER_THAN : return left > right ; case Operator . LESS_THAN : return left < right ; } } private isOperator ( operator ) { return this . operator === operator ; } } export enum Operator { NOT_EQUAL = '<>' , LESS_EQUAL_THAN = '<=' , GREATER_EQUAL_THAN = '>=' , GREATER_THAN = '>' , LESS_THAN = '<' , EQUAL = '=' }