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
- CommandTreeTypeHelper.cs
- XsltLibrary.cs
- TextDecorations.cs
- DocumentCollection.cs
- ClientScriptManager.cs
- ColorIndependentAnimationStorage.cs
- WorkflowLayouts.cs
- DesignerActionListCollection.cs
- ImageIndexConverter.cs
- Constant.cs
- ParserStreamGeometryContext.cs
- httpserverutility.cs
- ReadOnlyHierarchicalDataSourceView.cs
- DataGridSortCommandEventArgs.cs
- Rect.cs
- TextBoxBase.cs
- PolyBezierSegmentFigureLogic.cs
- ServiceThrottlingBehavior.cs
- ListBindingHelper.cs
- TransformPattern.cs
- TextBoxAutoCompleteSourceConverter.cs
- SafeThreadHandle.cs
- Journal.cs
- Utilities.cs
- PenCursorManager.cs
- Calendar.cs
- TableItemPatternIdentifiers.cs
- StringConverter.cs
- DataObjectMethodAttribute.cs
- SplineQuaternionKeyFrame.cs
- StorageEntityTypeMapping.cs
- EventTrigger.cs
- HtmlEncodedRawTextWriter.cs
- HtmlLink.cs
- BrushConverter.cs
- DeleteWorkflowOwnerCommand.cs
- KnownIds.cs
- StringSource.cs
- FunctionCommandText.cs
- Subset.cs
- RightNameExpirationInfoPair.cs
- PersonalizationAdministration.cs
- DataPagerCommandEventArgs.cs
- XmlSerializerNamespaces.cs
- CodeCommentStatement.cs
- DriveNotFoundException.cs
- ObjectPersistData.cs
- SemanticKeyElement.cs
- BaseTemplatedMobileComponentEditor.cs
- SignalGate.cs
- HiddenField.cs
- ParagraphVisual.cs
- MailAddressCollection.cs
- XmlEnumAttribute.cs
- QilVisitor.cs
- GeometryGroup.cs
- ColorEditor.cs
- StringFunctions.cs
- Frame.cs
- XsdDataContractExporter.cs
- DataGridViewColumnTypePicker.cs
- XPathDocumentIterator.cs
- NativeRightsManagementAPIsStructures.cs
- Pool.cs
- WebZone.cs
- ClientSettingsStore.cs
- FontDifferentiator.cs
- CurrentChangingEventArgs.cs
- ClientUtils.cs
- XsltSettings.cs
- Cursors.cs
- Rotation3DAnimationUsingKeyFrames.cs
- TypeDelegator.cs
- ExcludeFromCodeCoverageAttribute.cs
- OracleException.cs
- FilterElement.cs
- figurelengthconverter.cs
- DebuggerAttributes.cs
- _SpnDictionary.cs
- ConnectionPoint.cs
- SchemaElementLookUpTableEnumerator.cs
- NonClientArea.cs
- SettingsProperty.cs
- XmlReaderSettings.cs
- DataTableMappingCollection.cs
- PointCollection.cs
- ToolStripDropDownButton.cs
- NameObjectCollectionBase.cs
- tooltip.cs
- LineGeometry.cs
- RegexGroup.cs
- PathParser.cs
- CodeParameterDeclarationExpressionCollection.cs
- DataStorage.cs
- OracleDataAdapter.cs
- ContextMenuAutomationPeer.cs
- TdsParserHelperClasses.cs
- JsonDeserializer.cs
- querybuilder.cs
- ToolZone.cs