public static DekiScriptExpression Map(Location location, DekiScriptGenerator generator, params DekiScriptMapConstructor.FieldConstructor[] fields)
 {
     return(new DekiScriptMapConstructor(generator, fields)
     {
         Location = location
     });
 }
 public static DekiScriptExpression ForeachStatement(Location location, DekiScriptGenerator generator, DekiScriptExpression body)
 {
     return(new DekiScriptForeach(generator, body)
     {
         Location = location
     });
 }
 public static DekiScriptExpression List(Location location, DekiScriptGenerator generator, params DekiScriptExpression[] items)
 {
     return(new DekiScriptListConstructor(generator, items)
     {
         Location = location
     });
 }
 public static DekiScriptExpression ForeachStatement(Location location, DekiScriptGenerator generator, IEnumerable <DekiScriptExpression> body)
 {
     return(new DekiScriptForeach(generator, Block(location, body))
     {
         Location = location
     });
 }
Beispiel #5
0
 //--- Constructors ---
 internal DekiScriptForeach(DekiScriptGenerator generator, DekiScriptExpression block)
 {
     if (generator == null)
     {
         throw new ArgumentNullException("generator");
     }
     if (block == null)
     {
         throw new ArgumentNullException("block");
     }
     this.Generator = generator;
     this.Body      = block;
 }
Beispiel #6
0
 //--- Constructors ---
 internal DekiScriptListConstructor(DekiScriptGenerator generator, params DekiScriptExpression[] args)
 {
     if (args == null)
     {
         throw new ArgumentNullException("args");
     }
     for (int i = 0; i < args.Length; ++i)
     {
         if (args[i] == null)
         {
             throw new ArgumentNullException(string.Format("args[{0}]", i));
         }
     }
     this.Generator = generator;
     this.Items     = args;
 }
 //--- Constructors ---
 internal DekiScriptMapConstructor(DekiScriptGenerator generator, params FieldConstructor[] fields)
 {
     if (fields == null)
     {
         throw new ArgumentNullException("fields");
     }
     for (int i = 0; i < fields.Length; ++i)
     {
         if (fields[i] == null)
         {
             throw new ArgumentNullException(string.Format("fields[{0}]", i));
         }
     }
     this.Generator = generator;
     this.Fields    = fields;
 }
Beispiel #8
0
 //--- Constructors ---
 public DekiScriptGeneratorForeachValue(Location location, string[] vars, DekiScriptExpression collection, DekiScriptGenerator next) : base(location, next)
 {
     if (vars == null)
     {
         throw new ArgumentNullException("vars");
     }
     if (vars.Length == 0)
     {
         throw new ArgumentException("at least 1 variable must be defined", "vars");
     }
     if (collection == null)
     {
         throw new ArgumentNullException("collection");
     }
     this.Vars       = vars;
     this.Collection = collection;
 }
Beispiel #9
0
 //--- Constructors ---
 public DekiScriptGeneratorForeachKeyValue(Location location, string key, string value, DekiScriptExpression collection, DekiScriptGenerator next) : base(location, next)
 {
     if (string.IsNullOrEmpty(key))
     {
         throw new ArgumentNullException("key");
     }
     if (string.IsNullOrEmpty(value))
     {
         throw new ArgumentNullException("value");
     }
     if (collection == null)
     {
         throw new ArgumentNullException("collection");
     }
     this.Key        = key;
     this.Value      = value;
     this.Collection = collection;
 }
 //--- Constructors ---
 public DekiScriptGeneratorIf(Location location, DekiScriptExpression condition, DekiScriptGenerator generator) : base(location, generator)
 {
     if (condition == null)
     {
         throw new ArgumentNullException("condition");
     }
     this.Condition = condition;
 }
 //--- Constructors ---
 public DekiScriptGeneratorVar(Location location, string var, DekiScriptExpression expression, DekiScriptGenerator next) : base(location, next)
 {
     if (string.IsNullOrEmpty(var))
     {
         throw new ArgumentNullException("var");
     }
     if (expression == null)
     {
         throw new ArgumentNullException("expression");
     }
     this.Var        = var;
     this.Expression = expression;
 }
 //--- Constructors ---
 protected DekiScriptGenerator(Location location, DekiScriptGenerator next)
 {
     this.Location = location;
     this.Next     = next;
 }