version 1.19, 1999/12/18 21:56:07 |
version 1.20, 1999/12/18 21:58:07 |
|
|
if (DEBUG(SUFF)) { |
if (DEBUG(SUFF)) { |
printf("at end of list\n"); |
printf("at end of list\n"); |
} |
} |
(void)Lst_AtEnd (l, (ClientData)s); |
Lst_AtEnd (l, (ClientData)s); |
s->refCount++; |
s->refCount++; |
(void)Lst_AtEnd(s->ref, (ClientData) l); |
Lst_AtEnd(s->ref, (ClientData) l); |
} else if (s2->sNum != s->sNum) { |
} else if (s2->sNum != s->sNum) { |
if (DEBUG(SUFF)) { |
if (DEBUG(SUFF)) { |
printf("before %s(%d)\n", s2->name, s2->sNum); |
printf("before %s(%d)\n", s2->name, s2->sNum); |
} |
} |
(void)Lst_Insert (l, ln, (ClientData)s); |
Lst_Insert(l, ln, (ClientData)s); |
s->refCount++; |
s->refCount++; |
(void)Lst_AtEnd(s->ref, (ClientData) l); |
Lst_AtEnd(s->ref, (ClientData) l); |
} else if (DEBUG(SUFF)) { |
} else if (DEBUG(SUFF)) { |
printf("already there\n"); |
printf("already there\n"); |
} |
} |
|
|
Suff_ClearSuffixes () |
Suff_ClearSuffixes () |
{ |
{ |
#ifdef CLEANUP |
#ifdef CLEANUP |
Lst_Concat (suffClean, sufflist, LST_CONCLINK); |
Lst_Concat(suffClean, sufflist, LST_CONCLINK); |
#endif |
#endif |
sufflist = Lst_Init(); |
sufflist = Lst_Init(); |
sNum = 0; |
sNum = 0; |
|
|
* by the Parse module. |
* by the Parse module. |
*/ |
*/ |
gn = Targ_NewGN (line); |
gn = Targ_NewGN (line); |
(void)Lst_AtEnd (transforms, (ClientData)gn); |
Lst_AtEnd (transforms, (ClientData)gn); |
} else { |
} else { |
/* |
/* |
* New specification for transformation rule. Just nuke the old list |
* New specification for transformation rule. Just nuke the old list |
|
|
s->flags = 0; |
s->flags = 0; |
s->refCount = 0; |
s->refCount = 0; |
|
|
(void)Lst_AtEnd (sufflist, (ClientData)s); |
Lst_AtEnd(sufflist, (ClientData)s); |
/* |
/* |
* Look for any existing transformations from or to this suffix. |
* Look for any existing transformations from or to this suffix. |
* XXX: Only do this after a Suff_ClearSuffixes? |
* XXX: Only do this after a Suff_ClearSuffixes? |
|
|
s->refCount++; |
s->refCount++; |
s2->children = 0; |
s2->children = 0; |
targ->children += 1; |
targ->children += 1; |
(void)Lst_AtEnd (ls->l, (ClientData)s2); |
Lst_AtEnd(ls->l, (ClientData)s2); |
#ifdef DEBUG_SRC |
#ifdef DEBUG_SRC |
s2->cp = Lst_Init(); |
s2->cp = Lst_Init(); |
Lst_AtEnd(targ->cp, (ClientData) s2); |
Lst_AtEnd(targ->cp, (ClientData) s2); |
|
|
s->refCount++; |
s->refCount++; |
s2->children = 0; |
s2->children = 0; |
targ->children += 1; |
targ->children += 1; |
(void)Lst_AtEnd (ls->l, (ClientData)s2); |
Lst_AtEnd(ls->l, (ClientData)s2); |
#ifdef DEBUG_SRC |
#ifdef DEBUG_SRC |
s2->cp = Lst_Init(); |
s2->cp = Lst_Init(); |
Lst_AtEnd(targ->cp, (ClientData) s2); |
Lst_AtEnd(targ->cp, (ClientData)s2); |
printf("2 add %x %x to %x:", targ, s2, ls->l); |
printf("2 add %x %x to %x:", targ, s2, ls->l); |
Lst_ForEach(ls->l, PrintAddr, (ClientData) 0); |
Lst_ForEach(ls->l, PrintAddr, (ClientData) 0); |
printf("\n"); |
printf("\n"); |
|
|
} |
} |
|
|
SuffAddLevel (srcs, s); |
SuffAddLevel (srcs, s); |
Lst_AtEnd(slst, (ClientData) s); |
Lst_AtEnd(slst, (ClientData)s); |
} |
} |
|
|
if (DEBUG(SUFF) && rs) { |
if (DEBUG(SUFF) && rs) { |
|
|
#ifdef DEBUG_SRC |
#ifdef DEBUG_SRC |
ret->cp = Lst_Init(); |
ret->cp = Lst_Init(); |
printf("3 add %x %x\n", targ, ret); |
printf("3 add %x %x\n", targ, ret); |
Lst_AtEnd(targ->cp, (ClientData) ret); |
Lst_AtEnd(targ->cp, (ClientData)ret); |
#endif |
#endif |
Lst_AtEnd(slst, (ClientData) ret); |
Lst_AtEnd(slst, (ClientData)ret); |
if (DEBUG(SUFF)) { |
if (DEBUG(SUFF)) { |
printf ("\tusing existing source %s\n", s->name); |
printf ("\tusing existing source %s\n", s->name); |
} |
} |
|
|
*/ |
*/ |
*cp++ = '\0'; |
*cp++ = '\0'; |
gn = Targ_FindNode(start, TARG_CREATE); |
gn = Targ_FindNode(start, TARG_CREATE); |
(void)Lst_AtEnd(members, (ClientData)gn); |
Lst_AtEnd(members, (ClientData)gn); |
while (*cp == ' ' || *cp == '\t') { |
while (*cp == ' ' || *cp == '\t') { |
cp++; |
cp++; |
} |
} |
|
|
* Stuff left over -- add it to the list too |
* Stuff left over -- add it to the list too |
*/ |
*/ |
gn = Targ_FindNode(start, TARG_CREATE); |
gn = Targ_FindNode(start, TARG_CREATE); |
(void)Lst_AtEnd(members, (ClientData)gn); |
Lst_AtEnd(members, (ClientData)gn); |
} |
} |
/* |
/* |
* Point cp back at the beginning again so the variable value |
* Point cp back at the beginning again so the variable value |
|
|
printf("%s...", gn->name); |
printf("%s...", gn->name); |
} |
} |
if (Lst_Member(pgn->children, (ClientData)gn) == NULL) { |
if (Lst_Member(pgn->children, (ClientData)gn) == NULL) { |
(void)Lst_Append(pgn->children, prevLN, (ClientData)gn); |
Lst_Append(pgn->children, prevLN, (ClientData)gn); |
prevLN = Lst_Succ(prevLN); |
prevLN = Lst_Succ(prevLN); |
(void)Lst_AtEnd(gn->parents, (ClientData)pgn); |
Lst_AtEnd(gn->parents, (ClientData)pgn); |
pgn->unmade++; |
pgn->unmade++; |
} |
} |
} |
} |
|
|
* up the parent's count of unmade children. |
* up the parent's count of unmade children. |
*/ |
*/ |
if (Lst_Member(pgn->children, (ClientData)gn) == NULL) { |
if (Lst_Member(pgn->children, (ClientData)gn) == NULL) { |
(void)Lst_Append(pgn->children, prevLN, (ClientData)gn); |
Lst_Append(pgn->children, prevLN, (ClientData)gn); |
prevLN = Lst_Succ(prevLN); |
prevLN = Lst_Succ(prevLN); |
(void)Lst_AtEnd(gn->parents, (ClientData)pgn); |
Lst_AtEnd(gn->parents, (ClientData)pgn); |
pgn->unmade++; |
pgn->unmade++; |
} |
} |
} |
} |
|
|
* Not already linked, so form the proper links between the |
* Not already linked, so form the proper links between the |
* target and source. |
* target and source. |
*/ |
*/ |
(void)Lst_AtEnd(tGn->children, (ClientData)sGn); |
Lst_AtEnd(tGn->children, (ClientData)sGn); |
(void)Lst_AtEnd(sGn->parents, (ClientData)tGn); |
Lst_AtEnd(sGn->parents, (ClientData)tGn); |
tGn->unmade += 1; |
tGn->unmade += 1; |
} |
} |
|
|
|
|
* Not already linked, so form the proper links between the |
* Not already linked, so form the proper links between the |
* target and source. |
* target and source. |
*/ |
*/ |
(void)Lst_AtEnd(tGn->children, (ClientData)gn); |
Lst_AtEnd(tGn->children, (ClientData)gn); |
(void)Lst_AtEnd(gn->parents, (ClientData)tGn); |
Lst_AtEnd(gn->parents, (ClientData)tGn); |
tGn->unmade += 1; |
tGn->unmade += 1; |
} |
} |
} |
} |
|
|
* Keep track of another parent to which this beast is transformed so |
* Keep track of another parent to which this beast is transformed so |
* the .IMPSRC variable can be set correctly for the parent. |
* the .IMPSRC variable can be set correctly for the parent. |
*/ |
*/ |
(void)Lst_AtEnd(sGn->iParents, (ClientData)tGn); |
Lst_AtEnd(sGn->iParents, (ClientData)tGn); |
|
|
return(TRUE); |
return(TRUE); |
} |
} |
|
|
* Create the link between the two nodes right off |
* Create the link between the two nodes right off |
*/ |
*/ |
if (Lst_Member(gn->children, (ClientData)mem) == NULL) { |
if (Lst_Member(gn->children, (ClientData)mem) == NULL) { |
(void)Lst_AtEnd(gn->children, (ClientData)mem); |
Lst_AtEnd(gn->children, (ClientData)mem); |
(void)Lst_AtEnd(mem->parents, (ClientData)gn); |
Lst_AtEnd(mem->parents, (ClientData)gn); |
gn->unmade += 1; |
gn->unmade += 1; |
} |
} |
|
|
|
|
/* |
/* |
* Record the target so we can nuke it |
* Record the target so we can nuke it |
*/ |
*/ |
(void)Lst_AtEnd(targs, (ClientData)targ); |
Lst_AtEnd(targs, (ClientData)targ); |
|
|
/* |
/* |
* Search from this suffix's successor... |
* Search from this suffix's successor... |
|
|
if (DEBUG(SUFF)) |
if (DEBUG(SUFF)) |
printf("adding suffix rules\n"); |
printf("adding suffix rules\n"); |
|
|
(void)Lst_AtEnd(targs, (ClientData)targ); |
Lst_AtEnd(targs, (ClientData)targ); |
} |
} |
|
|
/* |
/* |