📄 bld.c
字号:
#ifdef FFECOM_constantHOOK nc->hook = FFECOM_constantNULL;#endif c->next = nc; return nc;}#endif/* ffebld_constant_new_logical2_val -- Return a logical2 constant object See prototype. */#if FFETARGET_okLOGICAL2ffebldConstantffebld_constant_new_logical2_val (ffetargetLogical2 val){ ffebldConstant c; ffebldConstant nc; int cmp; for (c = (ffebldConstant) &ffebld_constant_logical2_; c->next != NULL; c = c->next) { cmp = ffetarget_cmp_logical2 (val, ffebld_constant_logical2 (c->next)); if (cmp == 0) return c->next; if (cmp > 0) break; } nc = malloc_new_kp (ffebld_constant_pool(), "FFEBLD_constLOGICAL2", sizeof (*nc)); nc->next = c->next; nc->consttype = FFEBLD_constLOGICAL2; nc->u.logical2 = val;#ifdef FFECOM_constantHOOK nc->hook = FFECOM_constantNULL;#endif c->next = nc; return nc;}#endif/* ffebld_constant_new_logical3_val -- Return a logical3 constant object See prototype. */#if FFETARGET_okLOGICAL3ffebldConstantffebld_constant_new_logical3_val (ffetargetLogical3 val){ ffebldConstant c; ffebldConstant nc; int cmp; for (c = (ffebldConstant) &ffebld_constant_logical3_; c->next != NULL; c = c->next) { cmp = ffetarget_cmp_logical3 (val, ffebld_constant_logical3 (c->next)); if (cmp == 0) return c->next; if (cmp > 0) break; } nc = malloc_new_kp (ffebld_constant_pool(), "FFEBLD_constLOGICAL3", sizeof (*nc)); nc->next = c->next; nc->consttype = FFEBLD_constLOGICAL3; nc->u.logical3 = val;#ifdef FFECOM_constantHOOK nc->hook = FFECOM_constantNULL;#endif c->next = nc; return nc;}#endif/* ffebld_constant_new_logical4_val -- Return a logical4 constant object See prototype. */#if FFETARGET_okLOGICAL4ffebldConstantffebld_constant_new_logical4_val (ffetargetLogical4 val){ ffebldConstant c; ffebldConstant nc; int cmp; for (c = (ffebldConstant) &ffebld_constant_logical4_; c->next != NULL; c = c->next) { cmp = ffetarget_cmp_logical4 (val, ffebld_constant_logical4 (c->next)); if (cmp == 0) return c->next; if (cmp > 0) break; } nc = malloc_new_kp (ffebld_constant_pool(), "FFEBLD_constLOGICAL4", sizeof (*nc)); nc->next = c->next; nc->consttype = FFEBLD_constLOGICAL4; nc->u.logical4 = val;#ifdef FFECOM_constantHOOK nc->hook = FFECOM_constantNULL;#endif c->next = nc; return nc;}#endif/* ffebld_constant_new_real1 -- Return real1 constant object from token See prototype. */#if FFETARGET_okREAL1ffebldConstantffebld_constant_new_real1 (ffelexToken integer, ffelexToken decimal, ffelexToken fraction, ffelexToken exponent, ffelexToken exponent_sign, ffelexToken exponent_digits){ ffetargetReal1 val; ffetarget_real1 (&val, integer, decimal, fraction, exponent, exponent_sign, exponent_digits); return ffebld_constant_new_real1_val (val);}#endif/* ffebld_constant_new_real1_val -- Return an real1 constant object See prototype. */#if FFETARGET_okREAL1ffebldConstantffebld_constant_new_real1_val (ffetargetReal1 val){ ffebldConstant c; ffebldConstant nc; int cmp; for (c = (ffebldConstant) &ffebld_constant_real1_; c->next != NULL; c = c->next) { cmp = ffetarget_cmp_real1 (val, ffebld_constant_real1 (c->next)); if (cmp == 0) return c->next; if (cmp > 0) break; } nc = malloc_new_kp (ffebld_constant_pool(), "FFEBLD_constREAL1", sizeof (*nc)); nc->next = c->next; nc->consttype = FFEBLD_constREAL1; nc->u.real1 = val;#ifdef FFECOM_constantHOOK nc->hook = FFECOM_constantNULL;#endif c->next = nc; return nc;}#endif/* ffebld_constant_new_real2 -- Return real2 constant object from token See prototype. */#if FFETARGET_okREAL2ffebldConstantffebld_constant_new_real2 (ffelexToken integer, ffelexToken decimal, ffelexToken fraction, ffelexToken exponent, ffelexToken exponent_sign, ffelexToken exponent_digits){ ffetargetReal2 val; ffetarget_real2 (&val, integer, decimal, fraction, exponent, exponent_sign, exponent_digits); return ffebld_constant_new_real2_val (val);}#endif/* ffebld_constant_new_real2_val -- Return an real2 constant object See prototype. */#if FFETARGET_okREAL2ffebldConstantffebld_constant_new_real2_val (ffetargetReal2 val){ ffebldConstant c; ffebldConstant nc; int cmp; for (c = (ffebldConstant) &ffebld_constant_real2_; c->next != NULL; c = c->next) { cmp = ffetarget_cmp_real2 (val, ffebld_constant_real2 (c->next)); if (cmp == 0) return c->next; if (cmp > 0) break; } nc = malloc_new_kp (ffebld_constant_pool(), "FFEBLD_constREAL2", sizeof (*nc)); nc->next = c->next; nc->consttype = FFEBLD_constREAL2; nc->u.real2 = val;#ifdef FFECOM_constantHOOK nc->hook = FFECOM_constantNULL;#endif c->next = nc; return nc;}#endif/* ffebld_constant_new_typeless_bm -- Return typeless constant object from token See prototype. Parses the token as a decimal integer constant, thus it must be an FFELEX_typeNUMBER. */ffebldConstantffebld_constant_new_typeless_bm (ffelexToken t){ ffetargetTypeless val; ffetarget_binarymil (&val, t); return ffebld_constant_new_typeless_val (FFEBLD_constBINARY_MIL, val);}/* ffebld_constant_new_typeless_bv -- Return typeless constant object from token See prototype. Parses the token as a decimal integer constant, thus it must be an FFELEX_typeNUMBER. */ffebldConstantffebld_constant_new_typeless_bv (ffelexToken t){ ffetargetTypeless val; ffetarget_binaryvxt (&val, t); return ffebld_constant_new_typeless_val (FFEBLD_constBINARY_VXT, val);}/* ffebld_constant_new_typeless_hxm -- Return typeless constant object from token See prototype. Parses the token as a decimal integer constant, thus it must be an FFELEX_typeNUMBER. */ffebldConstantffebld_constant_new_typeless_hxm (ffelexToken t){ ffetargetTypeless val; ffetarget_hexxmil (&val, t); return ffebld_constant_new_typeless_val (FFEBLD_constHEX_X_MIL, val);}/* ffebld_constant_new_typeless_hxv -- Return typeless constant object from token See prototype. Parses the token as a decimal integer constant, thus it must be an FFELEX_typeNUMBER. */ffebldConstantffebld_constant_new_typeless_hxv (ffelexToken t){ ffetargetTypeless val; ffetarget_hexxvxt (&val, t); return ffebld_constant_new_typeless_val (FFEBLD_constHEX_X_VXT, val);}/* ffebld_constant_new_typeless_hzm -- Return typeless constant object from token See prototype. Parses the token as a decimal integer constant, thus it must be an FFELEX_typeNUMBER. */ffebldConstantffebld_constant_new_typeless_hzm (ffelexToken t){ ffetargetTypeless val; ffetarget_hexzmil (&val, t); return ffebld_constant_new_typeless_val (FFEBLD_constHEX_Z_MIL, val);}/* ffebld_constant_new_typeless_hzv -- Return typeless constant object from token See prototype. Parses the token as a decimal integer constant, thus it must be an FFELEX_typeNUMBER. */ffebldConstantffebld_constant_new_typeless_hzv (ffelexToken t){ ffetargetTypeless val; ffetarget_hexzvxt (&val, t); return ffebld_constant_new_typeless_val (FFEBLD_constHEX_Z_VXT, val);}/* ffebld_constant_new_typeless_om -- Return typeless constant object from token See prototype. Parses the token as a decimal integer constant, thus it must be an FFELEX_typeNUMBER. */ffebldConstantffebld_constant_new_typeless_om (ffelexToken t){ ffetargetTypeless val; ffetarget_octalmil (&val, t); return ffebld_constant_new_typeless_val (FFEBLD_constOCTAL_MIL, val);}/* ffebld_constant_new_typeless_ov -- Return typeless constant object from token See prototype. Parses the token as a decimal integer constant, thus it must be an FFELEX_typeNUMBER. */ffebldConstantffebld_constant_new_typeless_ov (ffelexToken t){ ffetargetTypeless val; ffetarget_octalvxt (&val, t); return ffebld_constant_new_typeless_val (FFEBLD_constOCTAL_VXT, val);}/* ffebld_constant_new_typeless_val -- Return a typeless constant object See prototype. */ffebldConstantffebld_constant_new_typeless_val (ffebldConst type, ffetargetTypeless val){ ffebldConstant c; ffebldConstant nc; int cmp; for (c = (ffebldConstant) &ffebld_constant_typeless_[type - FFEBLD_constTYPELESS_FIRST]; c->next != NULL; c = c->next) { cmp = ffetarget_cmp_typeless (val, ffebld_constant_typeless (c->next)); if (cmp == 0) return c->next; if (cmp > 0) break; } nc = malloc_new_kp (ffebld_constant_pool(), "FFEBLD_constTYPELESS", sizeof (*nc)); nc->next = c->next; nc->consttype = type; nc->u.typeless = val;#ifdef FFECOM_constantHOOK nc->hook = FFECOM_constantNULL;#endif c->next = nc; return nc;}/* ffebld_constantarray_dump -- Display summary of array's contents ffebldConstantArray a; ffeinfoBasictype bt; ffeinfoKindtype kt; ffetargetOffset size; ffebld_constant_dump(a,bt,kt,size,NULL); Displays the constant array in summary form. The fifth argument, if supplied, is an ffebit object that is consulted as to whether the constant at a particular offset is valid. */#if FFECOM_targetCURRENT == FFECOM_targetFFEvoidffebld_constantarray_dump (ffebldConstantArray array, ffeinfoBasictype bt, ffeinfoKindtype kt, ffetargetOffset size, ffebit bits){ ffetargetOffset i; ffebitCount j; ffebld_dump_prefix (dmpout, bt, kt); fprintf (dmpout, "\\("); if (bits == NULL) { for (i = 0; i < size; ++i) { ffebld_constantunion_dump (ffebld_constantarray_get (array, bt, kt, i), bt, kt); if (i != size - 1) fputc (',', dmpout); } } else { bool value; ffebitCount length; ffetargetOffset offset = 0; do { ffebit_test (bits, offset, &value, &length); if (value && (length != 0)) { if (length == 1) fprintf (dmpout, "[%" ffetargetOffset_f "d]:", offset); else fprintf (dmpout, "[%" ffetargetOffset_f "u..%" ffetargetOffset_f "d]:", offset, offset + (ffetargetOffset) length - 1); for (j = 0; j < length; ++j, ++offset) { ffebld_constantunion_dump (ffebld_constantarray_get (array, bt, kt, offset), bt, kt); if (j != length - 1) fputc (',', dmpout); } fprintf (dmpout, ";"); } else offset += length; } while (length != 0); } fprintf (dmpout, "\\)");}#endif/* ffebld_constantarray_get -- Get a value from an array of constants See prototype. */ffebldConstantUnionffebld_constantarray_get (ffebldConstantArray array, ffeinfoBasictype bt, ffeinfoKindtype kt, ffetargetOffset offset){ ffebldConstantUnion u; switch (bt) { case FFEINFO_basictypeINTEGER: switch (kt) {#if FFETARGET_okINTEGER1 case FFEINFO_kindtypeINTEGER1: u.integer1 = *(array.integer1 + offset); break;#endif#if FFETARGET_okINTEGER2 case FFEINFO_kindtypeINTEGER2: u.integer2 = *(array.integer2 + offset); break;#endif#if FFETARGET_okINTEGER3 case FFEINFO_kindtypeINTEGER3: u.integer3 = *(array.integer3 + offset); break;#endif#if FFETARGET_okINTEGER4 case FFEINFO_kindtypeINTEGER4: u.integer4 = *(array.integer4 + offset); break;#endif#if FFETARGET_okINTEGER5 case FFEINFO_kindtypeINTEGER5: u.integer5 = *(array.integer5 + offset); break;#endif#if FFETARGET_okINTEGER6 case FFEINFO_kindtypeINTEGER6: u.integer6 = *(array.integer6 + offset); break;#endif#if FFETARGET_okINTEGER7 case FFEINFO_kindtypeINTEGER7: u.integer7 = *(array.integer7 + offset); break;#endif#if FFETARGET_okINTEGER8 case FFEINFO_kindtypeINTEGER8: u.integer8 = *(array.integer8 + offset); break;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -