~ubuntu-branches/ubuntu/jaunty/weka/jaunty

« back to all changes in this revision

Viewing changes to build/classes/build/classes/build/classes/build/classes/build/classes/weka/core/parser/JFlex/skeleton.default

  • Committer: Bazaar Package Importer
  • Author(s): Soeren Sonnenburg, Torsten Werner, Soeren Sonnenburg
  • Date: 2008-10-30 06:42:46 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20081030064246-648zj038l155host
Tags: 3.5.8+cup1-1
[ Torsten Werner ]
* Update Section field in doc-base file.
* Add Class-Path attribute to jar file.

[ Soeren Sonnenburg ]
* Update my email address to sonne@debian.org.
* Update copyright.
* Remove build, java cup and jflex from orig.tar.gz.
* Add cup and jflex as build dependency.
* Patch weka source to use cup from debian.
* Patch weka shell wrapper to use java-6-sun or openjdk.
* Obtain documentation from svn.
* Build depend on texlive-latex-extra (required to generate documentation).
* Add javadoc as build target.
* Use java-wrappers to start weka.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
  /** This character denotes the end of file */
3
 
  public static final int YYEOF = -1;
4
 
 
5
 
  /** initial size of the lookahead buffer */
6
 
--- private static final int ZZ_BUFFERSIZE = ...;
7
 
 
8
 
  /** lexical states */
9
 
---  lexical states, charmap
10
 
 
11
 
  /* error codes */
12
 
  private static final int ZZ_UNKNOWN_ERROR = 0;
13
 
  private static final int ZZ_NO_MATCH = 1;
14
 
  private static final int ZZ_PUSHBACK_2BIG = 2;
15
 
 
16
 
  /* error messages for the codes above */
17
 
  private static final String ZZ_ERROR_MSG[] = {
18
 
    "Unkown internal scanner error",
19
 
    "Error: could not match input",
20
 
    "Error: pushback value was too large"
21
 
  };
22
 
 
23
 
--- isFinal list
24
 
  /** the input device */
25
 
  private java.io.Reader zzReader;
26
 
 
27
 
  /** the current state of the DFA */
28
 
  private int zzState;
29
 
 
30
 
  /** the current lexical state */
31
 
  private int zzLexicalState = YYINITIAL;
32
 
 
33
 
  /** this buffer contains the current text to be matched and is
34
 
      the source of the yytext() string */
35
 
  private char zzBuffer[] = new char[ZZ_BUFFERSIZE];
36
 
 
37
 
  /** the textposition at the last accepting state */
38
 
  private int zzMarkedPos;
39
 
 
40
 
  /** the textposition at the last state to be included in yytext */
41
 
  private int zzPushbackPos;
42
 
 
43
 
  /** the current text position in the buffer */
44
 
  private int zzCurrentPos;
45
 
 
46
 
  /** startRead marks the beginning of the yytext() string in the buffer */
47
 
  private int zzStartRead;
48
 
 
49
 
  /** endRead marks the last character in the buffer, that has been read
50
 
      from input */
51
 
  private int zzEndRead;
52
 
 
53
 
  /** number of newlines encountered up to the start of the matched text */
54
 
  private int yyline;
55
 
 
56
 
  /** the number of characters up to the start of the matched text */
57
 
  private int yychar;
58
 
 
59
 
  /**
60
 
   * the number of characters from the last newline up to the start of the 
61
 
   * matched text
62
 
   */
63
 
  private int yycolumn;
64
 
 
65
 
  /** 
66
 
   * zzAtBOL == true <=> the scanner is currently at the beginning of a line
67
 
   */
68
 
  private boolean zzAtBOL = true;
69
 
 
70
 
  /** zzAtEOF == true <=> the scanner is at the EOF */
71
 
  private boolean zzAtEOF;
72
 
 
73
 
--- user class code
74
 
 
75
 
  /**
76
 
   * Creates a new scanner
77
 
   * There is also a java.io.InputStream version of this constructor.
78
 
   *
79
 
   * @param   in  the java.io.Reader to read input from.
80
 
   */
