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
- FamilyMapCollection.cs
- WebPartZoneBase.cs
- WebPartConnectionsConfigureVerb.cs
- PropertyManager.cs
- TypeBuilder.cs
- MsmqMessage.cs
- ExpressionSelection.cs
- TypedElement.cs
- HtmlDocument.cs
- CustomServiceCredentials.cs
- TextElement.cs
- IntPtr.cs
- MsmqPoisonMessageException.cs
- WindowsUserNameSecurityTokenAuthenticator.cs
- LoadedEvent.cs
- ControlDesigner.cs
- StronglyTypedResourceBuilder.cs
- ZipIOLocalFileHeader.cs
- SerialPort.cs
- AutomationProperties.cs
- StatusStrip.cs
- EventDescriptor.cs
- MetadataArtifactLoaderResource.cs
- AutomationEventArgs.cs
- DocumentCollection.cs
- TextDataBindingHandler.cs
- AccessText.cs
- PagesChangedEventArgs.cs
- FixedHighlight.cs
- ReadOnlyActivityGlyph.cs
- ResXResourceReader.cs
- SizeF.cs
- XamlFrame.cs
- HtmlInputText.cs
- ZoneMembershipCondition.cs
- FormViewUpdateEventArgs.cs
- SoapMessage.cs
- RawStylusSystemGestureInputReport.cs
- dataprotectionpermission.cs
- Quaternion.cs
- ApplicationException.cs
- Parameter.cs
- HeaderedContentControl.cs
- LeftCellWrapper.cs
- PhysicalFontFamily.cs
- ToolboxCategoryItems.cs
- Cursor.cs
- _NestedMultipleAsyncResult.cs
- BitmapCodecInfoInternal.cs
- PropertyGrid.cs
- DataGridViewColumnTypeEditor.cs
- ModifierKeysValueSerializer.cs
- RelatedImageListAttribute.cs
- GridViewColumnCollection.cs
- MobileResource.cs
- EdmValidator.cs
- RoleGroup.cs
- DataGridPagerStyle.cs
- FontSourceCollection.cs
- ClientCultureInfo.cs
- RectIndependentAnimationStorage.cs
- TogglePattern.cs
- Int16Animation.cs
- WebPartCatalogCloseVerb.cs
- DuplicateWaitObjectException.cs
- PartialTrustVisibleAssembliesSection.cs
- StickyNote.cs
- NoPersistProperty.cs
- XPathException.cs
- ManagedIStream.cs
- AudienceUriMode.cs
- DefaultMemberAttribute.cs
- EntityContainer.cs
- OpCodes.cs
- SelectedPathEditor.cs
- Ref.cs
- ParseHttpDate.cs
- ITextView.cs
- DbConnectionStringBuilder.cs
- ObservableDictionary.cs
- MemoryFailPoint.cs
- DateTimeOffsetStorage.cs
- ObjectStateFormatter.cs
- ComponentChangingEvent.cs
- NullableLongSumAggregationOperator.cs
- StorageEntityContainerMapping.cs
- VarRefManager.cs
- EntityViewGenerationConstants.cs
- SecureUICommand.cs
- NameValueSectionHandler.cs
- WebPartDisplayModeCancelEventArgs.cs
- DataBoundControl.cs
- TextReader.cs
- NetworkInformationPermission.cs
- SerializationIncompleteException.cs
- parserscommon.cs
- DeflateStream.cs
- SecureUICommand.cs
- DbQueryCommandTree.cs
- NavigationFailedEventArgs.cs