Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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 /// 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 [....], [....] //--------------------------------------------------------------------- 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
- ListBoxItemAutomationPeer.cs
- Thumb.cs
- TargetConverter.cs
- _ChunkParse.cs
- AsynchronousChannelMergeEnumerator.cs
- DataGridViewMethods.cs
- VariableQuery.cs
- PingOptions.cs
- ContactManager.cs
- StsCommunicationException.cs
- ScrollableControlDesigner.cs
- StringValueSerializer.cs
- KnowledgeBase.cs
- DetailsViewUpdatedEventArgs.cs
- ObjectStateFormatter.cs
- ThreadAbortException.cs
- LoginStatusDesigner.cs
- MenuBindingsEditorForm.cs
- VerticalAlignConverter.cs
- CollectionMarkupSerializer.cs
- BitmapMetadata.cs
- DeferredSelectedIndexReference.cs
- PropertyFilter.cs
- DataGridViewColumnTypePicker.cs
- CodeArrayIndexerExpression.cs
- ResourceBinder.cs
- NavigatingCancelEventArgs.cs
- SrgsItemList.cs
- InputLanguageEventArgs.cs
- TextParentUndoUnit.cs
- Freezable.cs
- DBCSCodePageEncoding.cs
- HtmlWindowCollection.cs
- WSSecurityTokenSerializer.cs
- CompilerTypeWithParams.cs
- Gdiplus.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- SinglePageViewer.cs
- NativeMsmqMessage.cs
- TextTreeRootTextBlock.cs
- ControlCachePolicy.cs
- GridViewItemAutomationPeer.cs
- XmlWhitespace.cs
- AudioStateChangedEventArgs.cs
- ColorConvertedBitmap.cs
- PriorityBinding.cs
- DataPagerFieldCommandEventArgs.cs
- PassportAuthenticationEventArgs.cs
- X509Certificate2Collection.cs
- DefaultMemberAttribute.cs
- ResourceSetExpression.cs
- Compilation.cs
- XmlSignatureManifest.cs
- CodeValidator.cs
- NumericUpDown.cs
- Int32Collection.cs
- HierarchicalDataBoundControl.cs
- FaultPropagationQuery.cs
- InstanceLockLostException.cs
- TemplateKeyConverter.cs
- VectorValueSerializer.cs
- MobileCapabilities.cs
- HttpProcessUtility.cs
- TreePrinter.cs
- MTConfigUtil.cs
- HwndMouseInputProvider.cs
- ChildDocumentBlock.cs
- ToolStripContainer.cs
- XamlRtfConverter.cs
- CursorConverter.cs
- ClientOptions.cs
- HostedTransportConfigurationManager.cs
- CommandID.cs
- TemplateNameScope.cs
- OrderingQueryOperator.cs
- BooleanKeyFrameCollection.cs
- DynamicPropertyHolder.cs
- ExpressionNormalizer.cs
- CodeDefaultValueExpression.cs
- Misc.cs
- TileModeValidation.cs
- DSACryptoServiceProvider.cs
- SendActivityValidator.cs
- EntityProviderFactory.cs
- Serializer.cs
- ComponentDispatcher.cs
- SoapFaultCodes.cs
- FreezableCollection.cs
- Path.cs
- OleDbDataReader.cs
- LocalizableResourceBuilder.cs
- DiscoveryVersion.cs
- HtmlTableRow.cs
- HtmlTableRow.cs
- Subtract.cs
- ToolConsole.cs
- Selector.cs
- EntityDataSourceQueryBuilder.cs
- _UriSyntax.cs
- EnumMember.cs