Beispiel #1
0
 public TypeUnit load()
 {
     if (kind_ == Kind.Cell)
     {
         return(null);
     }
     if (kind_ == Kind.Reference)
     {
         if (ref_.kind == Kind.Array)
         {
             return(ref_.load());
         }
         return(ref_);
     }
     //Debug.Assert(kind_ == Kind.Array);
     if (dims_ == 1)
     {
         if (type_.isString)
         {
             return(new TypeUnit(new PawnType(CellType.Character)));
         }
         return(new TypeUnit(type_));
     }
     return(new TypeUnit(new TypeUnit(type_, dims_ - 1)));
 }
Beispiel #2
0
        public override void visit(DLoad load)
        {
            TypeSet fromTypes = load.from.typeSet;

            for (int i = 0; i < fromTypes.numTypes; i++)
            {
                TypeUnit tu     = fromTypes[i];
                TypeUnit actual = tu.load();
                if (actual == null)
                {
                    actual = tu;
                }
                load.addType(actual);
            }
        }