Skip to main content
summaryrefslogtreecommitdiffstats
blob: dbdffeccbc00a23cded9d87c6a34e06961d6d6f1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
/* The following code was generated by JFlex 1.2.2 on 7/28/08 5:19 PM */

/*******************************************************************************
 * Copyright (c) 2004, 2008 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*nlsXXX*/
package org.eclipse.wst.css.core.internal.contenttype;
import java.io.IOException;
import java.io.Reader;

import org.eclipse.wst.xml.core.internal.contenttype.EncodingParserConstants;
import org.eclipse.wst.xml.core.internal.contenttype.XMLHeadTokenizerConstants;




/**
 * This class is a scanner generated by 
 * <a href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex</a> 1.2.2
 * on 7/28/08 5:19 PM from the specification file
 * <tt>file:/D:/workspaces/wtp301/workspace/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.jFlex</tt>
 */
public class CSSHeadTokenizer {

  /** this character denotes the end of file */
  final public static int YYEOF = -1;

  /** lexical states */
  final public static int YYINITIAL = 0;
  final public static int UnDelimitedString = 12;
  final public static int DQ_STRING = 8;
  final public static int SQ_STRING = 10;
  final public static int ST_XMLDecl = 2;
  final public static int QuotedAttributeValue = 6;
  final public static int CHARSET_RULE = 4;

  /**
   * YY_LEXSTATE[l] is the state in the DFA for the lexical state l
   * YY_LEXSTATE[l+1] is the state in the DFA for the lexical state l
   *                  at the beginning of a line
   * l is of the form l = 2*k, k a non negative integer
   */
  private final static int YY_LEXSTATE[] = { 
     0,  1,  2,  2,  3,  3,  4,  4,  5,  5,  6,  6,  7, 7
  };

  /** 
   * Translates characters to character classes
   */
  final private static String yycmap_packed = 
    "\1\11\10\0\1\6\1\10\2\0\1\7\22\0\1\6\1\0\1\37"+
    "\2\0\1\42\1\0\1\40\7\0\1\41\13\0\1\36\1\13\1\12"+
    "\1\35\1\14\1\20\1\23\1\0\1\21\1\32\1\26\1\0\1\34"+
    "\1\22\1\33\2\0\1\17\1\16\1\30\1\31\2\0\1\24\1\25"+
    "\1\27\3\0\1\15\10\0\1\23\1\0\1\21\1\32\1\26\1\0"+
    "\1\34\1\22\1\33\2\0\1\17\1\16\1\30\1\31\2\0\1\24"+
    "\1\25\1\27\3\0\1\15\102\0\1\4\3\0\1\5\17\0\1\3"+
    "\16\0\1\1\20\0\1\3\16\0\1\1\1\2\170\0\1\2\ufe87\0";

  /** 
   * Translates characters to character classes
   */
  final private static char [] yycmap = yy_unpack_cmap(yycmap_packed);


  /* error codes */
  final private static int YY_UNKNOWN_ERROR = 0;
  final private static int YY_ILLEGAL_STATE = 1;
  final private static int YY_NO_MATCH = 2;
  final private static int YY_PUSHBACK_2BIG = 3;

  /* error messages for the codes above */
  final private static String YY_ERROR_MSG[] = {
    "Unkown internal scanner error",
    "Internal error: unknown state",
    "Error: could not match input",
    "Error: pushback value was too large"
  };

  /** the input device */
  private java.io.Reader yy_reader;

  /** the current state of the DFA */
  private int yy_state;

  /** the current lexical state */
  private int yy_lexical_state = YYINITIAL;

  /** this buffer contains the current text to be matched and is
      the source of the yytext() string */
  private char yy_buffer[] = new char[16384];

  /** the textposition at the last accepting state */
  private int yy_markedPos;

  /** the textposition at the last state to be included in yytext */
  private int yy_pushbackPos;

  /** the current text position in the buffer */
  private int yy_currentPos;

  /** startRead marks the beginning of the yytext() string in the buffer */
  private int yy_startRead;

  /** endRead marks the last character in the buffer, that has been read
      from input */
  private int yy_endRead;

  /** number of newlines encountered up to the start of the matched text */
//  private int yyline;

  /** the number of characters up to the start of the matched text */
  private int yychar;

  /**
   * the number of characters from the last newline up to the start of the 
   * matched text
   */
//  private int yycolumn; 

  /** 
   * yy_atBOL == true <=> the scanner is currently at the beginning of a line
   */
  private boolean yy_atBOL;

  /** yy_atEOF == true <=> the scanner has returned a value for EOF */
  private boolean yy_atEOF;

  /** denotes if the user-EOF-code has already been executed */
  private boolean yy_eof_done;

  /* user code: */


	private boolean hasMore = true;
	private final static int MAX_TO_SCAN = 8000;
	StringBuffer string = new StringBuffer();
	// state stack for easier state handling
	private IntStack fStateStack = new IntStack();
	private String valueText = null;



	public CSSHeadTokenizer() {
		super();
	}

