|
1 | | -namespace Ramstack.Parsing.Expressions; |
2 | | - |
3 | | -/// <summary> |
4 | | -/// Defines the possible types of nodes in an expression tree used by the expression parser. |
5 | | -/// </summary> |
6 | | -public enum ExprKind |
7 | | -{ |
8 | | - /// <summary> |
9 | | - /// Represents a reference to a variable, parameter, or member in the expression. |
10 | | - /// </summary> |
11 | | - /// <example> |
12 | | - /// In the expression <c>x</c>, this would indicate a reference to the variable "x". |
13 | | - /// </example> |
14 | | - Reference, |
15 | | - |
16 | | - /// <summary> |
17 | | - /// Represents a constant value, such as a number or string literal. |
18 | | - /// </summary> |
19 | | - /// <example> |
20 | | - /// In the expression <c>42</c> or <c>"hello"</c>, this denotes a literal value. |
21 | | - /// </example> |
22 | | - Literal, |
23 | | - |
24 | | - /// <summary> |
25 | | - /// Represents a binary operation, such as addition or subtraction, involving two operands. |
26 | | - /// </summary> |
27 | | - /// <example> |
28 | | - /// In the expression <c>a + b</c>, this indicates the addition operation. |
29 | | - /// </example> |
30 | | - Binary, |
31 | | - |
32 | | - /// <summary> |
33 | | - /// Represents a method invocation within the expression. |
34 | | - /// </summary> |
35 | | - /// <example> |
36 | | - /// In the expression <c>Math.Abs(-5)</c>, this denotes the method call to "Abs". |
37 | | - /// </example> |
38 | | - Call, |
39 | | - |
40 | | - /// <summary> |
41 | | - /// Represents an indexing operation or access to a parameterized property. |
42 | | - /// </summary> |
43 | | - /// <example> |
44 | | - /// In the expression <c>array[0]</c>, this indicates an index operation. |
45 | | - /// </example> |
46 | | - Index, |
47 | | - |
48 | | - /// <summary> |
49 | | - /// Represents a read operation on a field or property of an object. |
50 | | - /// </summary> |
51 | | - /// <example> |
52 | | - /// In the expression <c>obj.Property</c>, this denotes accessing the "Property" member. |
53 | | - /// </example> |
54 | | - MemberAccess, |
55 | | - |
56 | | - /// <summary> |
57 | | - /// Represents a unary operation, such as negation or logical NOT, involving a single operand. |
58 | | - /// </summary> |
59 | | - /// <example> |
60 | | - /// In the expression <c>-x</c>, this indicates the negation operation. |
61 | | - /// </example> |
62 | | - Unary, |
63 | | - |
64 | | - /// <summary> |
65 | | - /// Represents a conditional (ternary) operation with a condition, true branch, and false branch. |
66 | | - /// </summary> |
67 | | - /// <example> |
68 | | - /// In the expression <c>a > b ? a : b</c>, this denotes a conditional operation. |
69 | | - /// </example> |
70 | | - Conditional, |
71 | | - |
72 | | - /// <summary> |
73 | | - /// Represents an expression enclosed in parentheses to enforce precedence or grouping. |
74 | | - /// </summary> |
75 | | - /// <example> |
76 | | - /// In the expression <c>(a + b)</c>, this indicates a parenthesized sub-expression. |
77 | | - /// </example> |
78 | | - Parenthesized |
79 | | -} |
| 1 | +namespace Ramstack.Parsing.Expressions; |
| 2 | + |
| 3 | +/// <summary> |
| 4 | +/// Defines the possible types of nodes in an expression tree used by the expression parser. |
| 5 | +/// </summary> |
| 6 | +public enum ExprKind |
| 7 | +{ |
| 8 | + /// <summary> |
| 9 | + /// Represents a reference to a variable, parameter, or member in the expression. |
| 10 | + /// </summary> |
| 11 | + /// <example> |
| 12 | + /// In the expression <c>x</c>, this would indicate a reference to the variable "x". |
| 13 | + /// </example> |
| 14 | + Reference, |
| 15 | + |
| 16 | + /// <summary> |
| 17 | + /// Represents a constant value, such as a number or string literal. |
| 18 | + /// </summary> |
| 19 | + /// <example> |
| 20 | + /// In the expression <c>42</c> or <c>"hello"</c>, this denotes a literal value. |
| 21 | + /// </example> |
| 22 | + Literal, |
| 23 | + |
| 24 | + /// <summary> |
| 25 | + /// Represents a binary operation, such as addition or subtraction, involving two operands. |
| 26 | + /// </summary> |
| 27 | + /// <example> |
| 28 | + /// In the expression <c>a + b</c>, this indicates the addition operation. |
| 29 | + /// </example> |
| 30 | + Binary, |
| 31 | + |
| 32 | + /// <summary> |
| 33 | + /// Represents a method invocation within the expression. |
| 34 | + /// </summary> |
| 35 | + /// <example> |
| 36 | + /// In the expression <c>Math.Abs(-5)</c>, this denotes the method call to "Abs". |
| 37 | + /// </example> |
| 38 | + Call, |
| 39 | + |
| 40 | + /// <summary> |
| 41 | + /// Represents an indexing operation or access to a parameterized property. |
| 42 | + /// </summary> |
| 43 | + /// <example> |
| 44 | + /// In the expression <c>array[0]</c>, this indicates an index operation. |
| 45 | + /// </example> |
| 46 | + Index, |
| 47 | + |
| 48 | + /// <summary> |
| 49 | + /// Represents a read operation on a field or property of an object. |
| 50 | + /// </summary> |
| 51 | + /// <example> |
| 52 | + /// In the expression <c>obj.Property</c>, this denotes accessing the "Property" member. |
| 53 | + /// </example> |
| 54 | + MemberAccess, |
| 55 | + |
| 56 | + /// <summary> |
| 57 | + /// Represents a unary operation, such as negation or logical NOT, involving a single operand. |
| 58 | + /// </summary> |
| 59 | + /// <example> |
| 60 | + /// In the expression <c>-x</c>, this indicates the negation operation. |
| 61 | + /// </example> |
| 62 | + Unary, |
| 63 | + |
| 64 | + /// <summary> |
| 65 | + /// Represents a conditional (ternary) operation with a condition, true branch, and false branch. |
| 66 | + /// </summary> |
| 67 | + /// <example> |
| 68 | + /// In the expression <c>a > b ? a : b</c>, this denotes a conditional operation. |
| 69 | + /// </example> |
| 70 | + Conditional, |
| 71 | + |
| 72 | + /// <summary> |
| 73 | + /// Represents an expression enclosed in parentheses to enforce precedence or grouping. |
| 74 | + /// </summary> |
| 75 | + /// <example> |
| 76 | + /// In the expression <c>(a + b)</c>, this indicates a parenthesized sub-expression. |
| 77 | + /// </example> |
| 78 | + Parenthesized |
| 79 | +} |
0 commit comments