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
- BinaryFormatterWriter.cs
- WorkflowMessageEventArgs.cs
- TypeBuilder.cs
- DataGridViewRowEventArgs.cs
- GridViewAutomationPeer.cs
- CellParaClient.cs
- Rectangle.cs
- DataGridSortCommandEventArgs.cs
- XmlSchemas.cs
- WebPartEventArgs.cs
- GradientSpreadMethodValidation.cs
- OleDbEnumerator.cs
- SmtpMail.cs
- GraphicsContainer.cs
- QueryCreatedEventArgs.cs
- ColorBuilder.cs
- MessageQueueCriteria.cs
- XamlSerializerUtil.cs
- CachedPathData.cs
- Int16Animation.cs
- ReferencedCollectionType.cs
- ContextMenuStrip.cs
- CodeComment.cs
- DataListItemEventArgs.cs
- RSACryptoServiceProvider.cs
- BuildDependencySet.cs
- InstanceLockTracking.cs
- PowerModeChangedEventArgs.cs
- PopupControlService.cs
- DataSourceView.cs
- _CacheStreams.cs
- DataGridViewRowHeaderCell.cs
- InkCollectionBehavior.cs
- Rules.cs
- DataAdapter.cs
- HiddenField.cs
- Table.cs
- ToolTipAutomationPeer.cs
- FileDataSourceCache.cs
- CharEnumerator.cs
- SingleAnimation.cs
- DataListItem.cs
- MetadataCacheItem.cs
- Native.cs
- Filter.cs
- CqlGenerator.cs
- GPStream.cs
- DodSequenceMerge.cs
- TextEvent.cs
- SystemIcmpV4Statistics.cs
- SqlConnectionHelper.cs
- CharAnimationUsingKeyFrames.cs
- DataGridSortCommandEventArgs.cs
- CreateDataSourceDialog.cs
- RegisteredArrayDeclaration.cs
- DrawToolTipEventArgs.cs
- InputProviderSite.cs
- TimeZone.cs
- XmlNodeChangedEventArgs.cs
- RelationshipEnd.cs
- IntegerValidatorAttribute.cs
- WebSysDescriptionAttribute.cs
- CodeDOMUtility.cs
- PropertyMappingExceptionEventArgs.cs
- dbenumerator.cs
- DataRow.cs
- OperatingSystemVersionCheck.cs
- OdbcConnectionOpen.cs
- _SSPISessionCache.cs
- SyntaxCheck.cs
- sortedlist.cs
- ObjectSet.cs
- XsltFunctions.cs
- _NetworkingPerfCounters.cs
- Normalization.cs
- Visitor.cs
- HttpApplicationFactory.cs
- DependencyObjectPropertyDescriptor.cs
- ServiceBuildProvider.cs
- SqlTypeSystemProvider.cs
- CryptoHelper.cs
- IntSecurity.cs
- HiddenField.cs
- DurableErrorHandler.cs
- RegionIterator.cs
- Exception.cs
- XmlSubtreeReader.cs
- XmlDomTextWriter.cs
- XmlWrappingReader.cs
- TypeBrowserDialog.cs
- Timer.cs
- DbConnectionPoolOptions.cs
- WindowsIdentity.cs
- HandlerBase.cs
- StylusButtonCollection.cs
- webeventbuffer.cs
- LogLogRecordEnumerator.cs
- TypeUtil.cs
- SecurityUtils.cs
- ListViewItemSelectionChangedEvent.cs