Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / SqlClient / SqlGen / SymbolTable.cs / 1305376 / SymbolTable.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- 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 /// internal sealed class SymbolTable { private List///
/// /// Symbols represent names- ///
represents tables (extents/nested selects/unnests) - ///
represents Join nodes - ///
columns. to be resolved, /// or things to be renamed. /// > 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 [....] // @backupOwner [....] //--------------------------------------------------------------------- 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 /// internal sealed class SymbolTable { private List///
/// /// Symbols represent names- ///
represents tables (extents/nested selects/unnests) - ///
represents Join nodes - ///
columns. to be resolved, /// or things to be renamed. /// > 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
- File.cs
- ContextMarshalException.cs
- ScriptResourceInfo.cs
- ErrorFormatterPage.cs
- StreamReader.cs
- DataTemplateSelector.cs
- TreeIterator.cs
- NetworkStream.cs
- DataSet.cs
- ChooseAction.cs
- FontFamilyIdentifier.cs
- MessageSecurityOverHttpElement.cs
- CheckedListBox.cs
- AssertFilter.cs
- _emptywebproxy.cs
- CngUIPolicy.cs
- DnsPermission.cs
- ParallelDesigner.cs
- EntityDataSourceDesignerHelper.cs
- TreeWalkHelper.cs
- ResourceDictionary.cs
- PackagePart.cs
- WindowAutomationPeer.cs
- _ChunkParse.cs
- EnumUnknown.cs
- FontResourceCache.cs
- DBDataPermission.cs
- VisualTreeUtils.cs
- Deflater.cs
- FactoryRecord.cs
- LoopExpression.cs
- FilterableData.cs
- DbDataRecord.cs
- BitmapEffectGroup.cs
- BasePattern.cs
- ContentElement.cs
- UInt32.cs
- DetailsViewPageEventArgs.cs
- MouseGesture.cs
- URL.cs
- BStrWrapper.cs
- TemplateKey.cs
- BasicHttpSecurityElement.cs
- DefaultProxySection.cs
- EntityDesignerDataSourceView.cs
- CollectionViewSource.cs
- Pen.cs
- XmlSchemaCompilationSettings.cs
- ToolStripGripRenderEventArgs.cs
- WindowsRebar.cs
- RotationValidation.cs
- SocketAddress.cs
- HandledMouseEvent.cs
- TimerEventSubscriptionCollection.cs
- FixUp.cs
- ResourceKey.cs
- ContentIterators.cs
- ExecutedRoutedEventArgs.cs
- MailMessage.cs
- DataPagerCommandEventArgs.cs
- QueryStringParameter.cs
- CustomWebEventKey.cs
- DataSourceHelper.cs
- Cell.cs
- HtmlHistory.cs
- GlobalizationSection.cs
- CodeAccessPermission.cs
- XamlReader.cs
- ConfigurationSchemaErrors.cs
- PreloadedPackages.cs
- LinqDataSourceValidationException.cs
- ModuleBuilder.cs
- ConstructorBuilder.cs
- GenericXmlSecurityToken.cs
- AttributeSetAction.cs
- Debug.cs
- ReferentialConstraintRoleElement.cs
- InputProviderSite.cs
- OdbcParameter.cs
- MouseActionConverter.cs
- ExceptionUtil.cs
- DataBinding.cs
- StructuralCache.cs
- ServiceHostFactory.cs
- CrossSiteScriptingValidation.cs
- WebControlAdapter.cs
- EventProviderBase.cs
- DropSource.cs
- HttpVersion.cs
- DataGridCell.cs
- DbProviderSpecificTypePropertyAttribute.cs
- CompositeFontParser.cs
- StreamInfo.cs
- AppSettingsReader.cs
- PolyLineSegment.cs
- AppDomainProtocolHandler.cs
- MetadataHelper.cs
- TransformationRules.cs
- SiteMapProvider.cs
- ReleaseInstanceMode.cs