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
- SymbolEqualComparer.cs
- DocumentViewerHelper.cs
- CorrelationHandle.cs
- XmlUnspecifiedAttribute.cs
- MimeMultiPart.cs
- CatalogZoneBase.cs
- BitmapFrameDecode.cs
- MarkupObject.cs
- ManagementQuery.cs
- GridView.cs
- Span.cs
- CharUnicodeInfo.cs
- SvcMapFileSerializer.cs
- BitmapFrame.cs
- SqlResolver.cs
- CheckedListBox.cs
- ListViewItemMouseHoverEvent.cs
- CodeDelegateCreateExpression.cs
- TreeBuilderXamlTranslator.cs
- ProgressPage.cs
- HttpCookiesSection.cs
- Error.cs
- BuildProviderCollection.cs
- EFDataModelProvider.cs
- SamlAuthorityBinding.cs
- SkinBuilder.cs
- OleAutBinder.cs
- TabItemAutomationPeer.cs
- SettingsPropertyIsReadOnlyException.cs
- ServiceDescriptionData.cs
- EntityDataSourceChangingEventArgs.cs
- ThreadExceptionEvent.cs
- HTTPRemotingHandler.cs
- ACE.cs
- WindowsTitleBar.cs
- InkPresenter.cs
- ReceiveActivityDesigner.cs
- OdbcConnectionStringbuilder.cs
- ProcessHostConfigUtils.cs
- HijriCalendar.cs
- ProvidePropertyAttribute.cs
- ConfigXmlAttribute.cs
- DocumentPaginator.cs
- ToolStripItemGlyph.cs
- CreatingCookieEventArgs.cs
- RawStylusSystemGestureInputReport.cs
- StringBlob.cs
- XmlQueryTypeFactory.cs
- IndexedEnumerable.cs
- BitConverter.cs
- DataSourceProvider.cs
- DownloadProgressEventArgs.cs
- MimePart.cs
- SecurityTokenValidationException.cs
- XPathNode.cs
- TextShapeableCharacters.cs
- TemplateColumn.cs
- CompilerError.cs
- EdmMember.cs
- objectquery_tresulttype.cs
- ButtonRenderer.cs
- OpenFileDialog.cs
- FileEnumerator.cs
- DataServiceRequest.cs
- PassportIdentity.cs
- RegisteredArrayDeclaration.cs
- NativeCppClassAttribute.cs
- SQLCharsStorage.cs
- FileRecordSequenceHelper.cs
- SystemBrushes.cs
- MonitorWrapper.cs
- SqlDataSourceConfigureSelectPanel.cs
- OracleMonthSpan.cs
- DebugHandleTracker.cs
- SmtpTransport.cs
- SchemaDeclBase.cs
- OneOfScalarConst.cs
- CodeExpressionCollection.cs
- ContextStaticAttribute.cs
- SerializationFieldInfo.cs
- BoundPropertyEntry.cs
- ConfigsHelper.cs
- RelationshipConstraintValidator.cs
- Graph.cs
- IDQuery.cs
- TagPrefixAttribute.cs
- NetWebProxyFinder.cs
- NetNamedPipeBinding.cs
- WebPartAuthorizationEventArgs.cs
- XmlDesignerDataSourceView.cs
- ObjectManager.cs
- SchemaImporterExtensionElement.cs
- QueueProcessor.cs
- JavaScriptObjectDeserializer.cs
- _SSPISessionCache.cs
- AuthenticationModulesSection.cs
- Figure.cs
- GridSplitterAutomationPeer.cs
- PropertiesTab.cs
- ConstructorNeedsTagAttribute.cs