81
 
--- constructor declaration
82
 
 
83
 
 
84
 
  /**
85
 
   * Refills the input buffer.
86
 
   *
87
 
   * @return      <code>false</code>, iff there was new input.
88
 
   * 
89
 
   * @exception   java.io.IOException  if any I/O-Error occurs
90
 
   */
91
 
  private boolean zzRefill() throws java.io.IOException {
92
 
 
93
 
    /* first: make room (if you can) */
94
 
    if (zzStartRead > 0) {
95
 
      System.arraycopy(zzBuffer, zzStartRead,
96
 
                       zzBuffer, 0,
97
 
                       zzEndRead-zzStartRead);
98
 
 
99
 
      /* translate stored positions */
100
 
      zzEndRead-= zzStartRead;
101
 
      zzCurrentPos-= zzStartRead;
102
 
      zzMarkedPos-= zzStartRead;
103
 
      zzPushbackPos-= zzStartRead;
104
 
      zzStartRead = 0;
105
 
    }
106
 
 
107
 
    /* is the buffer big enough? */
108
 
    if (zzCurrentPos >= zzBuffer.length) {
109
 
      /* if not: blow it up */
110
 
      char newBuffer[] = new char[zzCurrentPos*2];
111
 
      System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length);
112
 
      zzBuffer = newBuffer;
113
 
    }
114
 
 
115
 
    /* finally: fill the buffer with new input */
116
 
    int numRead = zzReader.read(zzBuffer, zzEndRead,
117
 
                                            zzBuffer.length-zzEndRead);
118
 
 
119
 
    if (numRead < 0) {
120
 
      return true;
121
 
    }
122
 
    else {
123
 
      zzEndRead+= numRead;
124
 
      return false;
125
 
    }
126
 
  }
127
 
 
128
 
    
129
 
  /**
130
 
   * Closes the input stream.
131
 
   */
132
 
  public final void yyclose() throws java.io.IOException {
133
 
    zzAtEOF = true;            /* indicate end of file */
134
 
    zzEndRead = zzStartRead;  /* invalidate buffer    */
135
 
 
136
 
    if (zzReader != null)
137
 
      zzReader.close();
138
 
  }
139
 
 
140
 
 
141
 
  /**
142
 
   * Resets the scanner to read from a new input stream.
143
 
   * Does not close the old reader.
144
 
   *
145
 
   * All internal variables are reset, the old input stream 
146
 
   * <b>cannot</b> be reused (internal buffer is discarded and lost).
147
 
   * Lexical state is set to <tt>ZZ_INITIAL</tt>.
148
 
   *
149
 
   * @param reader   the new input stream 
150
 
   */
151
 
  public final void yyreset(java.io.Reader reader) {
152
 
    zzReader = reader;
153
 
    zzAtBOL  = true;
154
 
    zzAtEOF  = false;
155
 
    zzEndRead = zzStartRead = 0;
156
 
    zzCurrentPos = zzMarkedPos = zzPushbackPos = 0;
157
 
    yyline = yychar = yycolumn = 0;
158
 
    zzLexicalState = YYINITIAL;
159
 
  }
160
 
 
161
 
 
162
 
  /**
163
 
   * Returns the current lexical state.
164
 
   */
165
 
  public final int yystate() {
166
 
    return zzLexicalState;
167
 
  }
168
 
 
169
 
 
170
 
  /**
171
 
   * Enters a new lexical state
172
 
   *
173
 
   * @param newState the new lexical state
174
 
   */
175
 
  public final void yybegin(int newState) {
176
 
    zzLexicalState = newState;
177
 
  }
178
 
 
179
 
 
180
 
  /**
181
 
   * Returns the text matched by the current regular expression.
182
 
   */
183
 
  public final String yytext() {
184
 
    return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead );
185
 
  }
186
 
 
187
 
 
188
 
  /**
189
 
   * Returns the character at position <tt>pos</tt> from the 
190
 
   * matched text. 
191
 
   * 
192
 
   * It is equivalent to yytext().charAt(pos), but faster
193
 
   *
194
 
   * @param pos the position of the character to fetch. 
195
 
   *            A value from 0 to yylength()-1.
196
 
   *
197
 
   * @return the character at position pos
198
 
   */
