Beispiel #1
0
        public override dynamic Evaluate(Env.Environment env)
        {
            dynamic value = env.Get(this.name);

            this.Value = value.Value;
            return(value);
        }
Beispiel #2
0
        public override dynamic Evaluate(Env.Environment env)
        {
            this.env = env;
            Tree.List list  = env.Get(this.listName);
            int       index = int.Parse(this.index.Evaluate(env).Value.ToString());

            this.Value = list.Get(index);
            return(this.Value);
        }
Beispiel #3
0
        public override dynamic Evaluate(Env.Environment env)
        {
            var res = new Tree.Boolean(condition.Evaluate(env)).Value;

            if (res)
            {
                Function f = thenBlock as Function;
                if (f != null)
                {
                    this.Value = f.Solve(env);
                }
                else
                {
                    this.Value = thenBlock.Evaluate(env);
                }
                return(this.Value);
            }
            else
            {
                if (elseBlock != null)
                {
                    Function f = elseBlock as Function;
                    if (f != null)
                    {
                        this.Value = f.Solve(env);
                    }
                    else
                    {
                        this.Value = elseBlock.Evaluate(env);
                    }
                    return(this.Value);
                }
                else
                {
                    this.Value = new Tree.Null();
                    return(this.Value);
                }
            }
        }
Beispiel #4
0
 public override dynamic Evaluate(Env.Environment env)
 {
     Tree.List list = env.Get(this.listName);
     this.Value = list.Get(this.index.Evaluate(env).Value);
     return(this.Value);
 }