Ejemplo n.º 1
0
        /// <summary>
        /// Reads the next continue-statement from the file and returns it.
        /// </summary>
        /// <param name="parentReference">
        /// The parent code unit.
        /// </param>
        /// <returns>
        /// Returns the statement.
        /// </returns>
        private ContinueStatement ParseContinueStatement(Reference<ICodePart> parentReference)
        {
            Param.AssertNotNull(parentReference, "parentReference");
            Reference<ICodePart> statementReference = new Reference<ICodePart>();

            // Move past the continue keyword.
            CsToken firstToken = this.GetToken(CsTokenType.Continue, SymbolType.Continue, parentReference, statementReference);
            Node<CsToken> firstTokenNode = this.tokens.InsertLast(firstToken);

            // Get the closing semicolon.
            this.tokens.Add(this.GetToken(CsTokenType.Semicolon, SymbolType.Semicolon, statementReference));

            // Create the token list for the statement.
            CsTokenList partialTokens = new CsTokenList(this.tokens, firstTokenNode, firstTokenNode);

            // Create and return the continue-statement.
            ContinueStatement statement = new ContinueStatement(partialTokens);
            statementReference.Target = statement;

            return statement;
        }
 /// <summary>
 /// The save.
 /// </summary>
 /// <param name="continueStatement">
 /// The continue statement.
 /// </param>
 private void Save(ContinueStatement continueStatement)
 {
     this.cppWriter.Write("continue");
 }