/// <summary>
        /// Reads a primary increment expression.
        /// </summary>
        /// <param name="leftHandSide">The expression on the left hand side of the operator.</param>
        /// <param name="previousPrecedence">The precedence of the expression just before this one.</param>
        /// <returns>Returns the expression.</returns>
        private IncrementExpression GetPrimaryIncrementExpression(
            Expression leftHandSide, ExpressionPrecedence previousPrecedence)
        {
            Param.AssertNotNull(leftHandSide, "leftHandSide");
            Param.Ignore(previousPrecedence);

            IncrementExpression expression = null;

            // Check the previous precedence to see if we are allowed to gather up the as expression.
            if (CheckPrecedence(previousPrecedence, ExpressionPrecedence.Primary))
            {
                var expressionReference = new Reference<ICodePart>();

                // Make sure the left hand side has at least one token.
                Debug.Assert(leftHandSide.Tokens.First != null, "The left hand side should not be empty.");

                // Get the increment symbol.
                this.tokens.Add(this.GetOperatorToken(OperatorType.Increment, expressionReference));

                // Create the partial token list for the expression.
                CsTokenList partialTokens = new CsTokenList(this.tokens, leftHandSide.Tokens.First, this.tokens.Last);

                // Create and return the expression.
                expression = new IncrementExpression(partialTokens, leftHandSide, IncrementExpression.IncrementType.Postfix);
                expressionReference.Target = expression;
            }

            return expression;
        }
        /// <summary>
        /// Reads a unary increment expression.
        /// </summary>
        /// <param name="unsafeCode">Indicates whether the code being parsed resides in an unsafe code block.</param>
        /// <returns>Returns the expression.</returns>
        private IncrementExpression GetUnaryIncrementExpression(bool unsafeCode)
        {
            Param.Ignore(unsafeCode);

            var expressionReference = new Reference<ICodePart>();

            // Get the increment symbol.
            Node<CsToken> tokenNode = this.tokens.InsertLast(this.GetOperatorToken(OperatorType.Increment, expressionReference));

            // Get the expression being incremented.
            Expression valueExpression = this.GetNextExpression(ExpressionPrecedence.Unary, expressionReference, unsafeCode);
            if (valueExpression == null || valueExpression.Tokens.First == null)
            {
                throw this.CreateSyntaxException();
            }

            // Create the partial token list for the expression.
            CsTokenList partialTokens = new CsTokenList(this.tokens, tokenNode, this.tokens.Last);

            // Create and return the expression.
            var expression = new IncrementExpression(partialTokens, valueExpression, IncrementExpression.IncrementType.Prefix);
            expressionReference.Target = expression;

            return expression;
        }
 private IncrementExpression GetPrimaryIncrementExpression(Expression leftHandSide, ExpressionPrecedence previousPrecedence)
 {
     IncrementExpression expression = null;
     if (CheckPrecedence(previousPrecedence, ExpressionPrecedence.Primary))
     {
         this.tokens.Add(this.GetOperatorToken(OperatorType.Increment));
         CsTokenList tokens = new CsTokenList(this.tokens, leftHandSide.Tokens.First, this.tokens.Last);
         expression = new IncrementExpression(tokens, leftHandSide, IncrementExpression.IncrementType.Postfix);
     }
     return expression;
 }