alielie
2026-09-10 f3889f2d36c50cf99468594854def9b7ed069fb5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
using System;
using System.Linq.Expressions;
using DynamicExpresso.Parsing;
 
namespace DynamicExpresso
{
    public static class LanguageConstants
    {
        public const string This = "this";
 
        public static readonly ReferenceType[] PrimitiveTypes = {
            new ReferenceType(typeof(object)),
            new ReferenceType(typeof(bool)),
            new ReferenceType(typeof(char)),
            new ReferenceType(typeof(string)),
            new ReferenceType(typeof(sbyte)),
            new ReferenceType(typeof(byte)),
            new ReferenceType(typeof(short)),
            new ReferenceType(typeof(ushort)),
            new ReferenceType(typeof(int)),
            new ReferenceType(typeof(uint)),
            new ReferenceType(typeof(long)),
            new ReferenceType(typeof(ulong)),
            new ReferenceType(typeof(float)),
            new ReferenceType(typeof(double)),
            new ReferenceType(typeof(decimal)),
            new ReferenceType(typeof(DateTime)),
            new ReferenceType(typeof(TimeSpan)),
            new ReferenceType(typeof(Guid))
        };
 
        /// <summary>
        /// Primitive types alias (string, int, ...)
        /// </summary>
        public static readonly ReferenceType[] CSharpPrimitiveTypes = {
                        new ReferenceType("object", typeof(object)),
                        new ReferenceType("string", typeof(string)),
                        new ReferenceType("char", typeof(char)),
                        new ReferenceType("bool", typeof(bool)),
                        new ReferenceType("sbyte", typeof(sbyte)),
                        new ReferenceType("byte", typeof(byte)),
                        new ReferenceType("short", typeof(short)),
                        new ReferenceType("ushort", typeof(ushort)),
                        new ReferenceType("int", typeof(int)),
                        new ReferenceType("uint", typeof(uint)),
                        new ReferenceType("long", typeof(long)),
                        new ReferenceType("ulong", typeof(ulong)),
                        new ReferenceType("float", typeof(float)),
                        new ReferenceType("double", typeof(double)),
                        new ReferenceType("decimal", typeof(decimal))
                };
 
        /// <summary>
        /// Common .NET Types (Math, Convert, Enumerable)
        /// </summary>
        public static readonly ReferenceType[] CommonTypes = {
            new ReferenceType(typeof(Math)),
            new ReferenceType(typeof(Convert)),
            new ReferenceType(typeof(System.Linq.Enumerable))
        };
 
        /// <summary>
        /// true, false, null
        /// </summary>
        public static readonly Identifier[] Literals = {
                    new Identifier("true", Expression.Constant(true)),
                    new Identifier("false", Expression.Constant(false)),
                    new Identifier("null", ParserConstants.NullLiteralExpression)
                };
 
        [Obsolete("Use ReservedKeywords")]
        public static readonly string[] ReserverKeywords = ParserConstants.ReservedKeywords;
 
        public static readonly string[] ReservedKeywords = ParserConstants.ReservedKeywords;
    }
}