Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Common / EntitySql / AST / Identifier.cs / 1305376 / Identifier.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; using System.Diagnostics; using System.Text; ////// Represents an identifier ast node. /// internal sealed class Identifier : Node { private readonly string _name; private readonly bool _isEscaped; ////// Initializes identifier. /// internal Identifier(string symbol, bool isEscaped, string query, int inputPos) : base(query, inputPos) { Debug.Assert(!String.IsNullOrEmpty(symbol), "symbol must not be null or empty"); string name = symbol; if (isEscaped) { if (name.Length < 2 || name[0] != '[' || name[name.Length - 1] != ']') { throw EntityUtil.EntitySqlError(this.ErrCtx, System.Data.Entity.Strings.InvalidEscapedIdentifier(name)); } name = name.Substring(1, name.Length - 2); } else { bool isIdentifierASCII = true; if (!CqlLexer.IsLetterOrDigitOrUnderscore(name, out isIdentifierASCII)) { if (isIdentifierASCII) { throw EntityUtil.EntitySqlError(this.ErrCtx, System.Data.Entity.Strings.InvalidSimpleIdentifier(name)); } else { throw EntityUtil.EntitySqlError(this.ErrCtx, System.Data.Entity.Strings.InvalidSimpleIdentifierNonASCII(name)); } } } _name = name; _isEscaped = isEscaped; } ////// Returns identifier name (without escaping chars). /// internal string Name { get { return _name; } } ////// True if an identifier is escaped. /// internal bool IsEscaped { get { return _isEscaped; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- //// 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; using System.Diagnostics; using System.Text; ////// Represents an identifier ast node. /// internal sealed class Identifier : Node { private readonly string _name; private readonly bool _isEscaped; ////// Initializes identifier. /// internal Identifier(string symbol, bool isEscaped, string query, int inputPos) : base(query, inputPos) { Debug.Assert(!String.IsNullOrEmpty(symbol), "symbol must not be null or empty"); string name = symbol; if (isEscaped) { if (name.Length < 2 || name[0] != '[' || name[name.Length - 1] != ']') { throw EntityUtil.EntitySqlError(this.ErrCtx, System.Data.Entity.Strings.InvalidEscapedIdentifier(name)); } name = name.Substring(1, name.Length - 2); } else { bool isIdentifierASCII = true; if (!CqlLexer.IsLetterOrDigitOrUnderscore(name, out isIdentifierASCII)) { if (isIdentifierASCII) { throw EntityUtil.EntitySqlError(this.ErrCtx, System.Data.Entity.Strings.InvalidSimpleIdentifier(name)); } else { throw EntityUtil.EntitySqlError(this.ErrCtx, System.Data.Entity.Strings.InvalidSimpleIdentifierNonASCII(name)); } } } _name = name; _isEscaped = isEscaped; } ////// Returns identifier name (without escaping chars). /// internal string Name { get { return _name; } } ////// True if an identifier is escaped. /// internal bool IsEscaped { get { return _isEscaped; } } } } // 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
- HttpException.cs
- BooleanToVisibilityConverter.cs
- EDesignUtil.cs
- EntityModelSchemaGenerator.cs
- GenericTypeParameterBuilder.cs
- WindowsListViewItem.cs
- ImageIndexConverter.cs
- LinkedList.cs
- OperationSelectorBehavior.cs
- HwndProxyElementProvider.cs
- CircleHotSpot.cs
- AncillaryOps.cs
- ProfileModule.cs
- SqlRewriteScalarSubqueries.cs
- StorageInfo.cs
- ConfigurationPropertyCollection.cs
- MediaContext.cs
- ProfileEventArgs.cs
- DeclaredTypeValidatorAttribute.cs
- GridViewUpdateEventArgs.cs
- XmlNamedNodeMap.cs
- TableAutomationPeer.cs
- AuthenticatedStream.cs
- StorageBasedPackageProperties.cs
- SerializationHelper.cs
- MarkupExtensionParser.cs
- Inline.cs
- Number.cs
- SliderAutomationPeer.cs
- MatrixKeyFrameCollection.cs
- CodeSnippetTypeMember.cs
- ReaderWriterLockSlim.cs
- BamlTreeNode.cs
- DetailsViewInsertedEventArgs.cs
- DispatcherEventArgs.cs
- WebHttpBinding.cs
- SpellerError.cs
- ProfileSettingsCollection.cs
- MetadataUtil.cs
- TextClipboardData.cs
- LayoutUtils.cs
- MenuCommands.cs
- TabletDeviceInfo.cs
- ThicknessConverter.cs
- XmlSchemaImporter.cs
- SingleTagSectionHandler.cs
- AsyncOperation.cs
- bindurihelper.cs
- NetWebProxyFinder.cs
- XmlImplementation.cs
- CqlParserHelpers.cs
- CultureTableRecord.cs
- TargetPerspective.cs
- _Win32.cs
- ProfileService.cs
- TraceLevelStore.cs
- DataAdapter.cs
- Control.cs
- ExternalCalls.cs
- SchemaCollectionCompiler.cs
- TextElementEnumerator.cs
- FileLoadException.cs
- LocalizableResourceBuilder.cs
- UIElementPropertyUndoUnit.cs
- CopyOnWriteList.cs
- TextHidden.cs
- ButtonStandardAdapter.cs
- AppDomainInstanceProvider.cs
- ResourceSet.cs
- DependencyObjectProvider.cs
- IisTraceWebEventProvider.cs
- ConnectionPointCookie.cs
- DataObjectCopyingEventArgs.cs
- BasicCellRelation.cs
- BasePattern.cs
- ComMethodElementCollection.cs
- StrokeFIndices.cs
- DataServiceBehavior.cs
- SortExpressionBuilder.cs
- Trace.cs
- MouseGestureConverter.cs
- HTMLTagNameToTypeMapper.cs
- MetafileHeader.cs
- StructuralObject.cs
- ClientSettings.cs
- DynamicFilterExpression.cs
- PassportAuthentication.cs
- SubordinateTransaction.cs
- TiffBitmapEncoder.cs
- StorageModelBuildProvider.cs
- DataGridViewRowPostPaintEventArgs.cs
- SqlHelper.cs
- FormsAuthenticationUserCollection.cs
- SqlDataSourceConfigureSortForm.cs
- Cursor.cs
- ModelServiceImpl.cs
- ReturnType.cs
- ContextMenuService.cs
- Transactions.cs
- BooleanAnimationBase.cs