1 //---------------------------------------------------------------------
2 // <copyright file="ParserOptions.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
7 // @backupOwner Microsoft
8 //---------------------------------------------------------------------
10 namespace System.Data.Common.EntitySql
13 using System.Globalization;
16 /// Represents eSQL compilation options.
18 internal sealed class ParserOptions
20 internal enum CompilationMode
23 /// Normal mode. Compiles eSQL command without restrictions.
24 /// Name resolution is case-insensitive (eSQL default).
29 /// View generation mode: optimizes compilation process to ignore uncessary eSQL constructs:
30 /// - GROUP BY, HAVING and ORDER BY clauses are ignored.
31 /// - WITH RELATIONSHIP clause is allowed in type constructors.
32 /// - Name resolution is case-sensitive.
34 RestrictedViewGenerationMode,
37 /// Same as CompilationMode.Normal plus WITH RELATIONSHIP clause is allowed in type constructors.
39 UserViewGenerationMode
43 /// Sets/Gets eSQL parser compilation mode.
45 internal CompilationMode ParserCompilationMode;
47 internal StringComparer NameComparer
51 return this.NameComparisonCaseInsensitive ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal;
55 internal bool NameComparisonCaseInsensitive
59 return this.ParserCompilationMode == CompilationMode.RestrictedViewGenerationMode ? false : true;