inline const T* skip_field_flag(const T* p) { while(*p){ T c=*p; if(c==_T2(T,'-') || c==_T2(T,'+') || c==_T2(T,'0') || c==_T2(T,' ') || c==_T2(T,'#')){ p++; continue; } break; } return p; }
int type_size(TCHAR type, int length) { switch (type) { case 'd': case 'i': switch (length) { case _T ('l'): return sizeof(long); case _T2('l'): return sizeof(long long); case _T ('h'): return sizeof(short); case _T2('h'): return sizeof(char); default: return sizeof(int); } case 'o': case 'u': case 'x': case 'X': return sizeof(unsigned); case 'f': case 'F': case 'e': case 'E': case 'g': case 'G': case 'a': case 'A': if (length == _T('L')) return sizeof(long double); else return sizeof(double); case 'c': // "%lc" is a wide character, passed as a wint_t (ushort) if (length == _T('l')) return sizeof(wint_t); // "%c" is an int, apparently else return sizeof(int); case 's': if (length == _T('l')) return sizeof(wchar_t*); else return sizeof(char*); case 'p': return sizeof(void*); case 'n': return sizeof(int*); } return 0; }
void Cyc_Hashtable_insert(struct Cyc_Hashtable_Table * t,void * key,void * val) { struct Cyc_Hashtable_Table * _T0; struct Cyc_Hashtable_Table * _T1; int (* _T2)(void *); int _T3; unsigned int _T4; struct _fat_ptr _T5; unsigned int _T6; struct _fat_ptr _T7; unsigned int _T8; int _T9; struct _fat_ptr _TA; unsigned char * _TB; unsigned char * _TC; struct Cyc_Hashtable_Bucket * _TD; struct Cyc_Hashtable_Cell * _TE; struct Cyc_Hashtable_Table * _TF; struct _RegionHandle * _T10; struct Cyc_Hashtable_Bucket * _T11; struct Cyc_Hashtable_Bucket * _T12; unsigned int _T13; struct Cyc_Hashtable_Bucket * _T14; unsigned int _T15; struct Cyc_Hashtable_Table * _T16; int _T17; unsigned int _T18; _T0 = t; { struct _fat_ptr tab = _T0->tab; _T1 = t; _T2 = _T1->hash; _T3 = _T2(key); _T4 = (unsigned int)_T3; _T5 = tab; _T6 = _get_fat_size(_T5,sizeof(struct Cyc_Hashtable_Bucket)); { unsigned int bucket = _T4 % _T6; _T7 = tab; _T8 = bucket; _T9 = (int)_T8; _TA = _fat_ptr_plus(_T7,sizeof(struct Cyc_Hashtable_Bucket),_T9); _TB = _untag_fat_ptr_check_bound(_TA,sizeof(struct Cyc_Hashtable_Bucket), 1U); _TC = _check_null(_TB); { struct Cyc_Hashtable_Bucket * b = (struct Cyc_Hashtable_Bucket *)_TC; _TD = b; _TF = t; _T10 = _TF->r; { struct Cyc_Hashtable_Cell * _T19 = _region_malloc(_T10,0U,sizeof(struct Cyc_Hashtable_Cell)); _T19->key = key; _T19->value = val; _T11 = b; _T19->next = _T11->cells; _TE = (struct Cyc_Hashtable_Cell *)_T19; }_TD->cells = _TE; _T12 = b; _T13 = _T12->length; { unsigned int i = _T13 + 1U; _T14 = b; _T14->length = i; _T15 = i; _T16 = t; _T17 = _T16->max_len; _T18 = (unsigned int)_T17; if (_T15 <= _T18) { goto _TL0; } Cyc_Hashtable_resize(t); goto _TL1; _TL0: _TL1: ; } } } } }
inline const T* skip_field_prefix(const T* p) { if(*p==_T2(T,'t'))return p+1; //独自拡張 if(*p==_T2(T,'h'))return p+1; if(p[0]==_T2(T,'l') && p[1]==_T2(T,'l'))return p+2; if(*p==_T2(T,'l'))return p+1; if(p[0]==_T2(T,'I') && p[1]==_T2(T,'3') && p[2]==_T2(T,'2'))return p+3; if(p[0]==_T2(T,'I') && p[1]==_T2(T,'6') && p[2]==_T2(T,'4'))return p+3; if(*p==_T2(T,'I'))return p+1; return p; }
inline const T* skip_field_precision(const T* p) { if(*p==_T2(T,'.'))p++; else return p; //ドットで始まる文字列のみ受け付ける while(*p>=_T2(T,'0') && *p<=_T2(T,'9'))p++; //よくわからんのでとりあえず全数字を受け付ける return p; }
inline const T* skip_field_width(const T* p) { if(*p>=_T2(T,'1') && *p<=_T2(T,'9'))p++; else return p; //一桁目は0を受け付けない while(*p>=_T2(T,'0') && *p<=_T2(T,'9'))p++; return p; }
inline bool is_field_begin(T c) { return c==_T2(T,'%'); }
int Cyc_XP_fromstr(int n,struct _fat_ptr z,const char*str,int base){const char*_T0;unsigned _T1;int(*_T2)(struct _fat_ptr,struct _fat_ptr,unsigned);void*(*_T3)(struct _fat_ptr,struct _fat_ptr,unsigned);struct _fat_ptr _T4;struct _fat_ptr _T5;int(*_T6)(struct _fat_ptr,struct _fat_ptr,unsigned);void*(*_T7)(struct _fat_ptr,struct _fat_ptr,unsigned);struct _fat_ptr _T8;struct _fat_ptr _T9;const char*_TA;char _TB;int _TC;const char*_TD;char _TE;int _TF;int _T10;const char*_T11;int _T12;const char*_T13;char _T14;int _T15;const char*_T16;char _T17;int _T18;int _T19;char*_T1A;const char*_T1B;char _T1C;int _T1D;int _T1E;char*_T1F;char*_T20;char _T21;int _T22;int _T23;const char*_T24;char _T25;int _T26;const char*_T27;char _T28;int _T29;int _T2A;char*_T2B;const char*_T2C;char _T2D;int _T2E;int _T2F;char*_T30;char*_T31;char _T32;int _T33;int _T34;int _T35;int _T36;struct _fat_ptr _T37;struct _fat_ptr _T38;char*_T39;const char*_T3A;char _T3B;int _T3C;int _T3D;char*_T3E;char*_T3F;char _T40;int _T41;const char*_T42;int _T43;int _T44; # 249 const char*p=str;_T0=p;_T1=(unsigned)_T0; if(!_T1)goto _TL97;goto _TL98;_TL97: _T3=Cyc___assert_fail;{int(*_T45)(struct _fat_ptr,struct _fat_ptr,unsigned)=(int(*)(struct _fat_ptr,struct _fat_ptr,unsigned))_T3;_T2=_T45;}_T4=_tag_fat("p",sizeof(char),2U);_T5=_tag_fat("xp.cyc",sizeof(char),7U);_T2(_T4,_T5,250U);_TL98: if(base < 2)goto _TL99;if(base > 36)goto _TL99;goto _TL9A;_TL99: _T7=Cyc___assert_fail;{int(*_T45)(struct _fat_ptr,struct _fat_ptr,unsigned)=(int(*)(struct _fat_ptr,struct _fat_ptr,unsigned))_T7;_T6=_T45;}_T8=_tag_fat("base >= 2 && base <= 36",sizeof(char),24U);_T9=_tag_fat("xp.cyc",sizeof(char),7U);_T6(_T8,_T9,251U);_TL9A: _TL9B: _TA=_check_null(p);_TB=*_TA;_TC=(int)_TB;if(_TC)goto _TL9E;else{goto _TL9D;}_TL9E: _TD=p;_TE=*_TD;_TF=(int)_TE;_T10=isspace(_TF);if(_T10)goto _TL9C;else{goto _TL9D;} _TL9C:{const char**_T45=& p;_T11=*_T45;_T12=*_T11;if(_T12==0)goto _TL9F;*_T45=*_T45 + 1;goto _TLA0;_TL9F: _throw_arraybounds();_TLA0:;}goto _TL9B;_TL9D: _T13=p;_T14=*_T13;_T15=(int)_T14; if(!_T15)goto _TLA1;_T16=p;_T17=*_T16;_T18=(int)_T17;_T19=isalnum(_T18);if(!_T19)goto _TLA1;_T1A=Cyc_map;_T1B=p;_T1C=*_T1B;_T1D=(int)_T1C;_T1E=_T1D - 48;_T1F=_check_known_subscript_notnull(_T1A,75U,sizeof(char),_T1E);_T20=(char*)_T1F;_T21=*_T20;_T22=(int)_T21;_T23=base;if(_T22 >= _T23)goto _TLA1;{ int carry; _TLA6: _T24=_check_null(p);_T25=*_T24;_T26=(int)_T25;if(_T26)goto _TLA8;else{goto _TLA5;}_TLA8: _T27=p;_T28=*_T27;_T29=(int)_T28;_T2A=isalnum(_T29);if(_T2A)goto _TLA7;else{goto _TLA5;}_TLA7: _T2B=Cyc_map;_T2C=p;_T2D=*_T2C;_T2E=(int)_T2D;_T2F=_T2E - 48;_T30=_check_known_subscript_notnull(_T2B,75U,sizeof(char),_T2F);_T31=(char*)_T30;_T32=*_T31;_T33=(int)_T32;_T34=base;if(_T33 < _T34)goto _TLA4;else{goto _TLA5;} _TLA4: carry=Cyc_XP_product(n,z,z,base);_T35=carry; if(!_T35)goto _TLA9;goto _TLA5;_TLA9: _T36=n;_T37=z;_T38=z;_T39=Cyc_map;_T3A=p;_T3B=*_T3A;_T3C=(int)_T3B;_T3D=_T3C - 48;_T3E=_check_known_subscript_notnull(_T39,75U,sizeof(char),_T3D);_T3F=(char*)_T3E;_T40=*_T3F;_T41=(int)_T40; # 260 Cyc_XP_sum(_T36,_T37,_T38,_T41);{const char**_T45=& p;_T42=*_T45;_T43=*_T42;if(_T43==0)goto _TLAB;*_T45=*_T45 + 1;goto _TLAC;_TLAB: _throw_arraybounds();_TLAC:;}goto _TLA6;_TLA5: _T44=carry; # 262 return _T44;} # 264 _TLA1: return 0;}
//以下是构造函数 pair() : first(_T1()), second(_T2()) {}