*** master/spider.web.old Mon Jul 3 12:46:05 1989 --- master/spider.web Thu Jul 20 19:00:04 1989 *************** *** 1532,1537 **** --- 1532,1541 ---- each scrap is true, the whole production will fire. If we're called upon to make a scrap underlined or reserved, we'll add to |trans[pos]|. + + If a category is negated we add an extra clause to make + sure nothing matches the zero category, since {\tt WEAVE} assumes + no production ever matches a scrap with category zero. #= field[pos]=$i ## save this field to compare RHS # *************** *** 1540,1548 **** cat = $i categories[cat]=1 ## remember |cat| is a category if (negation==0) { ! test[pos]=sprintf("(pp+%d)->cat==SP_%s",pos-1,cat) } else { ! test[pos]=sprintf("(pp+%d)->cat!=SP_%s",pos-1,cat) } # # --- 1544,1553 ---- cat = $i categories[cat]=1 ## remember |cat| is a category if (negation==0) { ! test[pos]=sprintf("(pp+%d)->cat==SP_%s",pos-1,cat) } else { ! test[pos]=sprintf("((pp+%d)->cat!=SP_%s && (pp+%d)->cat != 0)",\ ! pos-1,cat,pos-1) } # # *************** *** 1551,1556 **** --- 1556,1565 ---- categories are separated by vertical bars. We have to make the test for these things a disjunction, but processing is more or less like the processing for a single category. + + If a list of alternatives is negated we add an extra clause to make + sure nothing matches the zero category, since {\tt WEAVE} assumes + no production ever matches a scrap with category zero. #= field[pos]=$i ## save this field to compare RHS # *************** *** 1557,1563 **** if (negation==0) { test[pos]="(" ## open for a list of good alternatives } else { ! test[pos]="!(" ## open for a list of bad alternatives } # --- 1566,1573 ---- if (negation==0) { test[pos]="(" ## open for a list of good alternatives } else { ! temp=sprintf("(pp+%d)->cat==0",pos-1) ! test[pos]="!(" temp "||" ## open for a list of bad alternatives } # *************** *** 1635,1644 **** # } ! # Wild cards are easy to process #= field[pos]=$i ## save this field to compare RHS ! test[pos]="(1)" ## anything matches highwildcard=pos ## we don't really need this? # --- 1645,1655 ---- # } ! # Wild cards are easy to process, but we do have to remember that ! not even a wild card matches a scrap of category zero. #= field[pos]=$i ## save this field to compare RHS ! test[pos]=sprintf("(pp+%d)->cat!=0",pos-1) ## anything nonzero matches highwildcard=pos ## we don't really need this? #