Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Input.cs
- SelectionEditingBehavior.cs
- UnsafeNativeMethods.cs
- ExpandCollapsePattern.cs
- WaitingCursor.cs
- Error.cs
- XPathScanner.cs
- newitemfactory.cs
- ImageAutomationPeer.cs
- StyleHelper.cs
- InternalTransaction.cs
- SqlReorderer.cs
- CapabilitiesSection.cs
- SqlLiftWhereClauses.cs
- JsonDeserializer.cs
- CustomSignedXml.cs
- HostingPreferredMapPath.cs
- ResXFileRef.cs
- LinkLabel.cs
- ListView.cs
- WasEndpointConfigContainer.cs
- _DynamicWinsockMethods.cs
- AnnotationHelper.cs
- COM2Enum.cs
- CalendarButton.cs
- FixUp.cs
- CorePropertiesFilter.cs
- CompiledIdentityConstraint.cs
- BinaryMessageEncodingElement.cs
- DataGridView.cs
- ClientScriptItem.cs
- SafeHandle.cs
- HostProtectionPermission.cs
- NotFiniteNumberException.cs
- ExtensionFile.cs
- EndpointInfoCollection.cs
- input.cs
- XPathNavigator.cs
- CollectionChangeEventArgs.cs
- NativeObjectSecurity.cs
- SoapFormatter.cs
- PanelStyle.cs
- ButtonColumn.cs
- OutOfMemoryException.cs
- NotificationContext.cs
- GenericTextProperties.cs
- TransformDescriptor.cs
- GetIsBrowserClientRequest.cs
- ChildDocumentBlock.cs
- LookupNode.cs
- baseaxisquery.cs
- OleDbMetaDataFactory.cs
- SystemUnicastIPAddressInformation.cs
- XmlDataProvider.cs
- PrivilegedConfigurationManager.cs
- RuleInfoComparer.cs
- HttpProcessUtility.cs
- FontWeights.cs
- AssemblyResourceLoader.cs
- ExternalException.cs
- ProviderConnectionPoint.cs
- InvokeFunc.cs
- BaseAddressPrefixFilterElementCollection.cs
- BaseConfigurationRecord.cs
- NativeMethods.cs
- StructuredProperty.cs
- KeyToListMap.cs
- DataControlReferenceCollection.cs
- TextCompositionEventArgs.cs
- AstNode.cs
- ExpressionPrinter.cs
- MutexSecurity.cs
- NamedPipeConnectionPoolSettingsElement.cs
- XmlProcessingInstruction.cs
- CodePrimitiveExpression.cs
- Trustee.cs
- SqlStatistics.cs
- WebPartHeaderCloseVerb.cs
- AuthenticationManager.cs
- HijriCalendar.cs
- ProxyFragment.cs
- TextFormatter.cs
- _HTTPDateParse.cs
- RadioButtonRenderer.cs
- ProfileInfo.cs
- TemplateKey.cs
- PauseStoryboard.cs
- VerificationException.cs
- Odbc32.cs
- Message.cs
- ReachDocumentReferenceSerializer.cs
- SQLUtility.cs
- DateRangeEvent.cs
- ServiceHttpHandlerFactory.cs
- GrabHandleGlyph.cs
- TextViewBase.cs
- XmlSchemaSimpleType.cs
- SymbolDocumentInfo.cs
- AstTree.cs
- TablePatternIdentifiers.cs