BaseFunction
using CLanguage.Types;
using System.Runtime.CompilerServices;
namespace CLanguage.Interpreter
{
[System.Runtime.CompilerServices.NullableContext(1)]
[System.Runtime.CompilerServices.Nullable(0)]
public abstract class BaseFunction
{
public string Name { get; set; } = "";
public string NameContext { get; set; } = "";
public CFunctionType FunctionType { get; set; } = CFunctionType.VoidProcedure;
public virtual void Init(CInterpreter state)
{
}
public abstract void Step(CInterpreter state, ExecutionFrame frame);
public override string ToString()
{
if (!string.IsNullOrEmpty(NameContext))
return NameContext + "::" + Name;
return Name;
}
}
}