Files
MicrosoftIris/UIX.Debug/Data/InterpreterEntry.cs
T

37 lines
916 B
C#
Raw Normal View History

2022-06-07 01:00:15 -05:00
using System;
2022-06-07 01:16:00 -05:00
using System.Linq;
2022-06-07 01:00:15 -05:00
namespace Microsoft.Iris.Debug.Data
{
public class InterpreterEntry
{
public InterpreterEntry(object opCode, params OpCodeArgument[] args)
{
OpCode = opCode;
Arguments = args;
}
public object OpCode { get; private set; }
public OpCodeArgument[] Arguments { get; private set; }
2022-06-07 01:16:00 -05:00
public override string ToString()
{
var args =
#if ZUNE5
(System.Collections.Generic.IEnumerable<OpCodeArgument>)Arguments;
#else
Arguments.Select(a => a.ToString()).ToArray();
#endif
return $"{OpCode}({string.Join(", ", args)})";
}
2022-06-07 01:00:15 -05:00
}
public class OpCodeArgument
{
public Type Type { get; private set; }
public object Value { get; private set; }
public override string ToString() => $"{Type} {Value}";
}
}