Esempio n. 1
0
        public override BasicNode Eval(BasicEnvironment env)
        {
            env.InstructionCount++;
            ExpressionNode[] evaledArgs = new ExpressionNode[Arguments.Length];
            for (int i = 0; i < Arguments.Length; i++)
            {
                var evArg = Arguments[i].Eval(env);
                if (evArg.IsAbort())
                {
                    return(evArg);
                }
                evaledArgs[i] = evArg as ConstantNode;
            }
            BasicNode result;

            switch (Functor)
            {
            case "TAB":
                result = ControlNode.Make(EvalResultKind.Tab, evaledArgs[0]);
                break;

            default: result = env.RuntimeError(ERuntimeErrors.CallToUnknownFunction, Functor); break;
            }
            return(result);
        }
Esempio n. 2
0
 public override BasicNode Eval(BasicEnvironment env)
 {
     return(ControlNode.Make(EvalResultKind.End, this));
 }