01: /*
02: *******************************************************************************
03: * Copyright (C) 2002-2004, International Business Machines Corporation and *
04: * others. All Rights Reserved. *
05: *******************************************************************************
06: */
07:
08: package com.ibm.icu.dev.tool.localeconverter;
09:
10: public class RangeTransition extends ComplexTransition {
11: public static final RangeTransition GLOBAL = new RangeTransition(
12: SUCCESS);
13: public static final String RANGE_CHARS = "...";
14:
15: public RangeTransition(int success) {
16: super (success);
17: }
18:
19: public boolean accepts(int c) {
20: return RANGE_CHARS.indexOf((char) c) >= 0;
21: }
22:
23: protected Lex.Transition[][] getStates() {
24: return states;
25: }
26:
27: private static final Lex.Transition[][] states = {
28:
29: { //state 0:
30: new Lex.StringTransition(RANGE_CHARS,
31: Lex.IGNORE_CONSUME, -1),
32: new Lex.ParseExceptionTransition(
33: "illegal space character") }, { //state 1:
34: new Lex.EOFTransition(SUCCESS),
35: new Lex.StringTransition(RANGE_CHARS,
36: Lex.IGNORE_CONSUME, -1),
37: new Lex.DefaultTransition(Lex.IGNORE_PUTBACK,
38: SUCCESS) }, };
39: }
|