Code:
                         / Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / DataEntity / System / Data / SqlClient / SqlGen / SymbolTable.cs / 2 / SymbolTable.cs
                        
                        
                            //---------------------------------------------------------------------- 
// 
//      Copyright (c) Microsoft Corporation.  All rights reserved.
//  
// 
// @owner  [....], [....]
//--------------------------------------------------------------------- 
 
using System;
using System.Collections.Generic; 
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Data.SqlClient; 
using System.Data.Metadata.Edm;
using System.Data.Common.CommandTrees; 
 
namespace System.Data.SqlClient.SqlGen
{ 
    /// 
    /// The symbol table is quite primitive - it is a stack with a new entry for
    /// each scope.  Lookups search from the top of the stack to the bottom, until
    /// an entry is found. 
    ///
    /// The symbols are of the following kinds 
    ///  
    /// /////////
///
    /// Symbols represent names  
    internal sealed class SymbolTable 
    {
        private List> symbols = new List>(); 
        internal void EnterScope()
        {
            symbols.Add(new Dictionary(StringComparer.OrdinalIgnoreCase)); 
        }
 
        internal void ExitScope() 
        {
            symbols.RemoveAt(symbols.Count - 1); 
        }
        internal void Add(string name, Symbol value)
        { 
            symbols[symbols.Count - 1][name] = value;
        } 
 
        internal Symbol Lookup(string name)
        { 
            for (int i = symbols.Count - 1; i >= 0; --i)
            {
                if (symbols[i].ContainsKey(name))
                { 
                    return symbols[i][name];
                } 
            } 
            return null; 
        }
    }
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//---------------------------------------------------------------------- 
// 
//      Copyright (c) Microsoft Corporation.  All rights reserved.
//  
// 
// @owner  [....], [....]
//--------------------------------------------------------------------- 
 
using System;
using System.Collections.Generic; 
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Data.SqlClient; 
using System.Data.Metadata.Edm;
using System.Data.Common.CommandTrees; 
 
namespace System.Data.SqlClient.SqlGen
{ 
    /// 
    /// The symbol table is quite primitive - it is a stack with a new entry for
    /// each scope.  Lookups search from the top of the stack to the bottom, until
    /// an entry is found. 
    ///
    /// The symbols are of the following kinds 
    ///  
    /// /////////
///
    /// Symbols represent names  
    internal sealed class SymbolTable 
    {
        private List> symbols = new List>(); 
        internal void EnterScope()
        {
            symbols.Add(new Dictionary(StringComparer.OrdinalIgnoreCase)); 
        }
 
        internal void ExitScope() 
        {
            symbols.RemoveAt(symbols.Count - 1); 
        }
        internal void Add(string name, Symbol value)
        { 
            symbols[symbols.Count - 1][name] = value;
        } 
 
        internal Symbol Lookup(string name)
        { 
            for (int i = symbols.Count - 1; i >= 0; --i)
            {
                if (symbols[i].ContainsKey(name))
                { 
                    return symbols[i][name];
                } 
            } 
            return null; 
        }
    }
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
                              
                        
                        
                        
                    Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SpeechAudioFormatInfo.cs
- DocComment.cs
- AmbientProperties.cs
- FrameworkObject.cs
- PEFileEvidenceFactory.cs
- DocumentScope.cs
- PartialCachingControl.cs
- ListParagraph.cs
- HitTestResult.cs
- DetailsViewInsertEventArgs.cs
- DataControlField.cs
- EventSourceCreationData.cs
- XmlCodeExporter.cs
- SyndicationContent.cs
- HttpCapabilitiesBase.cs
- Content.cs
- Sequence.cs
- FtpWebRequest.cs
- NativeMethodsOther.cs
- LinqDataSourceValidationException.cs
- MD5HashHelper.cs
- DbConnectionPoolOptions.cs
- ComEventsInfo.cs
- SqlNotificationRequest.cs
- OleDbReferenceCollection.cs
- ShapingEngine.cs
- RightsManagementEncryptedStream.cs
- RectangleGeometry.cs
- AdornerDecorator.cs
- Context.cs
- SqlConnectionHelper.cs
- StateWorkerRequest.cs
- HttpValueCollection.cs
- BindStream.cs
- RootDesignerSerializerAttribute.cs
- ToolboxBitmapAttribute.cs
- XmlRawWriter.cs
- RoutingTable.cs
- Container.cs
- DetailsViewPagerRow.cs
- securestring.cs
- OdbcConnectionString.cs
- GiveFeedbackEventArgs.cs
- Internal.cs
- StorageEntityContainerMapping.cs
- DataGridViewComboBoxEditingControl.cs
- WebPartUserCapability.cs
- ClientFormsAuthenticationCredentials.cs
- DataGridTablesFactory.cs
- QilTargetType.cs
- XsltSettings.cs
- CallbackCorrelationInitializer.cs
- AssemblyHash.cs
- SortDescriptionCollection.cs
- IndexExpression.cs
- DataTableNameHandler.cs
- ClonableStack.cs
- AttachmentService.cs
- SafeHGlobalHandleCritical.cs
- DesignerActionPropertyItem.cs
- CodeVariableReferenceExpression.cs
- SerializableAuthorizationContext.cs
- HttpHandlerAction.cs
- ArraySegment.cs
- ConsoleCancelEventArgs.cs
- WriteableBitmap.cs
- XmlImplementation.cs
- XmlTextEncoder.cs
- RotationValidation.cs
- AnnotationResourceCollection.cs
- SinglePageViewer.cs
- PixelFormat.cs
- CurrentChangingEventManager.cs
- MessageQueueKey.cs
- StrokeSerializer.cs
- DataPagerFieldCollection.cs
- GridViewCellAutomationPeer.cs
- DebugView.cs
- XmlAnyAttributeAttribute.cs
- RotateTransform3D.cs
- RequestSecurityTokenResponseCollection.cs
- SqlMethodAttribute.cs
- Transform3D.cs
- SqlDataSourceCustomCommandPanel.cs
- DataGridViewComboBoxCell.cs
- DtdParser.cs
- SerializationBinder.cs
- WebSysDefaultValueAttribute.cs
- CommandValueSerializer.cs
- StreamGeometry.cs
- ServiceDiscoveryBehavior.cs
- Internal.cs
- BitStack.cs
- ScaleTransform.cs
- AssociationSetMetadata.cs
- WindowsSecurityToken.cs
- ping.cs
- MouseOverProperty.cs
- Path.cs
- InlineObject.cs