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
- StringToken.cs
- HttpContextWrapper.cs
- WebEventCodes.cs
- KoreanLunisolarCalendar.cs
- ToolStripSystemRenderer.cs
- RectangleConverter.cs
- EntityDataSourceContextDisposingEventArgs.cs
- SplitterCancelEvent.cs
- securestring.cs
- SkinBuilder.cs
- TextUtf8RawTextWriter.cs
- SQLBytesStorage.cs
- InfoCardRSAPKCS1SignatureFormatter.cs
- TextTreeText.cs
- MessageQueueTransaction.cs
- ChunkedMemoryStream.cs
- ServiceManager.cs
- Model3DGroup.cs
- InstanceDataCollectionCollection.cs
- ZoneLinkButton.cs
- ScrollableControlDesigner.cs
- PackWebResponse.cs
- GPRECT.cs
- GroupDescription.cs
- Rfc4050KeyFormatter.cs
- OracleConnectionFactory.cs
- MeasureItemEvent.cs
- ObjectQuery.cs
- CompositeCollection.cs
- RadioButtonAutomationPeer.cs
- DataGridToolTip.cs
- QilBinary.cs
- UInt16.cs
- CapabilitiesState.cs
- DrawingDrawingContext.cs
- Dump.cs
- DesignBindingConverter.cs
- SystemDiagnosticsSection.cs
- GridItemProviderWrapper.cs
- BindingCollection.cs
- CustomErrorsSection.cs
- ForeignKeyConstraint.cs
- ToolStripItemEventArgs.cs
- ObjectDataSourceChooseTypePanel.cs
- Encoding.cs
- AnchorEditor.cs
- MarkupObject.cs
- DataError.cs
- HttpWebResponse.cs
- TextBounds.cs
- InputReportEventArgs.cs
- DataGridCaption.cs
- OutputScopeManager.cs
- TextSearch.cs
- RectIndependentAnimationStorage.cs
- SystemTcpStatistics.cs
- XPathAncestorQuery.cs
- GlobalEventManager.cs
- DataListItemEventArgs.cs
- HitTestFilterBehavior.cs
- SaveFileDialog.cs
- Rectangle.cs
- TrackingProfileSerializer.cs
- CodeSubDirectoriesCollection.cs
- HtmlInputHidden.cs
- TrustLevel.cs
- SqlUDTStorage.cs
- FixedTextPointer.cs
- XsltConvert.cs
- LocalServiceSecuritySettingsElement.cs
- ZipIOLocalFileDataDescriptor.cs
- TreePrinter.cs
- CounterSet.cs
- SelectingProviderEventArgs.cs
- MsmqReceiveHelper.cs
- MailDefinition.cs
- HttpModulesInstallComponent.cs
- DataServicePagingProviderWrapper.cs
- CallbackValidatorAttribute.cs
- Transform3D.cs
- ManagementObject.cs
- AuthenticodeSignatureInformation.cs
- UdpMessageProperty.cs
- SvcMapFileSerializer.cs
- WindowsPen.cs
- TraceContextEventArgs.cs
- CalendarDataBindingHandler.cs
- IsolatedStorageException.cs
- FormParameter.cs
- oledbconnectionstring.cs
- HttpListenerContext.cs
- SafeEventLogWriteHandle.cs
- Brush.cs
- BitmapEffect.cs
- mactripleDES.cs
- EmptyImpersonationContext.cs
- ByteAnimation.cs
- DeviceOverridableAttribute.cs
- XmlHelper.cs
- WebHeaderCollection.cs