public MonadicOperationStructure(TypeStructure rt, ExpressionStructure exp, BuilderStructure call)
     : base(rt)
 {
     Expression = exp;
     Call = call;
     AppendChild(Expression);
 }
 public CacheStructure(TypeStructure rt, ExpressionStructure exp)
     : base(rt)
 {
     Expression = exp;
     Cache = new LocalStructure(Expression.ResultType);
     AppendChild(Expression);
     AppendChild(Cache);
 }
 public void Initialize(ExpressionStructure cond, ExpressionStructure use, ExpressionStructure by, BlockStructure block)
 {
     Condition = cond;
     Use = use;
     By = by;
     Block = block;
     AppendChild(Condition);
     AppendChild(Use);
     AppendChild(By);
     AppendChild(Block);
 }
 public LogicalStructure(TypeStructure rt, ExpressionStructure left, ExpressionStructure right, bool isOr)
     : base(rt)
 {
     Left = left;
     Right = right;
     IsOr = isOr;
     Exit = new LabelStructure();
     AppendChild(Left);
     AppendChild(Right);
     AppendChild(Exit);
 }
 public DyadicOperationStructure(TypeStructure rt, ExpressionStructure left, ExpressionStructure right, BuilderStructure call, ExpressionStructure next = null)
     : base(rt)
 {
     Left = left;
     Right = right;
     Call = call;
     Next = next;
     AppendChild(Left);
     if (Next == null)
     {
         AppendChild(Right);
     }
     else
     {
         AppendChild(Next);
     }
 }
 public CallStructure(TypeStructure rt, BuilderStructure call, ExpressionStructure pre, CilStructure variant)
     : base(rt)
 {
     Call = call;
     Pre = pre;
     Access = pre;
     Variant = variant;
     Arguments = new List<ExpressionStructure>();
     Converters = new List<BuilderStructure>();
     if (Access != null)
     {
         AppendChild(Access);
     }
     if (Arguments != null)
     {
         AppendChild(Arguments);
     }
 }
 public CallStructure(TypeStructure rt, BuilderStructure call, ExpressionStructure pre, CilStructure access, CilStructure variant, IReadOnlyList<ExpressionStructure> args, IReadOnlyList<BuilderStructure> convs, bool isVariadic = false)
     : base(rt)
 {
     Call = call;
     Pre = pre;
     Access = access;
     Variant = variant;
     Arguments = args;
     Converters = convs;
     IsVariadic = isVariadic;
     if (Access != null)
     {
         AppendChild(Access);
     }
     if (Arguments != null)
     {
         AppendChild(Arguments);
     }
 }
 private IEnumerable<FieldStructure> GetFields(ExpressionStructure exp)
 {
     foreach(var v in exp)
     {
         var f = v as FieldStructure;
         if(f != null)
         {
             yield return f;
             continue;
         }
         var e = v as ExpressionStructure;
         if(e == null)
         {
             continue;
         }
         foreach(var w in GetFields(e))
         {
             yield return w;
         }
     }
 }
 public ReturnStructure(TypeStructure rt, ExpressionStructure exp)
     : base(rt)
 {
     Expression = exp;
     AppendChild(Expression);
 }