xronos /Microsoft.Scripting/Runtime/Operators.cs

Language C# Lines 376
MD5 Hash 9bab7eb9c2c530f5866be5d6034be281 Estimated Cost $2,560 (why?)
Repository https://bitbucket.org/stefanrusek/xronos View Raw File
  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
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
/* ****************************************************************************
 *
 * Copyright (c) Microsoft Corporation. 
 *
 * This source code is subject to terms and conditions of the Microsoft Public License. A 
 * copy of the license can be found in the License.html file at the root of this distribution. If 
 * you cannot locate the  Microsoft Public License, please send an email to 
 * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
 * by the terms of the Microsoft Public License.
 *
 * You must not remove this notice, or any other, from this software.
 *
 *
 * ***************************************************************************/

#if CODEPLEX_40
using System;
#else
using System; using Microsoft;
#endif

namespace Microsoft.Scripting.Runtime {
    /// <summary>
    /// Enum representing different types of operators.
    /// 
    /// Operators can be Unary, Binary, or Ternary.  An individual operator can have one or 
    /// more arity.  
    /// 
    /// Each operator is associated with a standard name.  If a method is named using the standard
    /// name and is marked with OperatorMethodAttribute then the method will automatically be
    /// detected as an operator.
    /// </summary>
    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1717:OnlyFlagsEnumsShouldHavePluralNames")] // TODO: fix
    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2217:DoNotMarkEnumsWithFlags")]
    public enum Operators {
        None,
        /// <summary>
        /// Binary operator.
        /// 
        /// Attempt to call the object.  Arguments are the object and the arguments for the call.  The
        /// arguments for the call can either be an object array (normal call) or a KwCallInfo class for
        /// performing a keyword based call.
        /// 
        /// The standard name for this operator is "Call".
        /// </summary>
        Call,                       
        /// <summary>
        /// Unary operator.
        /// 
        /// Returns a string which defines the object in code or a language specific format for
        /// objects which cannot be represented in code.  This operator generally is not used in
        /// a non-language specific scenario.
        /// </summary>
        CodeRepresentation,         
        /// <summary>
        /// Unary operator.
        /// 
        /// Gets the list of members that belong to the current object returned as an IList of string
        /// </summary>
        MemberNames,
        /// <summary>
        /// Unary operator.
        /// 
        /// Gets various documentation about the object returned as a string
        /// </summary>
        Documentation,
        /// <summary>
        /// Unary operator.
        /// 
        /// Gets information about the type of parameters, returned as a string.
        /// </summary>
        CallSignatures,
        /// <summary>
        /// Unary operator.
        /// 
        /// Checks whether the object is callable or not, returns true if it is.
        /// </summary>
        IsCallable,

        #region Generated Table of Operators

        // *** BEGIN GENERATED CODE ***
        // generated by function: gen_OperatorTable from: generate_ops.py

