private ITES5Value ConvertExpression(ITES4BinaryExpression expression, TES5CodeScope codeScope, TES5GlobalScope globalScope, TES5MultipleScriptsScope multipleScriptsScope) { TES5ComparisonExpressionOperator?ceOp = TES5ComparisonExpressionOperator.GetFirstOrNull(expression.Operator.Name); if (ceOp != null) { return(this.ConvertComparisonExpression(expression, codeScope, globalScope, multipleScriptsScope)); } TES5LogicalExpressionOperator?leOp = TES5LogicalExpressionOperator.GetFirstOrNull(expression.Operator.Name); if (leOp != null) { return(TES5ExpressionFactory.CreateLogicalExpression(this.CreateValue(expression.LeftValue, codeScope, globalScope, multipleScriptsScope), leOp, this.CreateValue(expression.RightValue, codeScope, globalScope, multipleScriptsScope))); } TES5ArithmeticExpressionOperator?aeOp = TES5ArithmeticExpressionOperator.GetFirstOrNull(expression.Operator.Name); if (aeOp != null) { return(TES5ExpressionFactory.CreateArithmeticExpression(this.CreateValue(expression.LeftValue, codeScope, globalScope, multipleScriptsScope), aeOp, this.CreateValue(expression.RightValue, codeScope, globalScope, multipleScriptsScope))); } throw new ConversionException("Unknown expression op: " + expression.Operator.Name); }
public static TES5ArithmeticExpression CreateArithmeticExpression(ITES5Value left, TES5ArithmeticExpressionOperator op, ITES5Value right) { return(new TES5ArithmeticExpression(left, op, right)); }