AstNode.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 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / DataEntity / System / Data / Common / EntitySql / AstNode.cs / 1 / AstNode.cs

                            //---------------------------------------------------------------------- 
// 
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// 
// 
// @owner [....] [....]
//--------------------------------------------------------------------- 
 

namespace System.Data.Common.EntitySql 
{
    using System;
    using System.Globalization;
    using System.Collections; 
    using System.Collections.Generic;
 
    ///  
    /// Represents the astnode error context.
    ///  
    internal class ErrorContext
    {
        /// 
        /// represents the start position of the ast node element in the input stream 
        /// 
        internal int InputPosition = -1; 
 
        /// 
        /// represents the additional/contextual information related to the ast node 
        /// 
        internal string ErrorContextInfo;

        ///  
        /// defines how ErrorContextInfo should be interpreted
        ///  
        internal bool UseContextInfoAsResourceIdentifier = true; 

        ///  
        /// represents a referece to the original input query text
        /// 
        internal string QueryText;
    } 

 
    ///  
    /// Represents base class for nodes in the Abstract Syntax Tree
    ///  
    internal abstract class AstNode
    {
        private ErrorContext _errCtx = new ErrorContext();
 
        internal AstNode() { }
 
        internal AstNode( string query, int inputPosition ) 
        {
            _errCtx.QueryText = query; 
            _errCtx.InputPosition = inputPosition;
        }

        ///  
        /// Returns the AstNode error context.
        ///  
        internal ErrorContext ErrCtx 
        {
            get { return _errCtx; } 
            set { _errCtx = value; }
        }

    } 

} 
 

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

namespace System.Data.Common.EntitySql 
{
    using System;
    using System.Globalization;
    using System.Collections; 
    using System.Collections.Generic;
 
    ///  
    /// Represents the astnode error context.
    ///  
    internal class ErrorContext
    {
        /// 
        /// represents the start position of the ast node element in the input stream 
        /// 
        internal int InputPosition = -1; 
 
        /// 
        /// represents the additional/contextual information related to the ast node 
        /// 
        internal string ErrorContextInfo;

        ///  
        /// defines how ErrorContextInfo should be interpreted
        ///  
        internal bool UseContextInfoAsResourceIdentifier = true; 

        ///  
        /// represents a referece to the original input query text
        /// 
        internal string QueryText;
    } 

 
    ///  
    /// Represents base class for nodes in the Abstract Syntax Tree
    ///  
    internal abstract class AstNode
    {
        private ErrorContext _errCtx = new ErrorContext();
 
        internal AstNode() { }
 
        internal AstNode( string query, int inputPosition ) 
        {
            _errCtx.QueryText = query; 
            _errCtx.InputPosition = inputPosition;
        }

        ///  
        /// Returns the AstNode error context.
        ///  
        internal ErrorContext ErrCtx 
        {
            get { return _errCtx; } 
            set { _errCtx = value; }
        }

    } 

} 
 

// 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