/// <summary> /// Restores value of invoked function. /// </summary> /// <param name="node"></param> public void Visit(CachedFunctionNode node) { var argTypes = node.Descendants.Select(f => f.ReturnType).ToArray(); var registeredFunction = _metadatas.GetMethod(node.Name, argTypes); switch (registeredFunction.ReturnType.Name) { case nameof(DateTimeOffset): Instructions.Add(new RestoreValue(registeredFunction, (m, o) => m.Datetimes.Push((DateTimeOffset)o))); break; default: Instructions.Add(new RestoreValue(registeredFunction, (m, o) => m.Values.Push((long)o))); break; } }
/// <summary> /// Visit CachedFunction. /// </summary> /// <param name="node">The CachedFunction node.</param> public void Visit(CachedFunctionNode node) { node.Accept(_visitor); }
public override void Visit(CachedFunctionNode node) { }
/// <summary> /// Visit CachedFunction node. /// </summary> /// <param name="node">CachedFunction node of AST.</param> public abstract void Visit(CachedFunctionNode node);
public void Visit(CachedFunctionNode node) { }