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
- PathGeometry.cs
- Compiler.cs
- RoutedEvent.cs
- ExceptionTrace.cs
- Preprocessor.cs
- TdsParserStaticMethods.cs
- SettingsContext.cs
- TypeElement.cs
- AppDomainManager.cs
- XDRSchema.cs
- ControlBindingsConverter.cs
- ContextBase.cs
- ScriptManager.cs
- NaturalLanguageHyphenator.cs
- UnmanagedMemoryAccessor.cs
- MultiDataTrigger.cs
- XmlDocumentFragment.cs
- ProtocolsConfigurationHandler.cs
- ConsoleCancelEventArgs.cs
- SerializationSectionGroup.cs
- TimelineGroup.cs
- HtmlSelectionListAdapter.cs
- TypeConverterMarkupExtension.cs
- Emitter.cs
- DataGridViewDataErrorEventArgs.cs
- FloatAverageAggregationOperator.cs
- ToolStripDropDownMenu.cs
- RunClient.cs
- TraceSection.cs
- DependencyObjectCodeDomSerializer.cs
- FieldDescriptor.cs
- PartitionerQueryOperator.cs
- ProviderMetadata.cs
- AsyncSerializedWorker.cs
- MemoryStream.cs
- DataGridViewColumnEventArgs.cs
- OperationInfo.cs
- _LocalDataStore.cs
- XmlSchemaInferenceException.cs
- SafeSecurityHandles.cs
- PenCursorManager.cs
- HtmlGenericControl.cs
- Model3DGroup.cs
- ToolboxSnapDragDropEventArgs.cs
- Pool.cs
- TypeSource.cs
- CompiledXpathExpr.cs
- Semaphore.cs
- ImmutablePropertyDescriptorGridEntry.cs
- DoubleLinkList.cs
- FixedPageAutomationPeer.cs
- PersonalizableTypeEntry.cs
- ClientTarget.cs
- LinkedResource.cs
- DependencySource.cs
- WeakReferenceList.cs
- MaskedTextProvider.cs
- EventLogEntryCollection.cs
- NGCUIElementCollectionSerializerAsync.cs
- BitmapEncoder.cs
- CacheMemory.cs
- TextRangeEditTables.cs
- SqlNodeTypeOperators.cs
- ComplexObject.cs
- Not.cs
- CachedFontFamily.cs
- ToolStripItemRenderEventArgs.cs
- GenericWebPart.cs
- PartialList.cs
- XmlSchemaGroup.cs
- GuidelineSet.cs
- KeyValueConfigurationElement.cs
- SqlCommandBuilder.cs
- TextRunCache.cs
- StrokeNode.cs
- DbConnectionPoolCounters.cs
- XPathItem.cs
- OleDbWrapper.cs
- FixedSOMPageElement.cs
- HtmlInputPassword.cs
- Span.cs
- SelectionItemPattern.cs
- TranslateTransform3D.cs
- RuntimeConfig.cs
- SafePointer.cs
- XmlElement.cs
- TemplateControl.cs
- SoapHttpTransportImporter.cs
- UndoUnit.cs
- MaxSessionCountExceededException.cs
- BinaryParser.cs
- TransformGroup.cs
- ShaderEffect.cs
- DrawingContextFlattener.cs
- TextFormatter.cs
- ToolboxDataAttribute.cs
- UnsafeNativeMethods.cs
- X509PeerCertificateAuthentication.cs
- ArgumentElement.cs
- TransformPattern.cs