	  public void reset (Reader in) {
	  	/* the input device */
	  	yy_reader = in;

  		/* the current state of the DFA */
  		yy_state = 0;

  		/* the current lexical state */
  		yy_lexical_state = YYINITIAL;

  		/* this buffer contains the current text to be matched and is
  		 the source of the yytext() string */
  		java.util.Arrays.fill(yy_buffer, (char)0);

  		/* the textposition at the last accepting state */
  		yy_markedPos = 0;

  		/* the textposition at the last state to be included in yytext */
  		yy_pushbackPos = 0;

  		/* the current text position in the buffer */
  		yy_currentPos = 0;

  		/* startRead marks the beginning of the yytext() string in the buffer */
  		yy_startRead = 0;

  		/** 
  		 * endRead marks the last character in the buffer, that has been read
  		 * from input 
  		 */
  		yy_endRead = 0;

  		/* number of newlines encountered up to the start of the matched text */
//  		yyline = 0;

  		/* the number of characters up to the start of the matched text */
  		yychar = 0;

  		/**
  		 * the number of characters from the last newline up to the start
  		 * of the matched text
  		 */
//  		yycolumn = 0; 

  		/** 
  		 * yy_atBOL == true <=> the scanner is currently at the beginning 
  		 * of a line
  		 */
  		yy_atBOL = false;

  		/* yy_atEOF == true <=> the scanner has returned a value for EOF */
  		yy_atEOF = false;

  		/* denotes if the user-EOF-code has already been executed */
  		yy_eof_done = false;


  		fStateStack.clear();
  		
  		hasMore = true;
  		
		// its a little wasteful to "throw away" first char array generated
		// by class init (via auto generated code), but we really do want
		// a small buffer for our head parsers.
		if (yy_buffer.length != MAX_TO_SCAN) {
			yy_buffer = new char[MAX_TO_SCAN];
		}
  		

  	}


	public final HeadParserToken getNextToken() throws IOException {
		String context = null;
		context = primGetNextToken();
		HeadParserToken result = null;
		if (valueText != null) {
			result = createToken(context, yychar, valueText);
			valueText = null;
		} else {
			result = createToken(context, yychar, yytext());
		}
		return result;
	}

	public final boolean hasMoreTokens() {
		return hasMore && yychar < MAX_TO_SCAN;
	}
	private void pushCurrentState() {
		fStateStack.push(yystate());

	}

	private void popState() {
		yybegin(fStateStack.pop());
	}
	private HeadParserToken createToken(String context, int start, String text) {
		return new HeadParserToken(context, start, text);
	}
	



  /**
   * Creates a new scanner
   * There is also a java.io.InputStream version of this constructor.
   *
   * @param   in  the java.io.Reader to read input from.
   */
  public CSSHeadTokenizer(java.io.Reader in) {
    this.yy_reader = in;
  }

  /**
   * Creates a new scanner.
   * There is also java.io.Reader version of this constructor.
   *
   * @param   in  the java.io.Inputstream to read input from.
   */
  public CSSHeadTokenizer(java.io.InputStream in) {
    this(new java.io.InputStreamReader(in));
  }

  /** 
   * Unpacks the compressed character translation table.
   *
   * @param packed   the packed character translation table
   * @return         the unpacked character translation table
   */
  private static char [] yy_unpack_cmap(String packed) {
    char [] map = new char[0x10000];
    int i = 0;  /* index in packed string  */
    int j = 0;  /* index in unpacked array */
    while (i < 160) {
      int  count = packed.charAt(i++);
      char value = packed.charAt(i++);
      do map[j++] = value; while (--count > 0);
    }
    return map;
  }


  /**
   * Gets the next input character.
   *
   * @return      the next character of the input stream, EOF if the
   *              end of the stream is reached.
   * @exception   IOException  if any I/O-Error occurs
   */
  private int yy_advance() throws java.io.IOException {

    /* standard case */
    if (yy_currentPos < yy_endRead) return yy_buffer[yy_currentPos++];

    /* if the eof is reached, we don't need to work hard */ 
    if (yy_atEOF) return YYEOF;

    /* otherwise: need to refill the buffer */

    /* first: make room (if you can) */
    if (yy_startRead > 0) {
      System.arraycopy(yy_buffer, yy_startRead, 
                       yy_buffer, 0, 
                       yy_endRead-yy_startRead);

      /* translate stored positions */
      yy_endRead-= yy_startRead;
      yy_currentPos-= yy_startRead;
      yy_markedPos-= yy_startRead;
      yy_pushbackPos-= yy_startRead;
      yy_startRead = 0;
    }

    /* is the buffer big enough? */
    if (yy_currentPos >= yy_buffer.length) {
      /* if not: blow it up */
      char newBuffer[] = new char[yy_currentPos*2];
      System.arraycopy(yy_buffer, 0, newBuffer, 0, yy_buffer.length);
      yy_buffer = newBuffer;
    }

    /* finally: fill the buffer with new input */
    int numRead = yy_reader.read(yy_buffer, yy_endRead, 
                                            yy_buffer.length-yy_endRead);

    if ( numRead == -1 ) return YYEOF;

    yy_endRead+= numRead;

    return yy_buffer[yy_currentPos++];
  }


