1 |
/* RuleBasedCollator.java -- Concrete Collator Class |
/* RuleBasedCollator.java -- Concrete Collator Class |
2 |
Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc. |
Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
435 |
continue; |
continue; |
436 |
} |
} |
437 |
|
|
438 |
switch (c) { |
switch (c) |
439 |
case '!': |
{ |
440 |
throw new ParseException |
case '!': |
|
("Modifier '!' is not yet supported by Classpath", i+base_offset); |
|
|
case '<': |
|
|
type = CollationSorter.GREATERP; |
|
|
break; |
|
|
case ';': |
|
|
type = CollationSorter.GREATERS; |
|
|
break; |
|
|
case ',': |
|
|
type = CollationSorter.GREATERT; |
|
|
break; |
|
|
case '=': |
|
|
type = CollationSorter.EQUAL; |
|
|
break; |
|
|
case '\'': |
|
|
eatingChars = !eatingChars; |
|
|
doubleQuote = true; |
|
|
break; |
|
|
case '@': |
|
|
if (ignoreChars) |
|
|
throw new ParseException |
|
|
("comparison list has not yet been started. You may only use" |
|
|
+ "(<,;=&)", i+base_offset); |
|
|
// Inverse the order of secondaries from now on. |
|
|
nextIsModifier = true; |
|
|
type = CollationSorter.INVERSE_SECONDARY; |
|
|
break; |
|
|
case '&': |
|
|
type = CollationSorter.RESET; |
|
|
if (stop_on_reset) |
|
|
break main_parse_loop; |
|
|
break; |
|
|
default: |
|
|
if (operator < 0) |
|
|
throw new ParseException |
|
|
("operator missing at " + (i+base_offset), i+base_offset); |
|
|
if (!eatingChars && |
|
|
((c >= 0x21 && c <= 0x2F) |
|
|
|| (c >= 0x3A && c <= 0x40) |
|
|
|| (c >= 0x5B && c <= 0x60) |
|
|
|| (c >= 0x7B && c <= 0x7E))) |
|
441 |
throw new ParseException |
throw new ParseException |
442 |
("unquoted punctuation character '"+c+"'", i+base_offset); |
("Modifier '!' is not yet supported by Classpath", i + base_offset); |
443 |
|
case '<': |
444 |
|
type = CollationSorter.GREATERP; |
445 |
|
break; |
446 |
|
case ';': |
447 |
|
type = CollationSorter.GREATERS; |
448 |
|
break; |
449 |
|
case ',': |
450 |
|
type = CollationSorter.GREATERT; |
451 |
|
break; |
452 |
|
case '=': |
453 |
|
type = CollationSorter.EQUAL; |
454 |
|
break; |
455 |
|
case '\'': |
456 |
|
eatingChars = !eatingChars; |
457 |
|
doubleQuote = true; |
458 |
|
break; |
459 |
|
case '@': |
460 |
|
if (ignoreChars) |
461 |
|
throw new ParseException |
462 |
|
("comparison list has not yet been started. You may only use" |
463 |
|
+ "(<,;=&)", i + base_offset); |
464 |
|
// Inverse the order of secondaries from now on. |
465 |
|
nextIsModifier = true; |
466 |
|
type = CollationSorter.INVERSE_SECONDARY; |
467 |
|
break; |
468 |
|
case '&': |
469 |
|
type = CollationSorter.RESET; |
470 |
|
if (stop_on_reset) |
471 |
|
break main_parse_loop; |
472 |
|
break; |
473 |
|
default: |
474 |
|
if (operator < 0) |
475 |
|
throw new ParseException |
476 |
|
("operator missing at " + (i + base_offset), i + base_offset); |
477 |
|
if (! eatingChars |
478 |
|
&& ((c >= 0x21 && c <= 0x2F) |
479 |
|
|| (c >= 0x3A && c <= 0x40) |
480 |
|
|| (c >= 0x5B && c <= 0x60) |
481 |
|
|| (c >= 0x7B && c <= 0x7E))) |
482 |
|
throw new ParseException |
483 |
|
("unquoted punctuation character '" + c + "'", i + base_offset); |
484 |
|
|
485 |
//type = ignoreChars ? CollationSorter.IGNORE : -1; |
//type = ignoreChars ? CollationSorter.IGNORE : -1; |
486 |
sb.append(c); |
sb.append(c); |
487 |
break; |
break; |
488 |
} |
} |
489 |
|
|
490 |
if (type < 0) |
if (type < 0) |
491 |
continue; |
continue; |