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
- MenuTracker.cs
- Schema.cs
- Message.cs
- XmlTextEncoder.cs
- ArrayConverter.cs
- BooleanKeyFrameCollection.cs
- XpsPartBase.cs
- FormViewUpdateEventArgs.cs
- PermissionListSet.cs
- ServicePointManagerElement.cs
- SafeRightsManagementSessionHandle.cs
- DynamicRendererThreadManager.cs
- SQLString.cs
- MemberPath.cs
- CodeGenerationManager.cs
- PersonalizableTypeEntry.cs
- DetailsViewCommandEventArgs.cs
- XpsFixedDocumentReaderWriter.cs
- Clause.cs
- DictationGrammar.cs
- WebSysDescriptionAttribute.cs
- EffectiveValueEntry.cs
- ViewPort3D.cs
- X500Name.cs
- TrustManager.cs
- ArgumentException.cs
- PerformanceCounterNameAttribute.cs
- DbDataReader.cs
- TrackBar.cs
- ImpersonateTokenRef.cs
- WebPartDisplayModeCancelEventArgs.cs
- HtmlImageAdapter.cs
- MultipleViewProviderWrapper.cs
- ComponentChangedEvent.cs
- AssemblyCacheEntry.cs
- StorageInfo.cs
- NonVisualControlAttribute.cs
- Imaging.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- StyleCollection.cs
- TemplateControlParser.cs
- UrlMappingsModule.cs
- QueryableDataSourceHelper.cs
- ExpressionBuilderCollection.cs
- ImageSource.cs
- CompilerResults.cs
- Events.cs
- OracleBinary.cs
- TdsParserSafeHandles.cs
- ApplicationManager.cs
- ListDictionaryInternal.cs
- EntityDescriptor.cs
- UnmanagedMemoryStreamWrapper.cs
- MailMessage.cs
- WebPartsSection.cs
- GPRECT.cs
- OperatingSystemVersionCheck.cs
- StatusInfoItem.cs
- TextElementEnumerator.cs
- XPathBinder.cs
- TransformPattern.cs
- StructuredCompositeActivityDesigner.cs
- RuntimeArgumentHandle.cs
- FigureParaClient.cs
- TemplateControlParser.cs
- InvalidProgramException.cs
- HexParser.cs
- MetaColumn.cs
- PersonalizableAttribute.cs
- PrintController.cs
- RoleManagerModule.cs
- XmlWrappingReader.cs
- PackWebResponse.cs
- CodeParameterDeclarationExpression.cs
- SmtpNegotiateAuthenticationModule.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- WsdlImporterElement.cs
- DataRowChangeEvent.cs
- CheckBoxList.cs
- BinaryNegotiation.cs
- ToolStripItem.cs
- CellTreeNodeVisitors.cs
- IconBitmapDecoder.cs
- IdentifierService.cs
- Matrix.cs
- ResourceSet.cs
- TextCompositionManager.cs
- GregorianCalendarHelper.cs
- EntityRecordInfo.cs
- Visitors.cs
- UriSection.cs
- Bold.cs
- FormViewUpdatedEventArgs.cs
- ViewSimplifier.cs
- BooleanToVisibilityConverter.cs
- SegmentInfo.cs
- XmlNamespaceDeclarationsAttribute.cs
- MsmqIntegrationProcessProtocolHandler.cs
- SharedStatics.cs
- CurrencyWrapper.cs