  /**
   * Closes the input stream.
   */
  final public void yyclose() throws java.io.IOException {
    yy_atEOF = true;            /* indicate end of file */
    yy_endRead = yy_startRead;  /* invalidate buffer    */
    yy_reader.close();
  }


  /**
   * Returns the current lexical state.
   */
  final public int yystate() {
    return yy_lexical_state;
  }

  /**
   * Enters a new lexical state
   *
   * @param newState the new lexical state
   */
  final public void yybegin(int newState) {
    yy_lexical_state = newState;
  }


  /**
   * Returns the text matched by the current regular expression.
   */
  final public String yytext() {
    return new String( yy_buffer, yy_startRead, yy_markedPos-yy_startRead );
  }

  /**
   * Returns the length of the matched text region.
   */
  final public int yylength() {
    return yy_markedPos-yy_startRead;
  }


  /**
   * Reports an error that occured while scanning.
   *
   * @param   errorCode  the code of the errormessage to display
   */
  private void yy_ScanError(int errorCode) {
    try {
      System.out.println(YY_ERROR_MSG[errorCode]);
    }
    catch (ArrayIndexOutOfBoundsException e) {
      System.out.println(YY_ERROR_MSG[YY_UNKNOWN_ERROR]);
    }

  } 


  /**
   * Pushes the specified amount of characters back into the input stream.
   *
   * They will be read again by then next call of the scanning method
   *
   * @param number  the number of characters to be read again.
   *                This number must not be greater than yylength()!
   */
  private void yypushback(int number) {
    if ( number > yylength() )
      yy_ScanError(YY_PUSHBACK_2BIG);

    yy_markedPos -= number;
  }


  /**
   * Contains user EOF-code, which will be executed exactly once,
   * when the end of file is reached
   */
  private void yy_do_eof() {
    if (!yy_eof_done) {
      yy_eof_done = true;
    	hasMore=false;

    }
  }


