1 |
#Region "Microsoft.VisualBasic::d103e3655be3a47d70ff530b385d5d0d, Microsoft.VisualBasic.Core\Scripting\TokenIcer\LangModels\OperatorExpression.vb"
|
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 |
#End Region
|
45 |
|
46 |
Imports System.Linq.Expressions
|
47 |
|
48 |
Namespace Scripting.TokenIcer
|
49 |
|
50 |
Public Module OperatorExpression
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
Public ReadOnly Property Linq2Symbols As New Dictionary(Of ExpressionType, String)
|
57 |
Public ReadOnly Property opName2Linq As New Dictionary(Of String, ExpressionType)
|
58 |
|
59 |
Sub New()
|
60 |
Call __opName2Linq()
|
61 |
Call __linq2Symbols()
|
62 |
End Sub
|
63 |
|
64 |
Const op_LessThan$ = NameOf(op_LessThan)
|
65 |
Const op_GreaterThan$ = NameOf(op_GreaterThan)
|
66 |
Const op_LessThanOrEqual$ = NameOf(op_LessThanOrEqual)
|
67 |
Const op_GreaterThanOrEqual$ = NameOf(op_GreaterThanOrEqual)
|
68 |
Const op_Subtraction$ = NameOf(op_Subtraction)
|
69 |
Const op_Division$ = NameOf(op_Division)
|
70 |
Const op_Implicit$ = NameOf(op_Implicit)
|
71 |
Const op_UnaryPlus$ = NameOf(op_UnaryPlus)
|
72 |
Const op_Addition$ = NameOf(op_Addition)
|
73 |
Const op_LeftShift$ = NameOf(op_LeftShift)
|
74 |
Const op_Equality$ = NameOf(op_Equality)
|
75 |
Const op_Inequality$ = NameOf(op_Inequality)
|
76 |
Const op_Concatenate$ = NameOf(op_Concatenate)
|
77 |
Const op_Multiply$ = NameOf(op_Multiply)
|
78 |
Const op_Exponent$ = NameOf(op_Exponent)
|
79 |
Const op_Modulus$ = NameOf(op_Modulus)
|
80 |
Const op_Like$ = NameOf(op_Like)
|
81 |
Const op_ExclusiveOr$ = NameOf(op_ExclusiveOr)
|
82 |
Const op_BitwiseAnd$ = NameOf(op_BitwiseAnd)
|
83 |
Const op_BitwiseOr$ = NameOf(op_BitwiseOr)
|
84 |
Const op_IntegerDivision$ = NameOf(op_IntegerDivision)
|
85 |
Const op_UnaryNegation$ = NameOf(op_UnaryNegation)
|
86 |
|
87 |
Private Sub __opName2Linq()
|
88 |
With opName2Linq
|
89 |
Call .Add(op_Addition, ExpressionType.Add)
|
90 |
Call .Add(op_BitwiseAnd, ExpressionType.And)
|
91 |
Call .Add(op_BitwiseOr, ExpressionType.Or)
|
92 |
Call .Add(op_Division, ExpressionType.Divide)
|
93 |
Call .Add(op_Equality, ExpressionType.Equal)
|
94 |
Call .Add(op_ExclusiveOr, ExpressionType.ExclusiveOr)
|
95 |
Call .Add(op_Exponent, ExpressionType.Power)
|
96 |
Call .Add(op_GreaterThan, ExpressionType.GreaterThan)
|
97 |
Call .Add(op_GreaterThanOrEqual, ExpressionType.GreaterThanOrEqual)
|
98 |
Call .Add(op_Implicit, ExpressionType.Convert)
|
99 |
Call .Add(op_Inequality, ExpressionType.NotEqual)
|
100 |
Call .Add(op_LeftShift, ExpressionType.LeftShift)
|
101 |
Call .Add(op_LessThan, ExpressionType.LessThan)
|
102 |
Call .Add(op_LessThanOrEqual, ExpressionType.LessThanOrEqual)
|
103 |
Call .Add(op_Modulus, ExpressionType.Modulo)
|
104 |
Call .Add(op_Multiply, ExpressionType.Multiply)
|
105 |
Call .Add(op_Subtraction, ExpressionType.Subtract)
|
106 |
Call .Add(op_UnaryPlus, ExpressionType.UnaryPlus)
|
107 |
Call .Add(op_UnaryNegation, ExpressionType.Negate)
|
108 |
End With
|
109 |
End Sub
|
110 |
|
111 |
Private Sub __linq2Symbols()
|
112 |
With Linq2Symbols
|
113 |
Call .Add(ExpressionType.Add, "+")
|
114 |
Call .Add(ExpressionType.AddAssign, "+=")
|
115 |
Call .Add(ExpressionType.AddAssignChecked, "+=")
|
116 |
Call .Add(ExpressionType.AddChecked, "+")
|
117 |
Call .Add(ExpressionType.And, "And")
|
118 |
Call .Add(ExpressionType.AndAlso, "AndAlso")
|
119 |
Call .Add(ExpressionType.Assign, "=")
|
120 |
Call .Add(ExpressionType.Convert, "CType")
|
121 |
Call .Add(ExpressionType.ConvertChecked, "CType")
|
122 |
Call .Add(ExpressionType.Decrement, "-")
|
123 |
Call .Add(ExpressionType.Divide, "/")
|
124 |
Call .Add(ExpressionType.DivideAssign, "/=")
|
125 |
Call .Add(ExpressionType.Equal, "=")
|
126 |
Call .Add(ExpressionType.ExclusiveOr, "Xor")
|
127 |
Call .Add(ExpressionType.GreaterThan, ">")
|
128 |
Call .Add(ExpressionType.GreaterThanOrEqual, ">=")
|
129 |
Call .Add(ExpressionType.Increment, "+")
|
130 |
Call .Add(ExpressionType.IsFalse, "IsFalse")
|
131 |
Call .Add(ExpressionType.IsTrue, "IsTrue")
|
132 |
Call .Add(ExpressionType.LeftShift, "<<")
|
133 |
Call .Add(ExpressionType.LeftShiftAssign, "<<=")
|
134 |
Call .Add(ExpressionType.LessThan, "<")
|
135 |
Call .Add(ExpressionType.LessThanOrEqual, "<=")
|
136 |
Call .Add(ExpressionType.Modulo, "Mod")
|
137 |
Call .Add(ExpressionType.Multiply, "*")
|
138 |
Call .Add(ExpressionType.MultiplyAssign, "*=")
|
139 |
Call .Add(ExpressionType.MultiplyAssignChecked, "*=")
|
140 |
Call .Add(ExpressionType.MultiplyChecked, "*")
|
141 |
Call .Add(ExpressionType.Negate, "-")
|
142 |
Call .Add(ExpressionType.NegateChecked, "-")
|
143 |
Call .Add(ExpressionType.Not, "Not")
|
144 |
Call .Add(ExpressionType.NotEqual, "<>")
|
145 |
Call .Add(ExpressionType.Or, "Or")
|
146 |
Call .Add(ExpressionType.OrElse, "OrElse")
|
147 |
Call .Add(ExpressionType.Power, "^")
|
148 |
Call .Add(ExpressionType.PowerAssign, "^=")
|
149 |
Call .Add(ExpressionType.RightShift, ">>")
|
150 |
Call .Add(ExpressionType.RightShiftAssign, ">>=")
|
151 |
Call .Add(ExpressionType.Subtract, "-")
|
152 |
Call .Add(ExpressionType.SubtractAssign, "-=")
|
153 |
Call .Add(ExpressionType.SubtractAssignChecked, "-=")
|
154 |
Call .Add(ExpressionType.SubtractChecked, "-")
|
155 |
Call .Add(ExpressionType.TypeAs, "TryCast")
|
156 |
Call .Add(ExpressionType.UnaryPlus, "+")
|
157 |
End With
|
158 |
End Sub
|
159 |
End Module
|
160 |
End Namespace
|