Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Common / EntitySql / AST / AstNode.cs / 1305376 / AstNode.cs
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....]
// @backupOwner [....]
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql.AST
{
using System;
using System.Globalization;
using System.Collections;
using System.Collections.Generic;
///
/// Represents base class for nodes in the eSQL abstract syntax tree OM.
///
internal abstract class Node
{
private ErrorContext _errCtx = new ErrorContext();
internal Node() { }
internal Node(string commandText, int inputPosition)
{
_errCtx.CommandText = commandText;
_errCtx.InputPosition = inputPosition;
}
///
/// Ast Node error context.
///
internal ErrorContext ErrCtx
{
get { return _errCtx; }
set { _errCtx = value; }
}
}
///
/// An ast node represents a generic list of ast nodes.
///
internal sealed class NodeList : Node, System.Collections.Generic.IEnumerable
where T : Node
{
private readonly List _list = new List();
///
/// Default constructor.
///
internal NodeList()
{
}
///
/// Initializes adding one item to the list.
///
/// expression
internal NodeList(T item)
{
_list.Add(item);
}
///
/// Add an item to the list, return the updated list.
///
internal NodeList Add(T item)
{
_list.Add(item);
return this;
}
///
/// Returns the number of elements in the list.
///
internal int Count
{
get { return _list.Count; }
}
///
/// Indexer to the list entries.
///
/// integer position of the element in the list
internal T this[int index]
{
get { return _list[index]; }
}
#region GetEnumerator
System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator()
{
return _list.GetEnumerator();
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return _list.GetEnumerator();
}
#endregion
}
}
// 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
- EdmValidator.cs
- DataViewSettingCollection.cs
- TextEmbeddedObject.cs
- SapiInterop.cs
- CodeMemberMethod.cs
- ClipboardProcessor.cs
- CachedFontFace.cs
- SqlTriggerAttribute.cs
- ArraySubsetEnumerator.cs
- HybridDictionary.cs
- RenamedEventArgs.cs
- ListBindableAttribute.cs
- XmlSchemaObjectCollection.cs
- LineVisual.cs
- ApplicationServicesHostFactory.cs
- AsyncPostBackErrorEventArgs.cs
- ISFClipboardData.cs
- ChangesetResponse.cs
- NativeCppClassAttribute.cs
- ByteStack.cs
- NavigationService.cs
- OleDbDataReader.cs
- SelectionWordBreaker.cs
- TextEffectCollection.cs
- Stream.cs
- XamlReader.cs
- ClientProtocol.cs
- ScriptHandlerFactory.cs
- ApplicationInfo.cs
- EntityCodeGenerator.cs
- CompositeControl.cs
- log.cs
- TreeNode.cs
- XPathMessageFilterElement.cs
- IteratorDescriptor.cs
- RuntimeHelpers.cs
- ToolStripItemImageRenderEventArgs.cs
- TabPage.cs
- OrthographicCamera.cs
- QilXmlReader.cs
- ToolBarButtonDesigner.cs
- ArgumentNullException.cs
- VBIdentifierDesigner.xaml.cs
- ConfigXmlComment.cs
- OdbcDataReader.cs
- SharedUtils.cs
- ConnectionsZone.cs
- counter.cs
- ScriptManagerProxy.cs
- DataFormat.cs
- QilInvokeEarlyBound.cs
- StatusBarDrawItemEvent.cs
- DockProviderWrapper.cs
- CssTextWriter.cs
- ModelChangedEventArgsImpl.cs
- FormatException.cs
- ServiceManagerHandle.cs
- DisplayInformation.cs
- ThemeDirectoryCompiler.cs
- DbCommandTree.cs
- IndexingContentUnit.cs
- IntMinMaxAggregationOperator.cs
- DataGridViewRowCancelEventArgs.cs
- URIFormatException.cs
- PageResolution.cs
- ParameterCollection.cs
- ClientOperation.cs
- ToolboxSnapDragDropEventArgs.cs
- PropertyChangingEventArgs.cs
- Enum.cs
- InheritanceRules.cs
- MdbDataFileEditor.cs
- Control.cs
- SqlDataReader.cs
- IdentitySection.cs
- FormViewDeleteEventArgs.cs
- ScrollBar.cs
- RelationshipEndMember.cs
- DBAsyncResult.cs
- CompressStream.cs
- DeferrableContent.cs
- SubpageParagraph.cs
- BuiltInPermissionSets.cs
- CompressionTransform.cs
- HttpProtocolImporter.cs
- securestring.cs
- CodeValidator.cs
- EnumerableRowCollection.cs
- MasterPageCodeDomTreeGenerator.cs
- StatusBarItem.cs
- TimeEnumHelper.cs
- Table.cs
- Root.cs
- GeneralTransform3DCollection.cs
- CssClassPropertyAttribute.cs
- Constraint.cs
- InOutArgumentConverter.cs
- InlineCollection.cs
- DiscoveryRequestHandler.cs
- PhysicalAddress.cs