Amogulator/Suslang/Bytecode.cs
2023-03-14 12:53:56 +01:00

42 lines
1.7 KiB
C#

namespace Amogulator.Suslang;
public interface Operation {
string operationString();
}
public class PushIntOperation : Operation {
public int value;
public string operationString() => $"PushIntOperation {{ {value} }}";
}
public class PushFloatOperation : Operation {
public double value;
public string operationString() => $"PushFloatOperation {{ {value} }}";
}
public class PushStringOperation : Operation {
public string value;
public string operationString() => $"PushStringOperation {{ \"{value}\" }}";
}
public class PushBoolOperation : Operation {
public bool value;
public string operationString() => $"PushBoolOperation {{ {value} }}";
}
public class AddIntOperation : Operation { public string operationString() => $"AddIntOperation"; }
public class SubtractIntOperation : Operation { public string operationString() => $"SubtractIntOperation"; }
public class MultiplyIntOperation : Operation { public string operationString() => $"MultiplyIntOperation"; }
public class DivideIntOperation : Operation { public string operationString() => $"DivideIntOperation"; }
public class ModuloIntOperation : Operation { public string operationString() => $"ModuloIntOperation"; }
public class AddFloatOperation : Operation { public string operationString() => $"AddFloatOperation"; }
public class SubtractFloatOperation : Operation { public string operationString() => $"SubtractFloatOperation"; }
public class MultiplyFloatOperation : Operation { public string operationString() => $"MultiplyFloatOperation"; }
public class DivideFloatOperation : Operation { public string operationString() => $"DivideFloatOperation"; }
public class ModuloFloatOperation : Operation { public string operationString() => $"ModuloFloatOperation"; }