-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathIExpression.cs
More file actions
29 lines (27 loc) · 1.14 KB
/
IExpression.cs
File metadata and controls
29 lines (27 loc) · 1.14 KB
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
namespace StringMath.Expressions
{
/// <summary>Available expression types.</summary>
internal enum ExpressionType
{
/// <summary><see cref="Expressions.UnaryExpression"/>.</summary>
UnaryExpression,
/// <summary><see cref="Expressions.BinaryExpression"/>.</summary>
BinaryExpression,
/// <summary><see cref="Expressions.VariableExpression"/>.</summary>
VariableExpression,
/// <summary><see cref="Expressions.ConstantExpression"/>.</summary>
ConstantExpression,
/// <summary><see cref="Expressions.InvocationExpression"/>.</summary>
Invocation,
}
/// <summary>Contract for expressions.</summary>
internal interface IExpression
{
/// <summary>The type of the expression.</summary>
ExpressionType Type { get; }
/// <summary>Creates a string representation of the expression in the provided context.</summary>
/// <param name="context">The context in which this expression is printed.</param>
/// <returns>A string representation of the expression.</returns>
string ToString(IMathContext context);
}
}