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
- SettingsPropertyIsReadOnlyException.cs
- LedgerEntryCollection.cs
- InputLanguageEventArgs.cs
- PartDesigner.cs
- Padding.cs
- AssociationSetEnd.cs
- WebUtil.cs
- HtmlTableRowCollection.cs
- LongValidatorAttribute.cs
- LinqDataSourceValidationException.cs
- DependencyPropertyValueSerializer.cs
- ScriptComponentDescriptor.cs
- ReadOnlyMetadataCollection.cs
- BaseCodeDomTreeGenerator.cs
- ContextInformation.cs
- SafeTokenHandle.cs
- CustomAssemblyResolver.cs
- HybridDictionary.cs
- KeyValuePair.cs
- EventLogTraceListener.cs
- SizeConverter.cs
- DomNameTable.cs
- AVElementHelper.cs
- Int32RectValueSerializer.cs
- XmlSchemaExternal.cs
- MarkupProperty.cs
- DataSourceDesigner.cs
- IntegerCollectionEditor.cs
- SchemaInfo.cs
- GeometryConverter.cs
- PointUtil.cs
- initElementDictionary.cs
- Int32Rect.cs
- CellParaClient.cs
- LongCountAggregationOperator.cs
- TextPattern.cs
- MethodCallTranslator.cs
- ReadOnlyHierarchicalDataSourceView.cs
- GeometryDrawing.cs
- HtmlEncodedRawTextWriter.cs
- DbConnectionPoolGroup.cs
- PromptEventArgs.cs
- ScriptRef.cs
- ToolStripOverflowButton.cs
- SendMailErrorEventArgs.cs
- EventItfInfo.cs
- MappingMetadataHelper.cs
- SoapTypeAttribute.cs
- ContainerVisual.cs
- PreviewKeyDownEventArgs.cs
- coordinatorfactory.cs
- DragDeltaEventArgs.cs
- SslStream.cs
- EntityDataSourceChangingEventArgs.cs
- QilNode.cs
- LinqDataSourceContextEventArgs.cs
- SqlDependencyUtils.cs
- CellQuery.cs
- DuplicateWaitObjectException.cs
- SmtpReplyReaderFactory.cs
- CompositeFontParser.cs
- StrokeNodeOperations2.cs
- Debugger.cs
- WebBrowserNavigatedEventHandler.cs
- HealthMonitoringSectionHelper.cs
- HwndKeyboardInputProvider.cs
- FieldAccessException.cs
- figurelength.cs
- Model3DGroup.cs
- Matrix.cs
- ImageFormatConverter.cs
- StrongNameKeyPair.cs
- InternalPolicyElement.cs
- DesignerActionVerbItem.cs
- MethodCallTranslator.cs
- ResetableIterator.cs
- FormatConvertedBitmap.cs
- CryptoApi.cs
- IsolatedStorageFileStream.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- LinearGradientBrush.cs
- AssociationTypeEmitter.cs
- SurrogateSelector.cs
- MatrixStack.cs
- FileDialogCustomPlace.cs
- SimpleBitVector32.cs
- SoapDocumentMethodAttribute.cs
- Vector3DCollectionValueSerializer.cs
- XmlUTF8TextReader.cs
- HijriCalendar.cs
- DataGridViewCell.cs
- PanelStyle.cs
- AsymmetricKeyExchangeFormatter.cs
- EncryptedType.cs
- CodeGen.cs
- SerializerDescriptor.cs
- jithelpers.cs
- mongolianshape.cs
- OutputCacheProfile.cs
- MenuItemAutomationPeer.cs