00001 # include "parm.h"
00002
00003 # include "stree/ststructs.mh"
00004
00005 # include "is_local.h"
00006
00007 # ifdef DEBUG
00008 # define IFDEBUG(x) x
00009 # else
00010 # define IFDEBUG(x)
00011 # endif
00012
00013 char * getname();
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 hascomp(sig,ind)
00024 NODE * sig;
00025 int ind;
00026 {
00027 register NODE * p;
00028 register boolean is_char;
00029
00030 char * name;
00031 char character;
00032
00033 int i;
00034
00035 # ifdef DEBUG
00036 if (sig -> kind != TYPESIGNATURE) {
00037 dbgmsg("hascomp: bad type signature\n");
00038 abort();
00039 }
00040 # endif
00041
00042 name = getname(ind);
00043 if(is_char = (name[0] == '\'' && name[2] == '\'')) character = name[1];
00044 maplist(p, sig -> ts_clist, {
00045 if (p -> kind == TSCOMPONENT) {
00046 if (p -> tsc_id -> id_str_table_index == ind) {
00047 return(TRUE);
00048 }
00049 }
00050
00051 if(p -> kind == DEFCHARSIGS && is_char) {
00052
00053 unsigned word;
00054 int bitno;
00055 int wordno;
00056 unsigned * base = &(p -> dcs_0);
00057 unsigned * s;
00058
00059 wordno = ((int) character) / WORDLENGTH;
00060 word = *(base + wordno);
00061 bitno = ((int) character) - wordno * WORDLENGTH;
00062
00063 if ( is_char && (((int) word) << bitno) < 0) {
00064
00065 return(TRUE);
00066 }
00067 }
00068 IFDEBUG(
00069 if(p -> kind != TSCOMPONENT && p -> kind != DEFCHARSIGS) {
00070 dbgmsg("hascomp: bad tsc\n");
00071 }
00072 )
00073 });
00074
00075 return(FALSE);
00076 }
00077