  /**
   * Resumes scanning until the next regular expression is matched,
   * the end of input is encountered or an I/O-Error occurs.
   *
   * @return      the next token
   * @exception   IOException  if any I/O-Error occurs
   */
  public String primGetNextToken() throws java.io.IOException {
    int yy_input;
    int yy_action;


    while (true) {

      yychar+= yylength();

      yy_atBOL = yy_markedPos <= 0 || yy_buffer[yy_markedPos-1] == '\n';
      if (!yy_atBOL && yy_buffer[yy_markedPos-1] == '\r') {
        yy_atBOL = yy_advance() != '\n';
        if (!yy_atEOF) yy_currentPos--;
      }

      yy_action = -1;

      yy_currentPos = yy_startRead = yy_markedPos;

      if (yy_atBOL)
        yy_state = YY_LEXSTATE[yy_lexical_state+1];
      else
        yy_state = YY_LEXSTATE[yy_lexical_state];


      yy_forAction: {
        while (true) {

          yy_input = yy_advance();

          if ( yy_input == YYEOF ) break yy_forAction;

          yy_input = yycmap[yy_input];

          boolean yy_isFinal = false;
          boolean yy_noLookAhead = false;

          yy_forNext: { switch (yy_state) {
            case 0:
              switch (yy_input) {
                case 1: yy_isFinal = true; yy_state = 9; break yy_forNext;
                case 2: yy_isFinal = true; yy_state = 10; break yy_forNext;
                case 3: yy_isFinal = true; yy_state = 11; break yy_forNext;
                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
              }

            case 1:
              switch (yy_input) {
                case 1: yy_isFinal = true; yy_state = 9; break yy_forNext;
                case 2: yy_isFinal = true; yy_state = 10; break yy_forNext;
                case 3: yy_isFinal = true; yy_state = 11; break yy_forNext;
                case 6: 
                case 7: 
                case 8: yy_isFinal = true; yy_state = 12; break yy_forNext;
                case 9: yy_isFinal = true; yy_state = 13; break yy_forNext;
                case 11: yy_isFinal = true; yy_state = 14; break yy_forNext;
                case 16: yy_isFinal = true; yy_state = 15; break yy_forNext;
                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
              }

            case 2:
              switch (yy_input) {
                case 9: yy_isFinal = true; yy_state = 16; break yy_forNext;
                case 12: yy_isFinal = true; yy_state = 17; break yy_forNext;
                case 22: yy_isFinal = true; yy_state = 18; break yy_forNext;
                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
              }

            case 3:
              switch (yy_input) {
                case 6: 
                case 7: 
                case 8: yy_isFinal = true; yy_state = 19; break yy_forNext;
                case 9: yy_isFinal = true; yy_state = 20; break yy_forNext;
                case 30: yy_isFinal = true; yy_state = 21; break yy_forNext;
                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
              }

            case 4:
              switch (yy_input) {
                case 6: 
                case 7: yy_isFinal = true; yy_state = 23; break yy_forNext;
                case 8: yy_isFinal = true; yy_state = 24; break yy_forNext;
                case 9: yy_isFinal = true; yy_state = 25; break yy_forNext;
                case 31: yy_isFinal = true; yy_state = 26; break yy_forNext;
                case 32: yy_isFinal = true; yy_state = 27; break yy_forNext;
                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 22; break yy_forNext;
              }

            case 5:
              switch (yy_input) {
                case 7: 
                case 8: 
                case 11: 
                case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
                case 9: yy_isFinal = true; yy_state = 30; break yy_forNext;
                case 12: 
                case 33: yy_isFinal = true; yy_state = 31; break yy_forNext;
                case 30: yy_isFinal = true; yy_state = 32; break yy_forNext;
                case 31: yy_isFinal = true; yy_state = 33; break yy_forNext;
                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 28; break yy_forNext;
              }

            case 6:
              switch (yy_input) {
                case 7: 
                case 8: 
                case 11: 
                case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
                case 33: yy_isFinal = true; yy_state = 31; break yy_forNext;
                case 30: yy_isFinal = true; yy_state = 32; break yy_forNext;
                case 32: yy_isFinal = true; yy_state = 33; break yy_forNext;
                case 9: yy_isFinal = true; yy_state = 34; break yy_forNext;
                case 34: yy_isFinal = true; yy_state = 35; break yy_forNext;
                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 28; break yy_forNext;
              }

            case 7:
              switch (yy_input) {
                case 11: 
                case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
                case 33: yy_isFinal = true; yy_state = 31; break yy_forNext;
                case 12: yy_isFinal = true; yy_state = 35; break yy_forNext;
                case 6: 
                case 7: 
                case 8: yy_isFinal = true; yy_state = 36; break yy_forNext;
                case 9: yy_isFinal = true; yy_state = 37; break yy_forNext;
                case 30: yy_isFinal = true; yy_state = 38; break yy_forNext;
                case 31: 
                case 32: yy_isFinal = true; yy_state = 39; break yy_forNext;
                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 28; break yy_forNext;
              }

            case 9:
              switch (yy_input) {
                case 2: yy_isFinal = true; yy_noLookAhead = true; yy_state = 40; break yy_forNext;
                default: break yy_forAction;
              }

            case 10:
              switch (yy_input) {
                case 1: yy_isFinal = true; yy_noLookAhead = true; yy_state = 41; break yy_forNext;
                default: break yy_forAction;
              }

            case 11:
              switch (yy_input) {
                case 4: yy_state = 42; break yy_forNext;
                default: break yy_forAction;
              }

            case 12:
              switch (yy_input) {
                case 6: 
                case 7: 
                case 8: yy_state = 43; break yy_forNext;
                case 9: yy_state = 44; break yy_forNext;
                case 11: yy_state = 45; break yy_forNext;
                case 16: yy_state = 46; break yy_forNext;
                default: break yy_forAction;
              }

            case 13:
              switch (yy_input) {
                case 6: 
                case 7: 
                case 8: yy_state = 43; break yy_forNext;
                case 11: yy_state = 45; break yy_forNext;
                case 16: yy_state = 46; break yy_forNext;
                case 9: yy_state = 47; break yy_forNext;
                default: break yy_forAction;
              }

            case 14:
              switch (yy_input) {
                case 9: yy_state = 48; break yy_forNext;
                case 12: yy_state = 49; break yy_forNext;
                default: break yy_forAction;
              }

            case 15:
              switch (yy_input) {
                case 9: yy_state = 50; break yy_forNext;
                case 17: yy_state = 51; break yy_forNext;
                default: break yy_forAction;
              }

            case 16:
              switch (yy_input) {
                case 12: yy_state = 52; break yy_forNext;
                case 22: yy_state = 53; break yy_forNext;
                default: break yy_forAction;
              }

            case 17:
              switch (yy_input) {
                case 9: yy_state = 54; break yy_forNext;
                case 29: yy_isFinal = true; yy_state = 55; break yy_forNext;
                default: break yy_forAction;
              }

            case 18:
              switch (yy_input) {
                case 9: yy_state = 56; break yy_forNext;
                case 24: yy_state = 57; break yy_forNext;
                default: break yy_forAction;
              }

            case 19:
              switch (yy_input) {
                case 6: 
                case 7: 
                case 8: yy_isFinal = true; yy_state = 19; break yy_forNext;
                case 9: yy_isFinal = true; yy_state = 58; break yy_forNext;
                default: break yy_forAction;
              }

            case 20:
              switch (yy_input) {
                case 6: 
                case 7: 
                case 8: yy_isFinal = true; yy_state = 19; break yy_forNext;
                case 30: yy_isFinal = true; yy_state = 21; break yy_forNext;
                default: break yy_forAction;
              }

            case 21:
              switch (yy_input) {
                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 59; break yy_forNext;
                default: break yy_forAction;
              }

            case 23:
              switch (yy_input) {
                case 6: 
                case 7: yy_isFinal = true; yy_state = 23; break yy_forNext;
                case 8: yy_state = 60; break yy_forNext;
                case 9: yy_isFinal = true; yy_state = 61; break yy_forNext;
                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 22; break yy_forNext;
              }

            case 24:
              switch (yy_input) {
                case 6: 
                case 7: yy_isFinal = true; yy_state = 23; break yy_forNext;
                case 8: yy_state = 60; break yy_forNext;
                case 9: yy_isFinal = true; yy_state = 61; break yy_forNext;
                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 22; break yy_forNext;
              }

            case 25:
              switch (yy_input) {
                case 31: yy_isFinal = true; yy_state = 26; break yy_forNext;
                case 32: yy_isFinal = true; yy_state = 27; break yy_forNext;
                case 6: 
                case 7: 
                case 8: yy_state = 60; break yy_forNext;
                default: break yy_forAction;
              }

            case 26:
              switch (yy_input) {
                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 62; break yy_forNext;
                default: break yy_forAction;
              }

            case 27:
              switch (yy_input) {
                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 63; break yy_forNext;
                default: break yy_forAction;
              }

            case 29:
              switch (yy_input) {
                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 64; break yy_forNext;
                default: break yy_forAction;
              }

            case 30:
              switch (yy_input) {
                case 7: 
                case 8: 
                case 11: 
                case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
                case 30: yy_isFinal = true; yy_state = 32; break yy_forNext;
                case 31: yy_isFinal = true; yy_state = 33; break yy_forNext;
                case 12: 
                case 33: yy_state = 65; break yy_forNext;
                default: break yy_forAction;
              }

            case 31:
              switch (yy_input) {
                case 29: yy_isFinal = true; yy_state = 32; break yy_forNext;
                case 9: yy_state = 66; break yy_forNext;
                default: break yy_forAction;
              }

            case 32:
              switch (yy_input) {
                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 67; break yy_forNext;
                default: break yy_forAction;
              }

            case 33:
              switch (yy_input) {
                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 68; break yy_forNext;
                default: break yy_forAction;
              }

            case 34:
              switch (yy_input) {
                case 7: 
                case 8: 
                case 11: 
                case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
                case 30: yy_isFinal = true; yy_state = 32; break yy_forNext;
                case 32: yy_isFinal = true; yy_state = 33; break yy_forNext;
                case 33: yy_state = 65; break yy_forNext;
                case 34: yy_state = 69; break yy_forNext;
                default: break yy_forAction;
              }

            case 35:
              switch (yy_input) {
                case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
                case 9: yy_state = 70; break yy_forNext;
                default: break yy_forAction;
              }

            case 36:
              switch (yy_input) {
                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 71; break yy_forNext;
                default: break yy_forAction;
              }

            case 37:
              switch (yy_input) {
                case 11: 
                case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
                case 6: 
                case 7: 
                case 8: yy_isFinal = true; yy_state = 36; break yy_forNext;
                case 30: yy_isFinal = true; yy_state = 38; break yy_forNext;
                case 31: 
                case 32: yy_isFinal = true; yy_state = 39; break yy_forNext;
                case 33: yy_state = 65; break yy_forNext;
                case 12: yy_state = 69; break yy_forNext;
                default: break yy_forAction;
              }

            case 38:
              switch (yy_input) {
                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 72; break yy_forNext;
                default: break yy_forAction;
              }

            case 39:
              switch (yy_input) {
                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 73; break yy_forNext;
                default: break yy_forAction;
              }

            case 42:
              switch (yy_input) {
                case 5: yy_isFinal = true; yy_noLookAhead = true; yy_state = 74; break yy_forNext;
                default: break yy_forAction;
              }

            case 43:
              switch (yy_input) {
                case 6: 
                case 7: 
                case 8: yy_state = 43; break yy_forNext;
                case 9: yy_state = 44; break yy_forNext;
                case 11: yy_state = 45; break yy_forNext;
                case 16: yy_state = 46; break yy_forNext;
                default: break yy_forAction;
              }

            case 44:
              switch (yy_input) {
                case 6: 
                case 7: 
                case 8: yy_state = 43; break yy_forNext;
                case 11: yy_state = 45; break yy_forNext;
                case 16: yy_state = 46; break yy_forNext;
                case 9: yy_state = 47; break yy_forNext;
                default: break yy_forAction;
              }

            case 45:
              switch (yy_input) {
                case 9: yy_state = 48; break yy_forNext;
                case 12: yy_state = 49; break yy_forNext;
                default: break yy_forAction;
              }

            case 46:
              switch (yy_input) {
                case 9: yy_state = 50; break yy_forNext;
                case 17: yy_state = 51; break yy_forNext;
                default: break yy_forAction;
              }

            case 47:
              switch (yy_input) {
                case 11: yy_state = 45; break yy_forNext;
                case 16: yy_state = 46; break yy_forNext;
                default: break yy_forAction;
              }

            case 48:
              switch (yy_input) {
                case 12: yy_state = 49; break yy_forNext;
                default: break yy_forAction;
              }

            case 49:
              switch (yy_input) {
                case 9: yy_state = 75; break yy_forNext;
                case 13: yy_state = 76; break yy_forNext;
                default: break yy_forAction;
              }

            case 50:
              switch (yy_input) {
                case 17: yy_state = 51; break yy_forNext;
                default: break yy_forAction;
              }

            case 51:
              switch (yy_input) {
                case 9: yy_state = 77; break yy_forNext;
                case 18: yy_state = 78; break yy_forNext;
                default: break yy_forAction;
              }

            case 52:
              switch (yy_input) {
                case 9: yy_state = 54; break yy_forNext;
                case 29: yy_isFinal = true; yy_state = 55; break yy_forNext;
                default: break yy_forAction;
              }

            case 53:
              switch (yy_input) {
                case 9: yy_state = 56; break yy_forNext;
                case 24: yy_state = 57; break yy_forNext;
                default: break yy_forAction;
              }

            case 54:
              switch (yy_input) {
                case 29: yy_isFinal = true; yy_state = 55; break yy_forNext;
                default: break yy_forAction;
              }

            case 55:
              switch (yy_input) {
                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 79; break yy_forNext;
                default: break yy_forAction;
              }

            case 56:
              switch (yy_input) {
                case 24: yy_state = 57; break yy_forNext;
                default: break yy_forAction;
              }

            case 57:
              switch (yy_input) {
                case 9: yy_state = 80; break yy_forNext;
                case 17: yy_state = 81; break yy_forNext;
                default: break yy_forAction;
              }

            case 58:
              switch (yy_input) {
                case 6: 
                case 7: 
                case 8: yy_isFinal = true; yy_state = 19; break yy_forNext;
                case 9: yy_state = 82; break yy_forNext;
                default: break yy_forAction;
              }

            case 60:
              switch (yy_input) {
                case 6: 
                case 7: yy_isFinal = true; yy_state = 23; break yy_forNext;
                case 8: yy_state = 60; break yy_forNext;
                case 9: yy_isFinal = true; yy_state = 61; break yy_forNext;
                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 22; break yy_forNext;
              }

            case 61:
              switch (yy_input) {
                case 6: 
                case 7: yy_isFinal = true; yy_state = 23; break yy_forNext;
                case 8: yy_state = 60; break yy_forNext;
                case 9: yy_isFinal = true; yy_state = 83; break yy_forNext;
                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 22; break yy_forNext;
              }

            case 65:
              switch (yy_input) {
                case 29: yy_isFinal = true; yy_state = 32; break yy_forNext;
                case 9: yy_state = 66; break yy_forNext;
                default: break yy_forAction;
              }

            case 66:
              switch (yy_input) {
                case 29: yy_isFinal = true; yy_state = 32; break yy_forNext;
                default: break yy_forAction;
              }

            case 69:
              switch (yy_input) {
                case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
                case 9: yy_state = 70; break yy_forNext;
                default: break yy_forAction;
              }

            case 70:
              switch (yy_input) {
                case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
                default: break yy_forAction;
              }

            case 75:
              switch (yy_input) {
                case 13: yy_state = 76; break yy_forNext;
                default: break yy_forAction;
              }

            case 76:
              switch (yy_input) {
                case 9: yy_state = 84; break yy_forNext;
                case 14: yy_state = 85; break yy_forNext;
                default: break yy_forAction;
              }

            case 77:
              switch (yy_input) {
                case 18: yy_state = 78; break yy_forNext;
                default: break yy_forAction;
              }

            case 78:
              switch (yy_input) {
                case 9: yy_state = 86; break yy_forNext;
                case 19: yy_state = 87; break yy_forNext;
                default: break yy_forAction;
              }

            case 80:
              switch (yy_input) {
                case 17: yy_state = 81; break yy_forNext;
                default: break yy_forAction;
              }

            case 81:
              switch (yy_input) {
                case 9: yy_state = 88; break yy_forNext;
                case 25: yy_state = 89; break yy_forNext;
                default: break yy_forAction;
              }

            case 82:
              switch (yy_input) {
                case 6: 
                case 7: 
                case 8: yy_isFinal = true; yy_state = 19; break yy_forNext;
                default: break yy_forAction;
              }

            case 83:
              switch (yy_input) {
                case 6: 
                case 7: 
                case 8: yy_state = 60; break yy_forNext;
                default: break yy_forAction;
              }

            case 84:
              switch (yy_input) {
                case 14: yy_state = 85; break yy_forNext;
                default: break yy_forAction;
              }

            case 85:
              switch (yy_input) {
                case 9: yy_state = 90; break yy_forNext;
                case 15: yy_state = 91; break yy_forNext;
                default: break yy_forAction;
              }

            case 86:
              switch (yy_input) {
                case 19: yy_state = 87; break yy_forNext;
                default: break yy_forAction;
              }

            case 87:
              switch (yy_input) {
                case 9: yy_state = 92; break yy_forNext;
                case 20: yy_state = 93; break yy_forNext;
                default: break yy_forAction;
              }

            case 88:
              switch (yy_input) {
                case 25: yy_state = 89; break yy_forNext;
                default: break yy_forAction;
              }

            case 89:
              switch (yy_input) {
                case 9: yy_state = 94; break yy_forNext;
                case 26: yy_state = 95; break yy_forNext;
                default: break yy_forAction;
              }

            case 90:
              switch (yy_input) {
                case 15: yy_state = 91; break yy_forNext;
                default: break yy_forAction;
              }

            case 91:
              switch (yy_input) {
                case 6: 
                case 7: 
                case 8: yy_isFinal = true; yy_state = 96; break yy_forNext;
                case 9: yy_state = 97; break yy_forNext;
                default: break yy_forAction;
              }

            case 92:
              switch (yy_input) {
                case 20: yy_state = 93; break yy_forNext;
                default: break yy_forAction;
              }

            case 93:
              switch (yy_input) {
                case 9: yy_state = 98; break yy_forNext;
                case 21: yy_state = 99; break yy_forNext;
                default: break yy_forAction;
              }

            case 94:
              switch (yy_input) {
                case 26: yy_state = 95; break yy_forNext;
                default: break yy_forAction;
              }

            case 95:
              switch (yy_input) {
                case 9: yy_state = 100; break yy_forNext;
                case 27: yy_state = 101; break yy_forNext;
                default: break yy_forAction;
              }

            case 96:
              switch (yy_input) {
                case 6: 
                case 7: 
                case 8: yy_isFinal = true; yy_state = 96; break yy_forNext;
                case 9: yy_isFinal = true; yy_state = 102; break yy_forNext;
                default: break yy_forAction;
              }

            case 97:
              switch (yy_input) {
                case 6: 
                case 7: 
                case 8: yy_isFinal = true; yy_state = 96; break yy_forNext;
                case 9: yy_state = 103; break yy_forNext;
                default: break yy_forAction;
              }

            case 98:
              switch (yy_input) {
                case 21: yy_state = 99; break yy_forNext;
                default: break yy_forAction;
              }

            case 99:
              switch (yy_input) {
                case 9: yy_state = 104; break yy_forNext;
                case 22: yy_state = 105; break yy_forNext;
                default: break yy_forAction;
              }

            case 100:
              switch (yy_input) {
                case 27: yy_state = 101; break yy_forNext;
                default: break yy_forAction;
              }

            case 101:
              switch (yy_input) {
                case 9: yy_state = 106; break yy_forNext;
                case 24: yy_state = 107; break yy_forNext;
                default: break yy_forAction;
              }

            case 102:
              switch (yy_input) {
                case 6: 
                case 7: 
                case 8: yy_isFinal = true; yy_state = 96; break yy_forNext;
                case 9: yy_state = 103; break yy_forNext;
                default: break yy_forAction;
              }

            case 103:
              switch (yy_input) {
                case 6: 
                case 7: 
                case 8: yy_isFinal = true; yy_state = 96; break yy_forNext;
                default: break yy_forAction;
              }

            case 104:
              switch (yy_input) {
                case 22: yy_state = 105; break yy_forNext;
                default: break yy_forAction;
              }

            case 105:
              switch (yy_input) {
                case 9: yy_state = 108; break yy_forNext;
                case 23: yy_isFinal = true; yy_state = 109; break yy_forNext;
                default: break yy_forAction;
              }

            case 106:
              switch (yy_input) {
                case 24: yy_state = 107; break yy_forNext;
                default: break yy_forAction;
              }

            case 107:
              switch (yy_input) {
                case 9: yy_state = 110; break yy_forNext;
                case 28: yy_state = 111; break yy_forNext;
                default: break yy_forAction;
              }

            case 108:
              switch (yy_input) {
                case 23: yy_isFinal = true; yy_state = 109; break yy_forNext;
                default: break yy_forAction;
              }

            case 109:
              switch (yy_input) {
                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 112; break yy_forNext;
                default: break yy_forAction;
              }

            case 110:
              switch (yy_input) {
                case 28: yy_state = 111; break yy_forNext;
                default: break yy_forAction;
              }

            case 111:
              switch (yy_input) {
                case 6: 
                case 7: 
                case 8: yy_state = 111; break yy_forNext;
                case 9: yy_state = 113; break yy_forNext;
                case 10: yy_isFinal = true; yy_state = 114; break yy_forNext;
                default: break yy_forAction;
              }

            case 113:
              switch (yy_input) {
                case 6: 
                case 7: 
                case 8: yy_state = 111; break yy_forNext;
                case 10: yy_isFinal = true; yy_state = 114; break yy_forNext;
                case 9: yy_state = 115; break yy_forNext;
                default: break yy_forAction;
              }

            case 114:
              switch (yy_input) {
                case 6: 
                case 7: 
                case 8: yy_isFinal = true; yy_state = 116; break yy_forNext;
                case 9: yy_state = 117; break yy_forNext;
                default: break yy_forAction;
              }

            case 115:
              switch (yy_input) {
                case 6: 
                case 7: 
                case 8: yy_state = 111; break yy_forNext;
                default: break yy_forAction;
              }

            case 116:
              switch (yy_input) {
                case 9: yy_isFinal = true; yy_state = 114; break yy_forNext;
                case 6: 
                case 7: 
                case 8: yy_isFinal = true; yy_state = 116; break yy_forNext;
                default: break yy_forAction;
              }

            case 117:
              switch (yy_input) {
                case 6: 
                case 7: 
                case 8: yy_isFinal = true; yy_state = 116; break yy_forNext;
                default: break yy_forAction;
              }

            default:
              yy_ScanError(YY_ILLEGAL_STATE);
              break;
          } }

          if ( yy_isFinal ) {
            yy_action = yy_state; 
            yy_markedPos = yy_currentPos; 
            if ( yy_noLookAhead ) break yy_forAction;
          }

        }
      }


      switch (yy_action) {    

        case 29: 
        case 64: 
          {  yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
        case 119: break;
        case 22: 
        case 23: 
        case 25: 
        case 61: 
        case 83: 
          {  yypushback(yylength()); yybegin(UnDelimitedString); string.setLength(0); }
        case 120: break;
        case 21: 
        case 59: 
          {  yybegin(YYINITIAL);  hasMore = false; return CSSHeadTokenizerConstants.RuleEnd; }
        case 121: break;
        case 39: 
        case 73: 
          {  yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue; }
        case 122: break;
        case 109: 
        case 112: 
          { if (yychar == 0 )  {yybegin(CHARSET_RULE); return CSSHeadTokenizerConstants.CHARSET_RULE;} }
        case 123: break;
        case 96: 
        case 102: 
          { if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;} }
        case 124: break;
        case 8: 
        case 9: 
        case 10: 
        case 11: 
        case 12: 
        case 13: 
        case 14: 
        case 15: 
        case 16: 
        case 17: 
        case 18: 
        case 20: 
        case 24: 
        case 30: 
        case 34: 
        case 37: 
          { if(yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;} }
        case 125: break;
        case 55: 
        case 79: 
          { yybegin(YYINITIAL);  return XMLHeadTokenizerConstants.XMLDeclEnd; }
        case 126: break;
        case 114: 
        case 116: 
          { pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding; }
        case 127: break;
        case 3: 
        case 19: 
        case 58: 
          { pushCurrentState(); yybegin(QuotedAttributeValue); }
        case 128: break;
        case 40: 
          { hasMore = false; return EncodingParserConstants.UTF16BE; }
        case 129: break;
        case 41: 
          { hasMore = false; return EncodingParserConstants.UTF16LE; }
        case 130: break;
        case 74: 
          { hasMore = false; return EncodingParserConstants.UTF83ByteBOM; }
        case 131: break;
        case 28: 
        case 31: 
        case 35: 
          {  string.append( yytext() );  }
        case 132: break;
        case 27: 
        case 63: 
          {  yybegin(SQ_STRING); string.setLength(0);  }
        case 133: break;
        case 26: 
        case 62: 
          {  yybegin(DQ_STRING); string.setLength(0);  }
        case 134: break;
        case 32: 
        case 67: 
          {  yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;  }
        case 135: break;
        case 33: 
        case 68: 
          {  popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;  }
        case 136: break;
        case 36: 
        case 71: 
          {  yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue;  }
        case 137: break;
        case 38: 
        case 72: 
          {  yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue;  }
        case 138: break;
        default: 
          if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
            yy_atEOF = true;
            yy_do_eof();
              { hasMore = false; return EncodingParserConstants.EOF; }
          } 
          else {
            yy_ScanError(YY_NO_MATCH);
          }
      }
    }
  }    

  /**
   * Runs the scanner on input files.
   *
   * This main method is the debugging routine for the scanner.
   * It prints each returned token to System.out until the end of
   * file is reached, or an error occured.
   *
   * @param argv   the command line, contains the filenames to run
   *               the scanner on.
   */
  public static void main(String argv[]) {
    for (int i = 0; i < argv.length; i++) {
      CSSHeadTokenizer scanner = null;
      try {
        scanner = new CSSHeadTokenizer( new java.io.FileReader(argv[i]) );
      }
      catch (java.io.FileNotFoundException e) {
        System.out.println("File not found : \""+argv[i]+"\"");
        System.exit(1);
      }
      catch (java.io.IOException e) {
        System.out.println("Error opening file \""+argv[i]+"\"");
        System.exit(1);
      }
      catch (ArrayIndexOutOfBoundsException e) {
        System.out.println("Usage : java CSSHeadTokenizer <inputfile>");
        System.exit(1);
      }

      try {
        do {
          System.out.println(scanner.primGetNextToken());
        } while (!scanner.yy_atEOF);

      }
      catch (java.io.IOException e) {
        System.out.println("An I/O error occured while scanning :");
        System.out.println(e);
        System.exit(1);
      }
      catch (Exception e) {
        e.printStackTrace();
        System.exit(1);
      }
    }
  }


}

Back to the top