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
- CodeExpressionRuleDeclaration.cs
- SoapHttpTransportImporter.cs
- StatusStrip.cs
- PathFigure.cs
- MachineKeyConverter.cs
- WindowsButton.cs
- SignatureHelper.cs
- TemplateKeyConverter.cs
- NameValueSectionHandler.cs
- RoutedPropertyChangedEventArgs.cs
- SetIterators.cs
- HtmlTitle.cs
- TraceEventCache.cs
- WindowsEditBoxRange.cs
- _PooledStream.cs
- UnsafeNativeMethodsTablet.cs
- DesignerGenericWebPart.cs
- AsyncResult.cs
- DataGridTable.cs
- ProviderSettingsCollection.cs
- SimpleApplicationHost.cs
- AutomationTextAttribute.cs
- EmbeddedMailObjectsCollection.cs
- CryptoApi.cs
- GACMembershipCondition.cs
- DbSetClause.cs
- ByteAnimation.cs
- MemoryFailPoint.cs
- ValueType.cs
- SystemDropShadowChrome.cs
- ChangeNode.cs
- DeploymentSection.cs
- AutomationPropertyInfo.cs
- basecomparevalidator.cs
- CodeConditionStatement.cs
- MetadataItem.cs
- ItemCollectionEditor.cs
- DesignerProperties.cs
- SqlAliaser.cs
- CheckBoxList.cs
- ServiceOperation.cs
- SafeSecurityHandles.cs
- EntityDataSourceSelectingEventArgs.cs
- XComponentModel.cs
- XPathAxisIterator.cs
- AddInServer.cs
- LinkArea.cs
- GC.cs
- AddInPipelineAttributes.cs
- RowUpdatedEventArgs.cs
- XmlArrayItemAttribute.cs
- TypeResolver.cs
- prefixendpointaddressmessagefilter.cs
- FocusWithinProperty.cs
- RegexCode.cs
- DefaultPropertiesToSend.cs
- figurelengthconverter.cs
- TimeSpanConverter.cs
- ComplexType.cs
- JpegBitmapEncoder.cs
- CompositeControl.cs
- DbExpressionBuilder.cs
- Thickness.cs
- StateDesigner.Layouts.cs
- DataRelation.cs
- CheckableControlBaseAdapter.cs
- DesignerEditorPartChrome.cs
- SqlException.cs
- ReflectionServiceProvider.cs
- Msec.cs
- ValueOfAction.cs
- TableLayoutRowStyleCollection.cs
- WebPartTransformerCollection.cs
- TypeLoadException.cs
- FixedSOMGroup.cs
- handlecollector.cs
- BrowserTree.cs
- IteratorFilter.cs
- BrowserDefinition.cs
- BaseValidatorDesigner.cs
- WSDualHttpBinding.cs
- AuthenticatedStream.cs
- ResourceCodeDomSerializer.cs
- FixedSOMContainer.cs
- HttpClientChannel.cs
- RegisteredHiddenField.cs
- ImageField.cs
- ListenerAdaptersInstallComponent.cs
- SecurityHeaderTokenResolver.cs
- TableItemPattern.cs
- Wrapper.cs
- SupportingTokenBindingElement.cs
- FrameworkPropertyMetadata.cs
- EpmAttributeNameBuilder.cs
- EventSourceCreationData.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- DbDataSourceEnumerator.cs
- StringWriter.cs
- BindingExpressionUncommonField.cs
- XsltCompileContext.cs