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
///
/// represents tables (extents/nested selects/unnests)
/// represents Join nodes
/// columns.
///
///
/// Symbols represent names to be resolved,
/// or things to be renamed.
///
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
///
/// represents tables (extents/nested selects/unnests)
/// represents Join nodes
/// columns.
///
///
/// Symbols represent names to be resolved,
/// or things to be renamed.
///
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
- HostedHttpContext.cs
- CellTreeNode.cs
- SQLInt32.cs
- VariableQuery.cs
- TransformerInfoCollection.cs
- Int32CAMarshaler.cs
- EncoderBestFitFallback.cs
- RepeaterItemEventArgs.cs
- ExtensionFile.cs
- SecurityHelper.cs
- HttpDateParse.cs
- Membership.cs
- RtfControls.cs
- OracleBFile.cs
- MultiSelector.cs
- ToolBar.cs
- PopupEventArgs.cs
- GatewayIPAddressInformationCollection.cs
- GreenMethods.cs
- XmlEntityReference.cs
- CurrencyManager.cs
- WindowsToolbarAsMenu.cs
- validation.cs
- CodePropertyReferenceExpression.cs
- InvokePattern.cs
- DataError.cs
- XmlSchemaSequence.cs
- SchemaElementDecl.cs
- ItemCollection.cs
- _AcceptOverlappedAsyncResult.cs
- ToolStripContentPanel.cs
- SmtpClient.cs
- ImageBrush.cs
- MobileUserControlDesigner.cs
- DragDeltaEventArgs.cs
- ContextProperty.cs
- ToolStripContentPanel.cs
- DeclarativeCatalogPart.cs
- MetadataPropertyAttribute.cs
- KeyPullup.cs
- SequentialWorkflowHeaderFooter.cs
- InstanceDataCollection.cs
- connectionpool.cs
- PageTheme.cs
- GridViewColumnHeaderAutomationPeer.cs
- ForEach.cs
- Point3DValueSerializer.cs
- SecurityContext.cs
- FixedSOMFixedBlock.cs
- NumericUpDownAccelerationCollection.cs
- QilStrConcatenator.cs
- BitmapSource.cs
- EntityContainerEntitySet.cs
- DataRecordInfo.cs
- SimpleTextLine.cs
- DictionaryEntry.cs
- QueryableDataSourceEditData.cs
- AppLevelCompilationSectionCache.cs
- CodeCompiler.cs
- TextChange.cs
- ApplicationFileCodeDomTreeGenerator.cs
- WebPartExportVerb.cs
- DayRenderEvent.cs
- FlowStep.cs
- WindowsRichEditRange.cs
- NavigationProperty.cs
- Crypto.cs
- XsltSettings.cs
- MobileRedirect.cs
- TimeIntervalCollection.cs
- SHA256.cs
- HttpSessionStateWrapper.cs
- CancellableEnumerable.cs
- CopyAttributesAction.cs
- ExtensionSimplifierMarkupObject.cs
- RowType.cs
- XpsFilter.cs
- PageCopyCount.cs
- QuaternionAnimation.cs
- ClassHandlersStore.cs
- DataGridDesigner.cs
- ConstraintEnumerator.cs
- RootBrowserWindow.cs
- EnumConverter.cs
- TrustManager.cs
- RtfControls.cs
- Root.cs
- OleDbConnection.cs
- TimerTable.cs
- MapPathBasedVirtualPathProvider.cs
- HttpWebRequestElement.cs
- InheritablePropertyChangeInfo.cs
- WebScriptEndpointElement.cs
- OleDbErrorCollection.cs
- WindowsFormsSectionHandler.cs
- ValidationException.cs
- IssuanceLicense.cs
- CellCreator.cs
- _SingleItemRequestCache.cs
- DefinitionUpdate.cs