199
 
  public final char yycharat(int pos) {
200
 
    return zzBuffer[zzStartRead+pos];
201
 
  }
202
 
 
203
 
 
204
 
  /**
205
 
   * Returns the length of the matched text region.
206
 
   */
207
 
  public final int yylength() {
208
 
    return zzMarkedPos-zzStartRead;
209
 
  }
210
 
 
211
 
 
212
 
  /**
213
 
   * Reports an error that occured while scanning.
214
 
   *
215
 
   * In a wellformed scanner (no or only correct usage of 
216
 
   * yypushback(int) and a match-all fallback rule) this method 
217
 
   * will only be called with things that "Can't Possibly Happen".
218
 
   * If this method is called, something is seriously wrong
219
 
   * (e.g. a JFlex bug producing a faulty scanner etc.).
220
 
   *
221
 
   * Usual syntax/scanner level error handling should be done
222
 
   * in error fallback rules.
223
 
   *
224
 
   * @param   errorCode  the code of the errormessage to display
225
 
   */
226
 
--- zzScanError declaration
227
 
    String message;
228
 
    try {
229
 
      message = ZZ_ERROR_MSG[errorCode];
230
 
    }
231
 
    catch (ArrayIndexOutOfBoundsException e) {
232
 
      message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
233
 
    }
234
 
 
235
 
--- throws clause
236
 
  } 
237
 
 
238
 
 
239
 
  /**
240
 
   * Pushes the specified amount of characters back into the input stream.
241
 
   *
242
 
   * They will be read again by then next call of the scanning method
243
 
   *
244
 
   * @param number  the number of characters to be read again.
245
 
   *                This number must not be greater than yylength()!
246
 
   */
247
 
--- yypushback decl (contains zzScanError exception)
248
 
    if ( number > yylength() )
249
 
      zzScanError(ZZ_PUSHBACK_2BIG);
250
 
 
251
 
    zzMarkedPos -= number;
252
 
  }
253
 
 
254
 
 
255
 
--- zzDoEOF
256
 
  /**
257
 
   * Resumes scanning until the next regular expression is matched,
258
 
   * the end of input is encountered or an I/O-Error occurs.
259
 
   *
260
 
   * @return      the next token
261
 
   * @exception   java.io.IOException  if any I/O-Error occurs
262
 
   */
263
 
--- yylex declaration
264
 
    int zzInput;
265
 
    int zzAction;
266
 
 
267
 
    // cached fields:
268
 
    int zzCurrentPosL;
269
 
    int zzMarkedPosL;
270
 
    int zzEndReadL = zzEndRead;
271
 
    char [] zzBufferL = zzBuffer;
272
 
    char [] zzCMapL = ZZ_CMAP;
273
 
 
274
 
--- local declarations
275
 
 
276
 
    while (true) {
277
 
      zzMarkedPosL = zzMarkedPos;
278
 
 
279
 
--- start admin (line, char, col count)
280
 
      zzAction = -1;
281
 
 
282
 
      zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
283
 
  
284
 
--- start admin (lexstate etc)
285
 
 
286
 
      zzForAction: {
287
 
        while (true) {
288
 
    
289
 
--- next input, line, col, char count, next transition, isFinal action
290
 
            zzAction = zzState;
291
 
            zzMarkedPosL = zzCurrentPosL;
292
 
--- line count update
293
 
          }
294
 
 
295
 
        }
296
 
      }
297
 
 
298
 
      // store back cached position
299
 
      zzMarkedPos = zzMarkedPosL;
300
 
--- char count update
301
 
 
302
 
--- actions
303
 
        default: 
304
 
          if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
305
 
            zzAtEOF = true;
306
 
--- eofvalue
307
 
          } 
308
 
          else {
309
 
--- no match
310
 
          }
311
 
      }
312
 
    }
313
 
  }
314
 
 
315
 
--- main
316
 
 
317
 
}