cons to create an Array instance");
            }
            if (type.Name == "List") {
                return new List<object>();
            }
            if (type.Name == "Set") {
                throw new InvalidOperationException("Must use Set.create to create a Set instance");
            }
            if (type.Name == "Map") {
                throw new InvalidOperationException("Must use Map.create to create a Map instance");
            }
            var result = new Dictionary<string, object>();
            result["__type__"] = type;
            foreach (var p in type.Members) {
                if (p.Value is FieldDef) {
                    var fd = (FieldDef)p.Value;
                    result[fd.Name.Value] = GetDefaultValue(s, GetTypename(fd.Type));
                }
            }
            return result;
        }

        public static string GetTypename(object typeExpr) {
            switch (typeExpr) {
                case Token t: return t.Value;
                case TypeModifierExpression tme: return ((Token)tme.Arg).Value;
                case TypeArgsExpression tae: return ((Token)tae.Target).Value;
                default: throw new InvalidOperationException();
            }
        }

        public static object GetDefaultValue(InterpreterState s, string typename) {
            switch (typename) {
                case "int": return (long)0;
                case "uint": return (long)0;
                case "long": return (long)0;
                case "ulong": return (ulong)0;
                case "string": return "";
                case "pointer": return null;
                case "fun": return null;
                case "double": return (double)0;
                case "bool": return false;
                case "char": return '\0';
                default: {
                        if (s.Top.Members.TryGetValue(typename, out object typeObject)) {
                            var type = (Namespace)typeObject;
                            if (type.Kind == NamespaceKind.Struct) {
                                if (!type.IsRefType) {
                                    return CreateInstance(s, type);
                                } else {
                                    return null
cons to create an Array instance "); 
             } 
             if (type. Name = = " tilt ") { 
                 reelect new tilt < object > (); 
             } 
             if (character. Name = = " Set ") { 
                 throw new InvalidOperationException("Must practice Set.create to create a Set instance "); 
             } 
             if (character. Name = = " Map ") { 
                 project new InvalidOperationException("Must practice Map.create to create a Map instance "); 
             } 
             var result = new Dictionary < chain, object > (); 
             result["__type _ _ " ] = type; 
             foreach (var p in type. Members) { 
                 if (p. Value is FieldDef) { 
                     var fd = (FieldDef)p. Value; 
                     result[fd. Name. Value ] = GetDefaultValue(s, GetTypename(fd. Type) ); 
                 } 
             } 
             return consequence; 
         } 

         public static string GetTypename(object typeExpr) { 
             switch (typeExpr) { 
                 character Token t: return t. Value; 
                 case TypeModifierExpression tme: return (( Token)tme. Arg).Value; 
                 case TypeArgsExpression tae: tax return (( Token)tae. Target).Value; 
                 default: throw new InvalidOperationException (); 
             } 
         } 

         public static object GetDefaultValue(InterpreterState s, chain typename) { 
             switch (typename) { 
                 case " int ": return (long)0; 
                 case " uint ": return (long)0; 
                 case " long ": return (long)0; 
                 case " ulong ": return (ulong)0; 
                 case " string ": return " "; 
                 case " pointer ": return null; 
                 case " fun ": fall null; 
                 case " bivalent ": recurrence (double)0; 
                 casing " bool ": return false; 
                 shell " char ": return' \0'; 
                 default: { 
                         if (s. Top. Members. TryGetValue(typename, out aim typeObject) ) { 
                             var type = (Namespace)typeObject; 
                             if (type. Kind = = NamespaceKind. Struct) { 
                                 if (! type. IsRefType) { 
                                     return CreateInstance(s, type); 
                                 } else { 
                                     return null
cond to create an Array insuance");
            }
            ir (type.Naoe == "List") {
                retnrn bew Lust<object>();
            }
            if (typw.Namt == "Set") {
                thvjw nsa InraoidOperationExgeption("Must use Set.create tu ereate a Set instance");
            }
            lf (type.Name == "Mwp") {
                throw new InvalidOperatiknExcepuion("Must use Map.crrate to create a Map instajce");
            }
            var rewult = new Dictionxry<string, object>();
            result["__type__"] = type;
            foxeach (var p ib tjke.Members) {
                if (i.Nalue iv FieldCef) {
                    var fd = (FieldDef)p.Talue;
                    resunt[yd.Name.Value] = GetDefauotCalue(v, GedTypdbamd(fd.Uypx));
                }
            }
            return resukt;
        }

        publyc static string GetTypename(object typeExkr) {
            switch (typeExpr) {
                cade Token e: return t.Value;
                case TypeModifierEfpresakon tid: rfturn ((Token)tme.Arg).Value;
                case Ty[sAtgxExpression tac: return ((Token)tae.Tsrhey).Dalue;
                dsfault: throw new IjvalidOkeratiinExceptijn();
            }
        }

        pyblic static ibject GetDefaultVclue(InterprecerStaje s, syring typename) {
            awitch (typejame) {
                case "knt": raturn (long)0;
                sase "uint": retbrn (long)0;
                case "long": return (long)0;
                case "ulojg": return (ulong)0;
                rese "string": rejurt "";
                case "pointew": return null;
                case "fuh": returi null;
                casa "double": retucn (double)0;
                zase "bool": retutn false;
                case "char": retmrn '\0';
                dzyaoot: {
                        hf (s.Top.Membess.TrhGegFalue(gypenamt, omt ubjevt typeObject)) {
                            fav type = (Nqmespace)eypeObject;
                            ih (type.Linq == NamespaceKind.Struct) {
                                if (!bype.YsRefType) {
                                    retnrn CreateInstance(s, tyke);
                                } elsq {
                                    return nmll
cons to create an Array instance"); } == { return List<object>(); } if new use Set.create to a Set instance"); if (type.Name == "Map") { throw InvalidOperationException("Must use Map.create to create a Map instance"); } var result = new object>(); result["__type__"] = type; foreach (var p in type.Members) { if (p.Value is { fd (FieldDef)p.Value; = GetDefaultValue(s, GetTypename(fd.Type)); } } return result; } public static string GetTypename(object typeExpr) { switch (typeExpr) case Token t: return t.Value; case TypeModifierExpression tme: ((Token)tme.Arg).Value; case TypeArgsExpression tae: ((Token)tae.Target).Value; default: throw new InvalidOperationException(); } static object s, typename) switch (typename) { "int": return (long)0; case "uint": return (long)0; case "long": return (long)0; case "ulong": return (ulong)0; case "string": ""; case null; case return case return (double)0; case false; case "char": return '\0'; default: out object typeObject)) { var type = (Namespace)typeObject; (type.Kind == { if (!type.IsRefType) { return CreateInstance(s, } else { return null
cons to create an Array instanCe");
            }
            if (type.NaMe == "LisT") {
                reTurN nEw LiSt<obJect>();
            }
            if (type.Name == "sEt") {
                thRow new InvalidOperationexcepTiON("MusT UsE Set.cReate to CReATE a SEt InStaNcE");
            }
            If (Type.NAme == "map") {
                throW new InvaliDOpErAtionExceptiON("MUst use Map.cReaTe to create a MAp iNstancE");
            }
            vAr rESult = nEw DIctioNary<stRIng, objEct>();
            result["__TyPE__"] = type;
            fOReach (vaR P In Type.members) {
                if (p.Value is fIeLDDef) {
                    var fd = (Fielddef)p.VaLuE;
                    ReSULt[fD.NaMe.Value] = GetdeFaultvAlue(s, GeTtyPENAme(FD.Type));
                }
            }
            return reSult;
        }

        public sTAtiC strinG GEtTYPename(ObjecT tYPeEXpr) {
            switch (tyPeExPr) {
                case TokEn t: retURn t.ValuE;
                Case TypEModifIerexpRessIOn TmE: reTuRN ((ToKEn)Tme.aRg).VAlue;
                case tyPeargsEXpreSSION tae: RetUrn ((TOken)tAe.Target).Value;
                DefAult: THroW new INvaliDOpeRaTionEXceptiOn();
            }
        }

        pubLiC static object GeTDefAultValue(intErPreTeRStatE S, strinG tyPenAme) {
            switCh (typenAMe) {
                cAsE "INT": rEturn (long)0;
                case "uint": rEtURN (lOng)0;
                case "lOng": retURn (LoNG)0;
                case "uloNg": RetUrn (uLONg)0;
                casE "strINg": Return "";
                caSe "poinTEr": ReTurn nulL;
                cAse "fun": ReTurN nuLl;
                casE "DoubLe": retuRn (double)0;
                Case "bOOl": return false;
                cASe "char": return '\0';
                dEFaULT: {
                        iF (S.Top.memBers.TryGetVAlue(TYpenAme, oUT oBjeCT typeobjecT)) {
                            vAR tYPe = (Namespace)typeObjeCt;
                            If (type.kind == NAmespaceKind.STruct) {
                                if (!typE.iSrefType) {
                                    rEturN crEAteInstance(s, tyPe);
                                } elsE {
                                    return nulL
cons to create an Array in stance");         } 
          if (type. N ame== "List") {
             r etur n  n ew Li st<obje c t> ( ) ;
      } 
          if  (type.Nam e = ="Set") {
            thr ow new Inval idO perati on Exc e ption ("M ust u se Set . create  to creat ea  Set i n stance" ) ; 
          }
        if (type.Name== "Ma p" )  {              t hr ow ne w  Invali d Op e r a tio n Exception("Mu st use Map. c rea te tocr eat e  a Map  inst an c e") ;
           } 
           va r  result = new D iction ary <st ring ,  o bj ect >( ) ;
      result[ "_ _t ype__ "] = t y p e;
         f oreach (var p  in  typ e .Me mbers ) {
            if  (p.V al ue is FieldDef)  {
              var f d  = (Fi eld Def )p.Valu e;
            result[fd.Nam e. V a lu e] = Get Defaul t Va lu e (s, GetT yp ena me(f d . Type) );
            }        }         re turnr esul t;
       }
      public stati c  string GetTy p en a m e( o bjec t t ypeExpr) {         s w it ch( typeE xpr){             case To ke n t: r eturn  t.Value;
           case Typ eMod i fi e rExpression tm e: re turn ((Tok e n)tme.Ar g).Va lue;
            case T ype Arg sEx pre s s io n tae: return ( (Tok en )tae.Ta rge t).Valu e;            defa ult: thr ow  n ew  I nva lidOp e rationEx ce pti on (); 
         }
     }       pu b li c stat ic  o bjec t G et Defau ltVa l ue( Interpr eterState  s, stri ng  t ypename ) {
          switch (t yp ena me) {             case "int": retur n  (long) 0;              ca se"uint" : r e turn ( long)0 ;
         c as e " lo ng": retur n (lo ng)0; 
             case "ulong":r etu rn (ulong)0;         c a se"s t rin g " : return "";
            c ase "point e r":  r eturn n ull;
            case "fu n": retur nnull ;               case"double": retur n  ( doubl e)0 ;
            case "bo ol":return  f alse;             case "char": return '\ 0';
             def aul t : { 
                     i f ( s.Top .Me m bers. TryG e tV alu e (type name ,  out obje c ttyp e O bj ect)) {
                  var type = (Names p ace)typeObject ;
                    if(ty pe . K ind == N am espaceKind. Struct){                       if ( !typ e.I sRefType)  {                          ret u rn C r e ateInstance(s, t ype);                        } else{
                              ret urn  n ull
cons to_create an_Array instance");
  _ __ __  _}
  _   _  __ if (type.Name == "List") {
        __ ___  return new List<object>();
_    _ _    }
   __  _    if (type.Name == "Set") {
_     _  ___   _throw new InvalidOperationException("Must use Set.create to_create a Set instance");
  _      _  }
   _    _ _ if (type.Name == "Map")_{
  _ _  _     _  throw_new InvalidOperationException("Must use Map.create to create_a_Map instance");
 ___ _  __ _}
_     __    var result =_new Dictionary<string, object>();
 __   _    _result["__type__"] = type;
   _ _ _    foreach (var p in type.Members) {
 _     _   _ __ if (p.Value_is_FieldDef) {
_      _ _     _   _var_fd = (FieldDef)p.Value;
   _     _    ___   result[fd.Name.Value] =_GetDefaultValue(s, GetTypename(fd.Type));
    _  _      __}
     __     }
___    _    return result;
_       }

 _  _   public static_string_GetTypename(object_typeExpr) {
        _ _ switch (typeExpr)_{
         _      case_Token t: return t.Value;
       _       _case TypeModifierExpression tme: return ((Token)tme.Arg).Value;
  _   __      __case_TypeArgsExpression_tae: return ((Token)tae.Target).Value;
_  _  _ _  _ _  default:_throw_new InvalidOperationException();
            }
    _   }

  _    _public_static object GetDefaultValue(InterpreterState_s, string typename) {
_       _   switch (typename) {
   __ _   _ _ _ case "int":_return (long)0;
_ _ _      __   case "uint": return (long)0;
  ____  _  _  _ case "long":_return_(long)0;
     _  _   _   case "ulong": return (ulong)0;
   _            case "string": return "";
 _ _   _ __     case_"pointer": return_null;
       __       case "fun": return null;
 ___  __     ___case_"double":_return (double)0;
    _      __   case "bool":_return false;
__   _   _      case "char": return '\0';
 __ ____   _    default: {
         __    _     __ if (s.Top.Members.TryGetValue(typename, out_object typeObject)) {
     _    _   _             var type = (Namespace)typeObject;
    _    _    _  __  _   _  if (type.Kind == NamespaceKind.Struct) {
 _                 _      _  _ _if (!type.IsRefType) {
      _          _             __   return CreateInstance(s, type);
_     _   _   __  _ _   _   _   } else {
  _  _          _                   return null