public static string ToStatementString(this AssignmentOperator Operator)
        {
            switch (Operator)
            {
            case AssignmentOperator.Equals:
                return("=");

            case AssignmentOperator.PlusEquals:
                return("+=");

            case AssignmentOperator.MinusEquals:
                return("-=");

            case AssignmentOperator.MultEquals:
                return("*=");

            case AssignmentOperator.DivEquals:
                return("/=");

            case AssignmentOperator.none:
                return("");

            default:
                throw new ApplicationException("unsupported enum " + Operator.ToString());
            }
        }
Пример #2
0
        public override string ToString()
        {
            var sb = new StringBuilder("Assignment->");

            sb.Append(derefVariable.ToString());
            sb.Append(assignmentOperator.ToString());
            sb.Append(expression.ToString());
            sb.Append("\n");
            return(sb.ToString());
        }
Пример #3
0
        private static BinaryExpressionOperator AssignmentToBinary(AssignmentOperator pOp)
        {
            switch (pOp)
            {
            case AssignmentOperator.AdditionEquals:
                return(BinaryExpressionOperator.Addition);

            case AssignmentOperator.ConcatEquals:
                throw new NotSupportedException();

            case AssignmentOperator.DivisionEquals:
                return(BinaryExpressionOperator.Division);

            case AssignmentOperator.MultiplyEquals:
                return(BinaryExpressionOperator.Multiplication);

            case AssignmentOperator.SubtractionEquals:
                return(BinaryExpressionOperator.Subtraction);

            default:
                throw new NotSupportedException("Assignment operator does not map to binary operator " + pOp.ToString());
            }
        }