~ubuntu-branches/ubuntu/gutsy/jflex/gutsy

« back to all changes in this revision

Viewing changes to src/JFlex/CharClassIntervall.java

  • Committer: Bazaar Package Importer
  • Author(s): Takashi Okamoto
  • Date: 2002-02-16 13:38:21 UTC
  • Revision ID: james.westby@ubuntu.com-20020216133821-5wsdprpt9xl7ondr
Tags: upstream-1.3.5
ImportĀ upstreamĀ versionĀ 1.3.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 
2
 * JFlex 1.3.5                                                             *
 
3
 * Copyright (C) 1998-2001  Gerwin Klein <lsf@jflex.de>                    *
 
4
 * All rights reserved.                                                    *
 
5
 *                                                                         *
 
6
 * This program is free software; you can redistribute it and/or modify    *
 
7
 * it under the terms of the GNU General Public License. See the file      *
 
8
 * COPYRIGHT for more information.                                         *
 
9
 *                                                                         *
 
10
 * This program is distributed in the hope that it will be useful,         *
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of          *
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
 
13
 * GNU General Public License for more details.                            *
 
14
 *                                                                         *
 
15
 * You should have received a copy of the GNU General Public License along *
 
16
 * with this program; if not, write to the Free Software Foundation, Inc., *
 
17
 * 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                 *
 
18
 *                                                                         *
 
19
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
20
 
 
21
package JFlex;
 
22
 
 
23
/**
 
24
 * Stores an intervall of characters together with the character class
 
25
 *
 
26
 * A character belongs to an intervall, if its Unicode value is greater than or equal
 
27
 * to the Unicode value of <CODE>start</code> and smaller than or euqal to the Unicode
 
28
 * value of <CODE>end</code>.
 
29
 *
 
30
 * All characters of the intervall must belong to the same character class.
 
31
 *
 
32
 * @author Gerwin Klein
 
33
 * @version JFlex 1.3.5, $Revision: 1.14 $, $Date: 2001/10/08 10:07:57 $
 
34
 */
 
35
public class CharClassIntervall {
 
36
 
 
37
  /**
 
38
   * The first character of the intervall
 
39
   */
 
40
  int start;
 
41
 
 
42
  /**
 
43
   * The last character of the intervall
 
44
   */
 
45
  int end;
 
46
 
 
47
  /**
 
48
   * The code of the class all characters of this intervall belong to.
 
49
   */
 
50
  int charClass;
 
51
  
 
52
 
 
53
  /**
 
54
   * Creates a new CharClassIntervall from <CODE>start</code> to <CODE>end</code>
 
55
   * that belongs to character class <CODE>charClass</code>.
 
56
   *
 
57
   * @param start         The first character of the intervall
 
58
   * @param end           The last character of the intervall  
 
59
   * @param charClass     The code of the class all characters of this intervall belong to.
 
60
   */
 
61
  public CharClassIntervall(int start, int end, int charClass) {
 
62
    this.start = start;
 
63
    this.end = end;
 
64
    this.charClass = charClass;
 
65
  }
 
66
 
 
67
  /**
 
68
   * returns string representation of this class-intervall
 
69
   */
 
70
  public String toString() {
 
71
    return "["+start+"-"+end+"="+charClass+"]";
 
72
  }
 
73
}