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
- CAGDesigner.cs
- AsyncPostBackErrorEventArgs.cs
- PieceNameHelper.cs
- APCustomTypeDescriptor.cs
- TrackBar.cs
- NegationPusher.cs
- XmlILStorageConverter.cs
- DynamicPropertyReader.cs
- TableProviderWrapper.cs
- RectangleConverter.cs
- ZipFileInfoCollection.cs
- ResourceReader.cs
- CqlQuery.cs
- CalendarBlackoutDatesCollection.cs
- CodeObjectCreateExpression.cs
- ComboBoxRenderer.cs
- XmlReturnReader.cs
- ImageBrush.cs
- TypeDelegator.cs
- FixUpCollection.cs
- HtmlHistory.cs
- XmlILConstructAnalyzer.cs
- ImageMetadata.cs
- WindowsSysHeader.cs
- SafeReadContext.cs
- XamlStream.cs
- AspNetSynchronizationContext.cs
- QilIterator.cs
- MenuScrollingVisibilityConverter.cs
- HtmlLink.cs
- BStrWrapper.cs
- DragCompletedEventArgs.cs
- WebPartConnectionsEventArgs.cs
- TemplateBaseAction.cs
- ExpressionVisitor.cs
- ImageMap.cs
- XmlNotation.cs
- BufferedGraphicsContext.cs
- XmlName.cs
- XXXInfos.cs
- EncryptedData.cs
- IDReferencePropertyAttribute.cs
- ImageSourceConverter.cs
- PageDeviceFont.cs
- DBCSCodePageEncoding.cs
- UndoEngine.cs
- PropertyRecord.cs
- IPipelineRuntime.cs
- EditingCoordinator.cs
- ResourceManagerWrapper.cs
- SettingsPropertyCollection.cs
- URLString.cs
- GenericWebPart.cs
- RTLAwareMessageBox.cs
- CacheVirtualItemsEvent.cs
- CountdownEvent.cs
- StateMachineExecutionState.cs
- KeyEvent.cs
- Scalars.cs
- PointAnimationUsingKeyFrames.cs
- AutoGeneratedFieldProperties.cs
- InternalEnumValidator.cs
- ToolStripTextBox.cs
- URL.cs
- FileDataSourceCache.cs
- RelatedImageListAttribute.cs
- XPathNode.cs
- ValueOfAction.cs
- TextFormatterHost.cs
- SafeBitVector32.cs
- Blend.cs
- IdentifierCreationService.cs
- WorkflowViewStateService.cs
- VScrollBar.cs
- AssociationSetEnd.cs
- SettingsSection.cs
- TypeUsageBuilder.cs
- DispatcherHookEventArgs.cs
- SecurityDocument.cs
- PageThemeBuildProvider.cs
- SamlAttributeStatement.cs
- FixedTextSelectionProcessor.cs
- SerializerDescriptor.cs
- SafeBitVector32.cs
- DesignerAttributeInfo.cs
- ListBoxItemWrapperAutomationPeer.cs
- HTTPNotFoundHandler.cs
- XmlAnyAttributeAttribute.cs
- TcpChannelFactory.cs
- AutoGeneratedFieldProperties.cs
- RuntimeHelpers.cs
- MessageQueuePermission.cs
- LineInfo.cs
- GeometryConverter.cs
- DSASignatureDeformatter.cs
- TransformCryptoHandle.cs
- HtmlLiteralTextAdapter.cs
- DataSourceXmlSerializer.cs
- Point.cs
- HttpWebRequest.cs