Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataEntity / System / Data / SqlClient / SqlGen / SymbolTable.cs / 1 / 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
- Currency.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- MaskedTextProvider.cs
- Crc32Helper.cs
- NamedObject.cs
- ArgumentException.cs
- ParallelQuery.cs
- DesignerUtils.cs
- ScrollPattern.cs
- FocusManager.cs
- DefaultCommandConverter.cs
- StorageFunctionMapping.cs
- StaticFileHandler.cs
- linebase.cs
- ProfilePropertySettings.cs
- Currency.cs
- Compiler.cs
- Automation.cs
- TemplateControlCodeDomTreeGenerator.cs
- StructuralObject.cs
- StaticFileHandler.cs
- PrinterSettings.cs
- ImageMetadata.cs
- NewArrayExpression.cs
- BitConverter.cs
- Pkcs7Recipient.cs
- RichTextBox.cs
- CustomPopupPlacement.cs
- ProxyWebPart.cs
- SimpleTypeResolver.cs
- MultiPropertyDescriptorGridEntry.cs
- HiddenField.cs
- CollectionsUtil.cs
- ZoneIdentityPermission.cs
- XhtmlBasicFormAdapter.cs
- IISMapPath.cs
- LinkConverter.cs
- AvTraceDetails.cs
- Roles.cs
- WebPartCloseVerb.cs
- ExpressionHelper.cs
- D3DImage.cs
- DataListItemCollection.cs
- PropertyMapper.cs
- XmlSchemaImport.cs
- StringExpressionSet.cs
- DeclaredTypeValidatorAttribute.cs
- DesigntimeLicenseContextSerializer.cs
- SecurityManager.cs
- TextRangeEditLists.cs
- XmlAutoDetectWriter.cs
- ParsedAttributeCollection.cs
- EntityDataSourceSelectedEventArgs.cs
- UnicodeEncoding.cs
- LogicalCallContext.cs
- GroupLabel.cs
- CallbackDebugElement.cs
- JpegBitmapDecoder.cs
- ClientTargetSection.cs
- BufferedGraphicsManager.cs
- HttpPostedFile.cs
- cookieexception.cs
- CompilerInfo.cs
- QilPatternVisitor.cs
- CommandLibraryHelper.cs
- Types.cs
- TextDecorationLocationValidation.cs
- RequestBringIntoViewEventArgs.cs
- VisemeEventArgs.cs
- ResumeStoryboard.cs
- ResourceSet.cs
- CategoryList.cs
- PropertyConverter.cs
- EditingScopeUndoUnit.cs
- SponsorHelper.cs
- CompoundFileStreamReference.cs
- TypeContext.cs
- MSAANativeProvider.cs
- ETagAttribute.cs
- BitmapFrameEncode.cs
- StringToken.cs
- ServiceDescriptionImporter.cs
- SchemaNames.cs
- DesignerValidationSummaryAdapter.cs
- ProfilePropertySettingsCollection.cs
- XPathArrayIterator.cs
- UIElement3D.cs
- SelfIssuedAuthRSACryptoProvider.cs
- SupportsEventValidationAttribute.cs
- Matrix3DConverter.cs
- PerformanceCounter.cs
- WebPartCatalogCloseVerb.cs
- RtfControlWordInfo.cs
- IListConverters.cs
- _SingleItemRequestCache.cs
- XmlQueryCardinality.cs
- DbProviderSpecificTypePropertyAttribute.cs
- XmlTextAttribute.cs
- DataObjectSettingDataEventArgs.cs
- SimpleHandlerFactory.cs