2025-07-17 14:07:44 -05:00
|
|
|
using Microsoft.Iris.Asm;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Linq.Expressions;
|
2025-07-17 00:46:05 -05:00
|
|
|
|
|
|
|
|
namespace Microsoft.Iris.DecompXml.Mock;
|
|
|
|
|
|
|
|
|
|
internal class IrisExpression : Expression
|
|
|
|
|
{
|
2025-07-17 14:30:19 -05:00
|
|
|
public virtual string Decompile(DecompileContext context) => ToString();
|
2025-07-17 14:07:44 -05:00
|
|
|
|
|
|
|
|
public static Expression ToExpression(object p)
|
|
|
|
|
{
|
|
|
|
|
return p switch
|
|
|
|
|
{
|
|
|
|
|
null => Constant(null),
|
|
|
|
|
Expression expr => expr,
|
|
|
|
|
Disassembler.RawConstantInfo constantInfo => new IrisConstantExpression(constantInfo.Value, constantInfo.Type),
|
|
|
|
|
|
|
|
|
|
_ => throw new NotImplementedException()
|
|
|
|
|
};
|
|
|
|
|
}
|
2025-07-17 00:46:05 -05:00
|
|
|
}
|