static walk_result FindModCue( mod_handle mod, void *d ) { DIPHDL( cue, ch ); cue_find *fd = d; unsigned long curr_line; fd->id = 0; fd->ambig = FALSE; fd->match = CMP_NONE; if( mod != NO_MOD && fd->len != 0 ) { WalkFileList( mod, FindCue, fd ); if( fd->id == 0 ) return( WR_CONTINUE ); if( fd->ambig ) { Error( ERR_NONE, LIT( ERR_AMBIG_SRC_FILE ), fd->name, fd->len ); } } fd->found_a_file = TRUE; switch( LineCue( mod, fd->id, CurrGet.li.name.len, 0, ch ) ) { case SR_EXACT: HDLAssign( cue, fd->best_ch, ch ); fd->best_line = CurrGet.li.name.len; return( WR_STOP ); case SR_CLOSEST: curr_line = CueLine( ch ); if( curr_line < CurrGet.li.name.len && curr_line > fd->best_line ) { HDLAssign( cue, fd->best_ch, ch ); fd->best_line = CurrGet.li.name.len; } break; case SR_FAIL: return( WR_FAIL ); } return( WR_CONTINUE ); }
static bool UserType( type_handle *th ) { unsigned i; unsigned len; sym_info info; //NYI:begin temp if( ExprSP->flags & SF_NAME ) { static const char * const TagIds[] = { "struct", "class", "union", "enum", NULL }; ExprSP->v.li.type = ST_TYPE; for( i = 0; TagIds[i] != NULL; ++i ) { len = strlen( TagIds[i] ); if( len == ExprSP->v.li.name.len && memcmp( ExprSP->v.li.name.start, TagIds[i], len ) == 0 ) { ExprSP->v.li.type = ST_STRUCT_TAG + i; ExprSP->v.li.name.start = NamePos(); ExprSP->v.li.name.len = NameLen(); Scan(); } } } //NYI: end temp NameResolve( ExprSP, TRUE ); if( !(ExprSP->flags & SF_SYM) ) return( FALSE ); if( ExprSP->th == NULL ) return( FALSE ); SymInfo( ExprSP->v.sh, ExprSP->lc, &info ); if( info.kind != SK_TYPE ) return( FALSE ); HDLAssign( type, th, ExprSP->th ); return( TRUE ); }
OVL_EXTERN walk_result FindCue( cue_handle *ch, void *_d ) { cue_first *d = _d; HDLAssign( cue, d->dest, ch ); d->found = true; return( WR_STOP ); }
void ExprSymbol( stack_entry *entry, sym_handle *sh ) { SET_TH( entry ); if( SymType( sh, entry->th ) != DS_OK ) entry->th = NULL; ClassifyEntry( entry, &entry->info ); SET_SH( entry ); HDLAssign( sym, entry->v.sh, sh ); entry->flags |= SF_SYM; }