        ///<summary>Operator for performing add</summary>
        Add,
        ///<summary>Operator for performing sub</summary>
        Subtract,
        ///<summary>Operator for performing pow</summary>
        Power,
        ///<summary>Operator for performing mul</summary>
        Multiply,
        ///<summary>Operator for performing floordiv</summary>
        FloorDivide,
        ///<summary>Operator for performing div</summary>
        Divide,
        ///<summary>Operator for performing truediv</summary>
        TrueDivide,
        ///<summary>Operator for performing mod</summary>
        Mod,
        ///<summary>Operator for performing lshift</summary>
        LeftShift,
        ///<summary>Operator for performing rshift</summary>
        RightShift,
        ///<summary>Operator for performing and</summary>
        BitwiseAnd,
        ///<summary>Operator for performing or</summary>
        BitwiseOr,
        ///<summary>Operator for performing xor</summary>
        ExclusiveOr,
        ///<summary>Operator for performing lt</summary>
        LessThan,
        ///<summary>Operator for performing gt</summary>
        GreaterThan,
        ///<summary>Operator for performing le</summary>
        LessThanOrEqual,
        ///<summary>Operator for performing ge</summary>
        GreaterThanOrEqual,
        ///<summary>Operator for performing eq</summary>
        Equals,
        ///<summary>Operator for performing ne</summary>
        NotEquals,
        ///<summary>Operator for performing lg</summary>
        LessThanGreaterThan,
        ///<summary>Operator for performing in-place add</summary>
        InPlaceAdd,
        ///<summary>Operator for performing in-place sub</summary>
        InPlaceSubtract,
        ///<summary>Operator for performing in-place pow</summary>
        InPlacePower,
        ///<summary>Operator for performing in-place mul</summary>
        InPlaceMultiply,
        ///<summary>Operator for performing in-place floordiv</summary>
        InPlaceFloorDivide,
        ///<summary>Operator for performing in-place div</summary>
        InPlaceDivide,
        ///<summary>Operator for performing in-place truediv</summary>
        InPlaceTrueDivide,
        ///<summary>Operator for performing in-place mod</summary>
        InPlaceMod,
        ///<summary>Operator for performing in-place lshift</summary>
        InPlaceLeftShift,
        ///<summary>Operator for performing in-place rshift</summary>
        InPlaceRightShift,
        ///<summary>Operator for performing in-place and</summary>
        InPlaceBitwiseAnd,
        ///<summary>Operator for performing in-place or</summary>
        InPlaceBitwiseOr,
        ///<summary>Operator for performing in-place xor</summary>
        InPlaceExclusiveOr,
        ///<summary>Operator for performing reverse add</summary>
        ReverseAdd,
        ///<summary>Operator for performing reverse sub</summary>
        ReverseSubtract,
        ///<summary>Operator for performing reverse pow</summary>
        ReversePower,
        ///<summary>Operator for performing reverse mul</summary>
        ReverseMultiply,
        ///<summary>Operator for performing reverse floordiv</summary>
        ReverseFloorDivide,
        ///<summary>Operator for performing reverse div</summary>
        ReverseDivide,
        ///<summary>Operator for performing reverse truediv</summary>
        ReverseTrueDivide,
        ///<summary>Operator for performing reverse mod</summary>
        ReverseMod,
        ///<summary>Operator for performing reverse lshift</summary>
        ReverseLeftShift,
        ///<summary>Operator for performing reverse rshift</summary>
        ReverseRightShift,
        ///<summary>Operator for performing reverse and</summary>
        ReverseBitwiseAnd,
        ///<summary>Operator for performing reverse or</summary>
        ReverseBitwiseOr,
        ///<summary>Operator for performing reverse xor</summary>
        ReverseExclusiveOr,

        // *** END GENERATED CODE ***

        #endregion

        /// <summary>
        /// Binary operator.
        /// 
        /// Checks to see if the instance contains another object.  Returns true or false.
        /// 
        /// The standard name for this operator is "Contains".
        /// </summary>
        Contains,                   
        /// <summary>
        /// n-ary operator.
        /// 
        /// Gets the value at the specified index from the instance.
        /// 
        /// One or more indexes can be provided as individual arguments.
        /// Obsolete: Use GetIndexAction instead
        /// </summary>
        GetItem,                    
        /// <summary>
        /// n-ary operator.
        /// 
        /// Sets the value at the specified index in the instance.
        /// 
        /// One or more indexes can be provided as individual arguments.  The last value provided is the value to be set.
        /// Obsolete: Use SetIndexAction instead
        /// </summary>
        SetItem,                    
        /// <summary>
        /// n-ary operator.
        /// 
        /// Removes the item from the specified index in the instance.
        /// 
        /// One or more indexes can be provided as individual arguments.
        /// Obsolete: Use DeleteIndexAction instead
        /// </summary>
        DeleteItem,
        /// <summary>
        /// Binary or Ternary operator.
        /// 
        /// Gets the specified range of elements (slice) from the instance.
        /// 
        /// The slice parameters may include the start index, the end index, and the step value.  The step value is optional.
        /// 
        /// A value of Type.Missing may be provided if no parameter was explicitly provided for a start, stop or step parameter.
        /// </summary>
        GetSlice,
        /// <summary>
        /// n-ary operator.
        /// 
        /// Sets the specified range of elements in the instance.
        /// 
        /// The slice parameters may include the start index, the end index, and the step value.  The step
        /// value is optional.  The last parameter is the value to be assigned.
        /// 
        /// A value of Type.Missing may be provided if no parameter was explicitly provided for a start, stop or step parameter.
        /// </summary>
        SetSlice,
        /// <summary>
        /// n-ary operator.
        /// 
        /// Removes the specified range of elements from the instance.
        /// 
        /// The slice parameters may include the start index, the end index, and the step value.  The step value is
        /// optional.
        /// 
        /// A value of Type.Missing may be provided if no parameter was explicitly provided for a start, stop or step parameter.
        /// </summary>
        DeleteSlice,
        /// <summary>
        /// Unary operator.
        /// 
        /// Returns the number of items stored in the object.
        /// </summary>      
        Length,                     
        /// <summary>
        /// Binary operator.
        /// 
        /// Compares two instances returning an integer indicating the relationship between them.  May
        /// throw if the object types are uncomparable.
        /// 
        /// The standard name for this operator is "Compare".
        /// </summary>
        Compare,      
        /// <summary>
        /// Binary operator.
        /// 
        /// Returns both the dividend and quotioent of x / y.
        /// </summary>
        DivMod,                     
        /// <summary>
        /// Binary operator.
        /// 
        /// Returns both the dividend and quotient of y / x.
        /// </summary>
        ReverseDivMod,              
        /// <summary>
        /// Member lookup customization (called after type lookup).
        /// 
        /// Arguments are the instance to get the member from and a SymbolId which represents the member.
        /// 
        /// The return value is the member.
        /// 
        /// The standard name for this operator is "GetMember".
        /// </summary>
        GetMember,                  
        /// <summary>
        /// Member lookup customization for bound attributes
        /// 
        /// Arguments are the instance to get the member from and a SymbolId which represents the bound member.
        /// 
        /// The return value is the bound member.
        /// 
        /// /// The standard name for this operator is "GetBoundMember".
        /// </summary>
        GetBoundMember,            
        /// <summary>
        /// Member set customization.
        /// 
        /// Arguments are the instance, the SymbolId to get, and the new value for the member.
        /// 
        /// The return value is ignored.
        /// 
        /// The standard name for this operator is "SetMember".
        /// </summary>
        SetMember,   
        /// <summary>
        /// Member delete customization.
        /// 
        /// Arguments are the instance and the SymbolId for the member to delete.
        /// 
        /// The return value is ignored.
        /// 
        /// The standard name for this operator is "DeleteMember".
        /// </summary>
        DeleteMember,      
        /// <summary>
        /// Attribute customization operator.  Returns a list of names that should be displayed as
        /// being part of the object.
        /// 
        /// Arguments are the instance to get the list of member names from.
        /// 
        /// Return value is IList&lt;SymbolId&gt;.
        /// 
        /// /// The standard name for this operator is "GetMemberNames".
        /// </summary>
        GetMemberNames,             
        /// <summary>
        /// Unary operator.
        /// 
        /// Get the absolute value of the instance.
        /// </summary>
        AbsoluteValue,
        /// <summary>
        /// Unary operator.
        /// 
        /// Gets the positive value of the instance.
        /// </summary>
        Positive,                   
        /// <summary>
        /// Unary operator.
        /// 
        /// Negates the instance and return the new value.
        /// </summary>        
        Negate,                     
        /// <summary>
        /// Unary operator.
        /// 
        /// Returns the ones complement of the instance.
        /// </summary>
        OnesComplement,             

        RightShiftUnsigned,         //Operator for performing rshiftu
        InPlaceRightShiftUnsigned,  //Operator for performing in-place rshiftu
        ReverseRightShiftUnsigned,  //Operator for performing reverse rshiftu
        RightShiftSigned,  
        Not,                        // boolean negation
        Increment,
        Decrement,
        Assign,
        IsFalse,
        IsTrue,
        Or,
        And,
        IntegralDivide,
        Concatenate,
        Like,
        Comma,

        GetEnumerator,
        Dispose,

        IdMask = 0x7fffffff,
        UserDefinedFlag = unchecked((int)0x80000000),
    }
}
Back to Top