Subset.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Speech / Src / Internal / SrgsCompiler / Subset.cs / 1 / Subset.cs

                            //------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
//----------------------------------------------------------------- 

#region Using directives 
 
using System;
using System.Speech.Internal.SrgsParser; 

#endregion

namespace System.Speech.Internal.SrgsCompiler 
{
    internal class Subset : ParseElement, ISubset 
    { 
        //*******************************************************************
        // 
        // Constructors
        //
        //*******************************************************************
 
        #region Constructors
 
        ///  
        /// Process the 'subset' element.
        ///  
        /// 
        /// 
        /// 
        ///  
        public Subset (ParseElementCollection parent, Backend backend, string text, MatchMode mode)
            : base (parent._rule) 
        { 
            // replace tab, cr, lf with spaces
            foreach (char ch in Helpers._achTrimChars) 
            {
                if (ch == ' ')
                {
                    continue; 
                }
                if (text.IndexOf (ch) >= 0) 
                { 
                    text = text.Replace (ch, ' ');
                } 
            }

            // Add transition to the new state with normalized token.
            parent.AddArc (backend.SubsetTransition (text, mode)); 
        }
 
        #endregion 

        //******************************************************************** 
        //
        // Internal Method
        //
        //******************************************************************* 

        #region Intenal Method 
 
        /// 
        ///  
        /// 
        void IElement.PostParse (IElement parentElement)
        {
        } 

        #endregion 
    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
//----------------------------------------------------------------- 

#region Using directives 
 
using System;
using System.Speech.Internal.SrgsParser; 

#endregion

namespace System.Speech.Internal.SrgsCompiler 
{
    internal class Subset : ParseElement, ISubset 
    { 
        //*******************************************************************
        // 
        // Constructors
        //
        //*******************************************************************
 
        #region Constructors
 
        ///  
        /// Process the 'subset' element.
        ///  
        /// 
        /// 
        /// 
        ///  
        public Subset (ParseElementCollection parent, Backend backend, string text, MatchMode mode)
            : base (parent._rule) 
        { 
            // replace tab, cr, lf with spaces
            foreach (char ch in Helpers._achTrimChars) 
            {
                if (ch == ' ')
                {
                    continue; 
                }
                if (text.IndexOf (ch) >= 0) 
                { 
                    text = text.Replace (ch, ' ');
                } 
            }

            // Add transition to the new state with normalized token.
            parent.AddArc (backend.SubsetTransition (text, mode)); 
        }
 
        #endregion 

        //******************************************************************** 
        //
        // Internal Method
        //
        //******************************************************************* 

        #region Intenal Method 
 
        /// 
        ///  
        /// 
        void IElement.PostParse (IElement parentElement)
        {
        } 

        #endregion 
    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.

                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK