public function convertExpression(TES4Expression $expression, TES5CodeScope $codeScope, TES5GlobalScope $globalScope, TES5MultipleScriptsScope $multipleScriptsScope) { $operator = TES5ArithmeticExpressionOperator::memberByValueWithDefault($expression->getOperator()->value(), null); if ($operator === null) { $operator = TES5LogicalExpressionOperator::memberByValueWithDefault($expression->getOperator()->value(), null); if ($operator === null) { $operator = TES5BinaryExpressionOperator::memberByValueWithDefault($expression->getOperator()->value(), null); if ($operator === null) { throw new ConversionException("Unknown expression operator"); } return $this->expressionFactory->createBinaryExpression($this->createValue($expression->getLeftValue(), $codeScope, $globalScope, $multipleScriptsScope), $operator, $this->createValue($expression->getRightValue(), $codeScope, $globalScope, $multipleScriptsScope)); } return $this->expressionFactory->createLogicalExpression($this->createValue($expression->getLeftValue(), $codeScope, $globalScope, $multipleScriptsScope), $operator, $this->createValue($expression->getRightValue(), $codeScope, $globalScope, $multipleScriptsScope)); } return $this->convertArithmeticExpression($expression, $codeScope, $globalScope, $multipleScriptsScope); }