[Nice-commit] Nice/src/bossa/link Dispatch.java,1.56,1.57
Brought to you by:
bonniot
From: <ar...@us...> - 2003-06-19 15:57:27
|
Update of /cvsroot/nice/Nice/src/bossa/link In directory sc8-pr-cvs1:/tmp/cvs-serv2812/F:/nice/src/bossa/link Modified Files: Dispatch.java Log Message: added a simple kind of enums. Index: Dispatch.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/link/Dispatch.java,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** Dispatch.java 19 Jun 2003 15:32:00 -0000 1.56 --- Dispatch.java 19 Jun 2003 15:57:23 -0000 1.57 *************** *** 290,294 **** Alternative first = null; ConstantExp[] values = (ConstantExp[]) valit.next(); ! for (Iterator i = sortedTypeMatches.iterator(); i.hasNext() && !failed;) { Alternative a = (Alternative) i.next(); --- 290,295 ---- Alternative first = null; ConstantExp[] values = (ConstantExp[]) valit.next(); ! outer: ! for (Iterator i = sortedTypeMatches.iterator(); i.hasNext();) { Alternative a = (Alternative) i.next(); *************** *** 305,308 **** --- 306,310 ---- "\nboth\n" + first.printLocated() + "\nand\n" + a.printLocated() + "\nmatch."); + break outer; } } *************** *** 314,317 **** --- 316,320 ---- "no alternative matches " + toString(tags, values, isValue)); + break; } } *************** *** 516,529 **** for (int pos = 0; pos < len; pos++) { ! ConstantExp[] valuesAtPos = new ConstantExp[alternatives.size()]; ! int valueCount = 0; for (Iterator i = alternatives.iterator(); i.hasNext(); ) { Pattern pat = ((Alternative)i.next()).getPatterns()[pos]; ! if (pat.atNonBoolValue()) { isValue[pos] = true; ! valuesAtPos[valueCount++] = pat.atValue; } } if (valueCount > 0) { --- 519,541 ---- for (int pos = 0; pos < len; pos++) { ! List valuesAtPosList = new LinkedList(); for (Iterator i = alternatives.iterator(); i.hasNext(); ) { Pattern pat = ((Alternative)i.next()).getPatterns()[pos]; ! if (pat.atNonBoolValue()) ! { isValue[pos] = true; ! if (pat.atEnum()) ! for (Iterator it = pat.getEnumValues().iterator(); it.hasNext(); ) ! valuesAtPosList.add(it.next()); ! ! else ! valuesAtPosList.add(pat.atValue); } } + int valueCount = valuesAtPosList.size(); + ConstantExp[] valuesAtPos = new ConstantExp[valueCount]; + valuesAtPosList.toArray(valuesAtPos); + if (valueCount > 0) { |