/* The following code was generated by JFlex 1.4.1 on 2/16/08 4:44 PM */

/* HTMLLexer.java is a generated file.  You probably want to
 * edit HTMLLexer.lex to make changes.  Use JFlex to generate it.
 * To generate HTMLLexer.java
 * Install <a href="http://jflex.de/">JFlex</a> v1.3.2 or later.
 * Once JFlex is in your classpath run<br>
 * <code>java JFlex.Main HTMLLexer.lex</code><br>
 * You will then have a file called HTMLLexer.java
 */

/*
 * This file is part of a <a href="http://ostermiller.org/syntax/">syntax
 * highlighting</a> package.
 * Copyright (C) 1999-2002 Stephen Ostermiller
 * http://ostermiller.org/contact.pl?regarding=Syntax+Highlighting
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * See COPYING.TXT for details.
 */

package com.Ostermiller.Syntax.Lexer;

import java.io.*;

/** 
 * 
 * HTMLLexer is a html 2.0 lexer.  Created with JFlex.  An example of how it is used:
 *  <CODE>
 *  <PRE>
 *  HTMLLexer shredder = new HTMLLexer(System.in);
 *  HTMLToken t;
 *  while ((t = shredder.getNextToken()) != null){
 *      System.out.println(t);
 *  }
 *  </PRE>
 *  </CODE>
 *  
 * <P>
 * There are two HTML Lexers that come with this package.  HTMLLexer is a basic HTML lexer
 * that knows the difference between tags, text, and comments.  HTMLLexer1 knows something
 * about the structure of tags and can return names and values from name value pairs.  It 
 * also knows about text elements such as words and character references.  The two are 
 * similar but which you should use depends on your purpose.  In my opinion the HTMLLexer1
 * is much better for syntax highlighting.
 * 
 * @see HTMLLexer1
 * @see HTMLToken
 */ 


public class HTMLLexer implements Lexer {

  /** This character denotes the end of file */
  public static final int YYEOF = -1;

  /** initial size of the lookahead buffer */
  private static final int ZZ_BUFFERSIZE = 16384;

  /** lexical states */
  public static final int SCRIPT = 1;
  public static final int YYINITIAL = 0;
  public static final int PRE = 2;
  public static final int TEXTAREA = 3;

  /** 
   * Translates characters to character classes
   */
  private static final char [] ZZ_CMAP = {
     0,  0,  0,  0,  0,  0,  0,  0,  0,  3,  3,  0,  3,  3,  0,  0, 
     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 
     3, 15, 10,  0,  0, 30,  4, 11,  0,  0,  0,  0,  0, 31,  1, 14, 
     1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  0,  9, 13, 12, 16, 29, 
     0, 28,  2, 19, 17, 23,  2,  2,  2, 26,  2,  2,  2,  2,  2, 18, 
    22,  2, 25, 24, 20,  2,  2,  2, 27, 21,  2,  0,  0,  0,  0,  0, 
     0, 28,  6, 19, 17, 23,  2,  2,  2, 26,  2,  2,  2,  2,  5, 18, 
     8,  2, 25,  7, 20,  2,  2,  2, 27, 21,  2,  0,  0,  0,  0,  0, 
     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 
     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 
     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 
     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 
     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 
     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 
     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 
     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
  };

  /** 
   * Translates DFA states to action switch labels.
   */
  private static final int [] ZZ_ACTION = zzUnpackAction();

  private static final String ZZ_ACTION_PACKED_0 =
    "\1\1\1\2\3\1\1\3\2\2\1\1\1\2\1\1"+
    "\1\2\12\3\1\0\1\2\1\0\1\2\1\0\1\2"+
    "\2\3\1\4\6\3\1\5\7\3\1\0\4\2\1\0"+
    "\3\1\1\2\1\0\3\1\1\2\7\3\1\6\5\3"+
    "\2\0\1\2\3\0\2\2\1\7\2\2\1\0\2\1"+
    "\1\7\1\1\1\2\1\0\2\1\1\7\1\1\1\2"+
    "\10\3\1\10\7\3\1\0\3\2\1\0\2\1\1\2"+
    "\1\0\2\1\1\2\15\3\2\0\2\3\1\0\3\2"+
    "\1\0\2\1\1\7\1\0\2\1\1\2\2\3\3\0"+
    "\14\3\1\0\2\3\1\0\3\2\2\1\1\0\2\1"+
    "\1\2\2\3\2\0\2\3\1\11\10\3\2\0\2\3"+
    "\1\0\2\2\1\1\1\0\1\1\1\2\1\3\3\0"+
    "\6\3\3\0\2\3\1\0\2\3\2\0\1\2\3\0"+
    "\11\3\2\0\2\3\1\12\1\0\3\3\1\13\1\0"+
    "\1\2\3\0\10\3\3\0\2\3\1\0\4\3\4\0"+
    "\3\3\3\0\2\3\7\0\6\3\2\0\3\3\5\0"+
    "\6\3\1\0\2\3\6\0\3\3\3\0\2\3\5\0"+
    "\3\3\6\0\2\3\6\0\1\3\17\0";

  private static int [] zzUnpackAction() {
    int [] result = new int[371];
    int offset = 0;
    offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
    return result;
  }

  private static int zzUnpackAction(String packed, int offset, int [] result) {
    int i = 0;       /* index in packed string  */
    int j = offset;  /* index in unpacked array */
    int l = packed.length();
    while (i < l) {
      int count = packed.charAt(i++);
      int value = packed.charAt(i++);
      do result[j++] = value; while (--count > 0);
    }
    return j;
  }


  /** 
   * Translates a state to a row index in the transition table
   */
  private static final int [] ZZ_ROWMAP = zzUnpackRowMap();

  private static final String ZZ_ROWMAP_PACKED_0 =
    "\0\0\0\40\0\100\0\140\0\200\0\240\0\300\0\340"+
    "\0\u0100\0\u0120\0\u0140\0\u0160\0\u0180\0\u01a0\0\u01c0\0\u01e0"+
    "\0\u0200\0\u0220\0\u0240\0\u0260\0\u0280\0\u02a0\0\u02c0\0\u02e0"+
    "\0\u0300\0\u0320\0\u0340\0\u0360\0\u0380\0\u03a0\0\u0240\0\u03c0"+
    "\0\u03e0\0\u0400\0\u0420\0\u0440\0\u0460\0\u0240\0\u0480\0\u04a0"+
    "\0\u04c0\0\u04e0\0\u0500\0\u0520\0\u0540\0\u0560\0\u0580\0\u05a0"+
    "\0\u05c0\0\u05e0\0\u0600\0\u0620\0\u0640\0\u0660\0\u0680\0\u06a0"+
    "\0\u06c0\0\u06e0\0\u0700\0\u0720\0\u0740\0\u0760\0\u0780\0\u07a0"+
    "\0\u07c0\0\u07e0\0\u0800\0\u0240\0\u0820\0\u0840\0\u0860\0\u0880"+
    "\0\u08a0\0\u04e0\0\u08c0\0\u0240\0\u0520\0\u08e0\0\u0900\0\u0920"+
    "\0\u0940\0\300\0\u0960\0\u0980\0\u09a0\0\u09c0\0\u09e0\0\u0100"+
    "\0\u0a00\0\u0a20\0\u0a40\0\u0a60\0\u0a80\0\u0140\0\u0aa0\0\u0ac0"+
    "\0\u0ae0\0\u0b00\0\u0b20\0\u0b40\0\u0b60\0\u0b80\0\u0ba0\0\u0bc0"+
    "\0\u0240\0\u0be0\0\u0c00\0\u0c20\0\u0c40\0\u0c60\0\u0c80\0\u0ca0"+
    "\0\u0cc0\0\u0ce0\0\u0d00\0\u0d20\0\u0d40\0\u0d60\0\u0d80\0\u0da0"+
    "\0\u0dc0\0\u0de0\0\u0e00\0\u0e20\0\u0e40\0\u0e60\0\u0e80\0\u0ea0"+
    "\0\u0ec0\0\u0ee0\0\u0f00\0\u0f20\0\u0f40\0\u0f60\0\u0f80\0\u0fa0"+
    "\0\u0fc0\0\u0c60\0\u0fe0\0\u1000\0\u1020\0\u1040\0\u1060\0\u1080"+
    "\0\u10a0\0\u10c0\0\u10e0\0\u1100\0\u0240\0\u1120\0\u1140\0\u1160"+
    "\0\u1180\0\u11a0\0\u11c0\0\u0e80\0\u11e0\0\u0ea0\0\u1200\0\u1220"+
    "\0\u1240\0\u1260\0\u1280\0\u12a0\0\u12c0\0\u12e0\0\u1300\0\u1320"+
    "\0\u1340\0\u1360\0\u1380\0\u13a0\0\u13c0\0\u13e0\0\u1400\0\u1420"+
    "\0\u1440\0\u1460\0\u1480\0\u14a0\0\u14c0\0\u14e0\0\u1500\0\u1520"+
    "\0\u1540\0\u1560\0\u1580\0\u15a0\0\u15c0\0\u0240\0\u15e0\0\u1600"+
    "\0\u1620\0\u1640\0\u1660\0\u1680\0\u16a0\0\u16c0\0\u16e0\0\u1700"+
    "\0\u1720\0\u1740\0\u1760\0\u1780\0\u17a0\0\u17c0\0\u17e0\0\u1800"+
    "\0\u1820\0\u1840\0\u1860\0\u1880\0\u18a0\0\u18c0\0\u18e0\0\u1900"+
    "\0\u1920\0\u1940\0\u1960\0\u1640\0\u1980\0\u1660\0\u19a0\0\u19c0"+
    "\0\u19e0\0\u1a00\0\u1a20\0\u1a40\0\u1a60\0\u1a80\0\u1aa0\0\u1ac0"+
    "\0\u1ae0\0\u1b00\0\u1b20\0\u1b40\0\u1b60\0\u1b80\0\u1ba0\0\u1bc0"+
    "\0\u1be0\0\u1c00\0\u1c20\0\u1c40\0\u1c60\0\u1c80\0\u0240\0\u1ca0"+
    "\0\u1cc0\0\u1ce0\0\u1d00\0\u0240\0\u1d20\0\u1d40\0\u1d60\0\u1d80"+
    "\0\u1da0\0\u1dc0\0\u1de0\0\u1e00\0\u1e20\0\u1e40\0\u1e60\0\u1e80"+
    "\0\u1ea0\0\u1ec0\0\u1ee0\0\u1f00\0\u1f20\0\u1f40\0\u1f60\0\u1f80"+
    "\0\u1fa0\0\u1fc0\0\u1fe0\0\u2000\0\u2020\0\u2040\0\u2060\0\u2080"+
    "\0\u20a0\0\u20c0\0\u1e20\0\u20e0\0\u1e40\0\u2100\0\u2120\0\u2140"+
    "\0\u2160\0\u2180\0\u1f20\0\u21a0\0\u1f40\0\u21c0\0\u21e0\0\u2200"+
    "\0\u2220\0\u2240\0\u2260\0\u2280\0\u22a0\0\u22c0\0\u22e0\0\u2300"+
    "\0\u2320\0\u2340\0\u2360\0\u2380\0\u23a0\0\u23c0\0\u23e0\0\u2400"+
    "\0\u2420\0\u2440\0\u2460\0\u2480\0\u24a0\0\u24c0\0\u24e0\0\u2500"+
    "\0\u2520\0\u2540\0\u2560\0\u2580\0\u25a0\0\u25c0\0\u25e0\0\u2600"+
    "\0\u2440\0\u2620\0\u2460\0\u2640\0\u2660\0\u2680\0\u26a0\0\u26c0"+
    "\0\u26e0\0\u2700\0\u2720\0\u2740\0\u2760\0\u2780\0\u27a0\0\u27c0"+
    "\0\u27e0\0\u2800\0\u2820\0\u2840\0\u2860\0\u2880\0\u28a0\0\u28c0"+
    "\0\u28e0\0\u2900\0\u2920\0\u2940\0\u2960\0\u2980\0\u29a0\0\u29c0"+
    "\0\u29e0\0\u2a00\0\u2a20\0\u2a40\0\u2a60\0\u2a80\0\u2aa0\0\u2ac0"+
    "\0\u2ae0\0\u2b00\0\u2b20";

  private static int [] zzUnpackRowMap() {
    int [] result = new int[371];
    int offset = 0;
    offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
    return result;
  }

  private static int zzUnpackRowMap(String packed, int offset, int [] result) {
    int i = 0;  /* index in packed string  */
    int j = offset;  /* index in unpacked array */
    int l = packed.length();
    while (i < l) {
      int high = packed.charAt(i++) << 16;
      result[j++] = high | packed.charAt(i++);
    }
    return j;
  }

  /** 
   * The transition table of the DFA
   */
  private static final int [] ZZ_TRANS = zzUnpackTrans();

  private static final String ZZ_TRANS_PACKED_0 =
    "\15\5\1\6\22\5\15\7\1\10\22\7\15\11\1\12"+
    "\22\11\15\13\1\14\22\13\15\5\1\0\22\5\2\15"+
    "\1\16\2\15\2\16\1\17\1\20\5\15\1\21\1\22"+
    "\1\23\3\16\1\24\1\16\1\20\1\16\1\17\4\16"+
    "\1\25\1\26\1\15\15\7\1\27\37\7\1\27\1\30"+
    "\21\7\15\11\1\31\37\11\1\31\1\32\21\11\15\13"+
    "\1\33\37\13\1\33\1\34\21\13\20\15\1\23\20\15"+
    "\2\35\1\16\1\36\4\35\7\15\1\37\14\35\2\15"+
    "\1\35\1\15\2\35\1\16\1\36\4\35\7\15\1\37"+
    "\2\35\1\40\11\35\2\15\1\35\1\15\2\35\1\16"+
    "\1\36\4\35\7\15\1\37\10\35\1\41\3\35\2\15"+
    "\1\35\2\15\1\42\1\21\1\43\4\42\7\15\1\23"+
    "\14\42\6\15\1\44\1\45\13\15\1\46\1\47\15\15"+
    "\1\50\40\0\1\15\2\35\1\16\1\36\4\35\7\15"+
    "\1\37\6\35\1\51\5\35\2\15\1\35\20\25\1\52"+
    "\14\25\1\53\2\25\20\26\1\54\15\26\1\55\1\26"+
    "\15\7\1\27\1\56\23\7\1\57\1\60\1\61\2\57"+
    "\1\62\1\57\4\7\1\27\3\7\7\57\1\62\4\57"+
    "\3\7\15\11\1\31\1\63\23\11\1\64\1\65\1\66"+
    "\3\64\1\67\4\11\1\31\3\11\5\64\1\67\6\64"+
    "\3\11\15\13\1\33\1\70\23\13\1\71\1\72\1\73"+
    "\4\71\4\13\1\33\3\13\3\71\1\74\10\71\3\13"+
    "\1\15\3\35\1\75\4\35\3\15\1\76\3\15\1\37"+
    "\14\35\2\15\1\35\5\15\1\77\12\15\1\23\20\15"+
    "\3\35\1\75\4\35\3\15\1\76\3\15\1\37\10\35"+
    "\1\100\3\35\2\15\1\35\1\15\3\35\1\75\4\35"+
    "\3\15\1\76\3\15\1\37\6\35\1\101\5\35\2\15"+
    "\1\35\1\15\2\42\1\102\1\103\4\42\7\15\1\104"+
    "\14\42\2\15\1\42\5\15\1\105\12\15\1\23\22\15"+
    "\1\44\1\45\13\15\1\23\16\15\1\50\5\15\1\106"+
    "\12\15\1\23\37\15\1\23\1\15\1\107\35\15\1\23"+
    "\16\15\1\110\1\15\3\35\1\75\4\35\3\15\1\76"+
    "\3\15\1\37\12\35\1\111\1\35\2\15\1\35\35\112"+
    "\1\113\2\112\20\25\1\114\14\25\1\53\2\25\36\115"+
    "\1\116\1\115\20\26\1\114\15\26\1\55\1\26\7\7"+
    "\1\117\5\7\1\27\12\7\1\117\10\7\2\57\1\120"+
    "\1\121\4\57\4\7\1\27\2\7\1\122\14\57\2\7"+
    "\1\57\2\7\1\57\1\60\1\61\4\57\4\7\1\27"+
    "\3\7\14\57\10\7\1\123\7\7\1\27\23\7\2\57"+
    "\1\120\1\121\4\57\4\7\1\27\2\7\1\122\2\57"+
    "\1\124\11\57\2\7\1\57\10\11\1\125\4\11\1\31"+
    "\10\11\1\125\12\11\2\64\1\126\1\127\4\64\4\11"+
    "\1\31\2\11\1\130\14\64\2\11\1\64\2\11\1\64"+
    "\1\65\1\66\4\64\4\11\1\31\3\11\14\64\10\11"+
    "\1\131\7\11\1\31\23\11\2\64\1\126\1\127\4\64"+
    "\4\11\1\31\2\11\1\130\10\64\1\132\3\64\2\11"+
    "\1\64\15\13\1\33\6\13\1\133\14\13\2\71\1\134"+
    "\1\135\4\71\4\13\1\33\2\13\1\136\14\71\2\13"+
    "\1\71\2\13\1\71\1\72\1\73\4\71\4\13\1\33"+
    "\3\13\14\71\10\13\1\137\7\13\1\33\23\13\2\71"+
    "\1\134\1\135\4\71\4\13\1\0\2\13\1\136\6\71"+
    "\1\140\5\71\2\13\1\71\5\15\1\141\12\15\1\23"+
    "\20\15\2\16\1\76\1\142\4\16\1\15\1\143\1\144"+
    "\4\15\1\23\14\16\2\15\1\16\6\15\1\145\11\15"+
    "\1\23\20\15\3\35\1\75\4\35\3\15\1\76\3\15"+
    "\1\37\11\35\1\146\2\35\2\15\1\35\1\15\2\147"+
    "\1\101\1\150\4\147\3\15\1\76\3\15\1\151\14\147"+
    "\2\15\1\147\3\15\1\102\1\103\13\15\1\104\24\15"+
    "\1\152\12\15\1\23\25\15\1\153\11\15\1\23\25\15"+
    "\1\154\11\15\1\23\37\15\1\23\2\15\1\155\14\15"+
    "\20\110\1\156\16\110\1\157\1\15\3\35\1\75\4\35"+
    "\3\15\1\76\3\15\1\37\3\35\1\160\10\35\2\15"+
    "\1\35\20\112\1\114\14\112\1\113\2\112\20\115\1\114"+
    "\15\115\1\116\1\115\15\7\1\27\5\7\1\161\17\7"+
    "\1\120\1\121\10\7\1\27\2\7\1\122\24\7\1\162"+
    "\7\7\1\27\30\7\1\163\6\7\1\27\23\7\2\57"+
    "\1\120\1\121\4\57\4\7\1\27\2\7\1\122\10\57"+
    "\1\164\3\57\2\7\1\57\15\11\1\31\13\11\1\165"+
    "\11\11\1\126\1\127\10\11\1\31\2\11\1\130\24\11"+
    "\1\166\7\11\1\31\30\11\1\167\6\11\1\31\23\11"+
    "\2\64\1\126\1\127\4\64\4\11\1\31\2\11\1\130"+
    "\6\64\1\170\5\64\2\11\1\64\15\13\1\0\11\13"+
    "\1\171\13\13\1\134\1\135\10\13\1\33\2\13\1\136"+
    "\24\13\1\172\7\13\1\33\30\13\1\173\6\13\1\33"+
    "\23\13\2\71\1\134\1\135\4\71\4\13\1\0\2\13"+
    "\1\136\12\71\1\174\1\71\2\13\1\71\6\15\1\175"+
    "\11\15\1\23\24\15\1\176\12\15\1\23\17\15\12\143"+
    "\1\16\5\143\1\177\17\143\13\144\1\16\4\144\1\200"+
    "\17\144\7\15\1\201\10\15\1\23\20\15\3\35\1\75"+
    "\3\35\1\202\3\15\1\76\3\15\1\37\5\35\1\202"+
    "\6\35\2\15\1\35\1\15\3\147\1\203\4\147\3\15"+
    "\1\204\3\15\1\151\14\147\2\15\1\147\5\15\1\205"+
    "\12\15\1\23\25\15\1\206\11\15\1\23\26\15\1\207"+
    "\10\15\1\23\26\15\1\210\10\15\1\23\37\15\1\23"+
    "\3\15\1\211\13\15\37\212\1\213\20\110\1\156\16\110"+
    "\1\214\1\15\3\35\1\75\4\35\3\15\1\76\3\15"+
    "\1\37\13\35\1\215\2\15\1\35\15\7\1\27\13\7"+
    "\1\216\14\7\1\217\6\7\1\27\31\7\1\220\5\7"+
    "\1\27\23\7\2\57\1\120\1\121\4\57\4\7\1\27"+
    "\2\7\1\122\11\57\1\221\2\57\2\7\1\57\15\11"+
    "\1\31\11\11\1\222\16\11\1\223\6\11\1\31\31\11"+
    "\1\224\5\11\1\31\23\11\2\64\1\126\1\127\4\64"+
    "\4\11\1\31\2\11\1\225\14\64\2\11\1\64\15\13"+
    "\1\0\15\13\1\226\12\13\1\227\6\13\1\33\31\13"+
    "\1\230\5\13\1\33\23\13\2\71\1\134\1\135\4\71"+
    "\4\13\1\0\2\13\1\136\3\71\1\231\10\71\2\13"+
    "\1\71\7\15\1\232\10\15\1\23\25\15\1\233\11\15"+
    "\1\23\17\15\12\234\1\235\25\234\13\236\1\235\24\236"+
    "\10\15\1\237\7\15\1\23\20\15\3\35\1\75\4\35"+
    "\3\15\1\76\3\15\1\37\3\35\1\240\10\35\2\15"+
    "\1\35\5\15\1\241\12\15\1\23\20\15\2\242\1\204"+
    "\1\243\4\242\1\15\1\244\1\245\4\15\1\23\14\242"+
    "\2\15\1\242\6\15\1\246\11\15\1\23\26\15\1\247"+
    "\10\15\1\23\27\15\1\250\7\15\1\23\27\15\1\251"+
    "\7\15\1\23\37\15\1\23\4\15\1\252\12\15\37\212"+
    "\1\253\3\15\1\214\1\254\13\15\1\46\16\15\1\50"+
    "\1\15\3\35\1\75\4\35\3\15\1\76\3\15\1\37"+
    "\10\35\1\255\3\35\2\15\1\35\15\7\1\27\14\7"+
    "\1\256\14\7\1\257\5\7\1\27\32\7\1\260\4\7"+
    "\1\27\23\7\2\57\1\120\1\121\3\57\1\261\4\7"+
    "\1\27\2\7\1\122\5\57\1\261\6\57\2\7\1\57"+
    "\15\11\1\31\2\11\1\0\26\11\1\262\5\11\1\31"+
    "\32\11\1\263\4\11\1\31\22\11\15\13\1\0\6\13"+
    "\1\264\22\13\1\265\5\13\1\33\32\13\1\266\4\13"+
    "\1\33\23\13\2\71\1\134\1\135\4\71\4\13\1\0"+
    "\2\13\1\136\13\71\1\267\2\13\1\71\10\15\1\270"+
    "\7\15\1\23\26\15\1\271\10\15\1\23\17\15\1\0"+
    "\2\272\1\235\1\273\4\272\7\0\1\37\14\272\2\0"+
    "\1\272\11\15\1\16\6\15\1\23\20\15\2\274\1\240"+
    "\1\275\4\274\3\15\1\76\3\15\1\276\14\274\2\15"+
    "\1\274\6\15\1\277\11\15\1\23\20\15\2\147\1\242"+
    "\1\300\4\147\7\15\1\151\14\147\2\15\1\147\5\15"+
    "\1\301\12\15\1\23\17\15\12\244\1\242\5\244\1\302"+
    "\17\244\13\245\1\242\4\245\1\303\17\245\7\15\1\304"+
    "\10\15\1\23\27\15\1\305\7\15\1\23\30\15\1\21"+
    "\6\15\1\23\30\15\1\44\6\15\1\23\27\15\1\306"+
    "\7\15\1\23\5\15\1\306\11\15\3\0\1\253\1\307"+
    "\13\0\1\46\16\0\1\310\5\15\1\311\12\15\1\23"+
    "\20\15\3\35\1\75\4\35\3\15\1\76\3\15\1\37"+
    "\6\35\1\312\5\35\2\15\1\35\10\7\1\313\4\7"+
    "\1\27\10\7\1\313\21\7\1\314\4\7\1\27\33\7"+
    "\1\60\3\7\1\27\23\7\2\57\1\120\1\121\4\57"+
    "\4\7\1\27\2\7\1\122\3\57\1\315\10\57\2\7"+
    "\1\57\10\11\1\316\4\11\1\31\33\11\1\65\3\11"+
    "\1\31\22\11\15\13\1\0\16\13\1\317\13\13\1\320"+
    "\4\13\1\33\33\13\1\72\3\13\1\33\23\13\2\71"+
    "\1\134\1\135\4\71\4\13\1\0\2\13\1\136\10\71"+
    "\1\321\3\71\2\13\1\71\11\15\1\35\6\15\1\23"+
    "\27\15\1\322\7\15\1\23\17\15\1\0\3\272\1\323"+
    "\4\272\3\0\1\324\3\0\1\37\14\272\2\0\1\272"+
    "\5\0\1\325\32\0\1\15\3\274\1\326\4\274\3\15"+
    "\1\327\3\15\1\276\14\274\2\15\1\274\5\15\1\330"+
    "\12\15\1\23\26\15\1\331\10\15\1\23\24\15\1\332"+
    "\12\15\1\23\25\15\1\333\11\15\1\23\17\15\12\334"+
    "\1\335\25\334\13\336\1\335\24\336\10\15\1\337\7\15"+
    "\1\23\30\15\1\102\6\15\1\23\37\15\1\23\6\15"+
    "\1\340\10\15\5\0\1\341\71\0\1\212\6\15\1\342"+
    "\11\15\1\23\20\15\3\35\1\75\4\35\3\15\1\76"+
    "\3\15\1\37\13\35\1\343\2\15\1\35\15\7\1\27"+
    "\6\7\1\344\24\7\1\120\3\7\1\27\23\7\2\57"+
    "\1\120\1\121\4\57\4\7\1\27\2\7\1\225\14\57"+
    "\2\7\1\57\11\11\1\126\3\11\1\31\22\11\15\13"+
    "\1\0\13\13\1\345\17\13\1\134\3\13\1\33\23\13"+
    "\2\71\1\134\1\135\4\71\4\13\1\0\2\13\1\136"+
    "\6\71\1\346\5\71\2\13\1\71\11\15\1\76\6\15"+
    "\1\23\17\15\5\0\1\347\33\0\2\235\1\324\1\350"+
    "\4\235\1\0\1\234\1\236\5\0\14\235\2\0\1\235"+
    "\6\0\1\351\31\0\5\15\1\352\12\15\1\23\20\15"+
    "\2\353\1\327\1\354\4\353\1\15\1\355\1\356\4\15"+
    "\1\23\14\353\2\15\1\353\6\15\1\357\11\15\1\23"+
    "\27\15\1\360\7\15\1\23\25\15\1\361\11\15\1\23"+
    "\26\15\1\362\10\15\1\23\17\15\1\0\2\363\1\335"+
    "\1\364\4\363\7\0\1\151\14\363\2\0\1\363\11\15"+
    "\1\101\6\15\1\23\17\15\12\340\1\365\1\366\4\340"+
    "\1\367\17\340\6\0\1\370\31\0\7\15\1\371\10\15"+
    "\1\23\20\15\2\372\1\343\1\373\4\372\3\15\1\76"+
    "\3\15\1\374\14\372\2\15\1\372\15\7\1\27\2\7"+
    "\1\0\17\7\15\13\1\0\11\13\1\375\11\13\2\71"+
    "\1\134\1\135\4\71\4\13\1\0\2\13\1\136\13\71"+
    "\1\376\2\13\1\71\6\0\1\377\36\0\1\u0100\41\0"+
    "\1\u0101\30\0\6\15\1\u0102\11\15\1\23\20\15\2\274"+
    "\1\353\1\u0103\4\274\7\15\1\276\14\274\2\15\1\274"+
    "\5\15\1\u0104\12\15\1\23\17\15\12\355\1\353\5\355"+
    "\1\u0105\17\355\13\356\1\353\4\356\1\u0106\17\356\7\15"+
    "\1\u0107\10\15\1\23\30\15\1\147\6\15\1\23\26\15"+
    "\1\u0108\10\15\1\23\27\15\1\u0109\7\15\1\23\17\15"+
    "\1\0\3\363\1\u010a\4\363\3\0\1\u010b\3\0\1\151"+
    "\14\363\2\0\1\363\5\0\1\u010c\32\0\12\365\1\340"+
    "\5\365\1\u010d\17\365\13\366\1\340\4\366\1\u010e\17\366"+
    "\7\0\1\u010f\30\0\10\15\1\u0110\7\15\1\23\20\15"+
    "\3\372\1\u0111\4\372\3\15\1\u0112\3\15\1\374\14\372"+
    "\2\15\1\372\5\15\1\u0113\12\15\1\23\17\15\15\13"+
    "\1\0\16\13\1\u0114\4\13\2\71\1\134\1\135\4\71"+
    "\4\13\1\0\2\13\1\225\14\71\2\13\1\71\7\0"+
    "\1\u0115\36\0\1\u0116\41\0\1\u0117\27\0\7\15\1\u0118"+
    "\10\15\1\23\24\15\1\u0119\12\15\1\23\25\15\1\u011a"+
    "\11\15\1\23\17\15\12\u011b\1\u011c\25\u011b\13\u011d\1\u011c"+
    "\24\u011d\10\15\1\u011e\7\15\1\23\27\15\1\u011f\7\15"+
    "\1\23\30\15\1\204\6\15\1\23\17\15\5\0\1\u0120"+
    "\33\0\2\335\1\u010b\1\u0121\4\335\1\0\1\334\1\336"+
    "\5\0\14\335\2\0\1\335\6\0\1\u0122\31\0\12\u0123"+
    "\1\u0124\25\u0123\13\u0125\1\u0124\24\u0125\10\0\1\u0126\27\0"+
    "\11\15\1\214\6\15\1\23\24\15\1\u0127\12\15\1\23"+
    "\20\15\2\u0128\1\u0112\1\u0129\4\u0128\1\15\1\u012a\1\u012b"+
    "\4\15\1\23\14\u0128\2\15\1\u0128\6\15\1\u012c\11\15"+
    "\1\23\17\15\15\13\1\0\2\13\1\0\17\13\10\0"+
    "\1\u012d\36\0\1\u012e\41\0\1\235\26\0\10\15\1\u012f"+
    "\7\15\1\23\25\15\1\u0130\11\15\1\23\26\15\1\u0131"+
    "\10\15\1\23\17\15\1\0\2\u0132\1\u011c\1\u0133\4\u0132"+
    "\7\0\1\276\14\u0132\2\0\1\u0132\11\15\1\240\6\15"+
    "\1\23\30\15\1\242\6\15\1\23\17\15\6\0\1\u0134"+
    "\36\0\1\u0135\41\0\1\u0136\30\0\12\u0124\1\u0123\1\u0125"+
    "\4\u0124\1\367\17\u0124\11\0\1\253\26\0\6\15\1\u0137"+
    "\11\15\1\23\20\15\2\372\1\u0128\1\u0138\4\372\7\15"+
    "\1\374\14\372\2\15\1\372\5\15\1\u0139\12\15\1\23"+
    "\17\15\12\u012a\1\u0128\5\u012a\1\u013a\17\u012a\13\u012b\1\u0128"+
    "\4\u012b\1\u013b\17\u012b\7\15\1\u013c\10\15\1\23\17\15"+
    "\11\0\1\272\36\0\1\u013d\27\0\11\15\1\274\6\15"+
    "\1\23\26\15\1\u013e\10\15\1\23\27\15\1\u013f\7\15"+
    "\1\23\17\15\1\0\3\u0132\1\u0140\4\u0132\3\0\1\u0141"+
    "\3\0\1\276\14\u0132\2\0\1\u0132\5\0\1\u0142\41\0"+
    "\1\u0143\36\0\1\u0144\41\0\1\u0145\27\0\7\15\1\u0146"+
    "\10\15\1\23\24\15\1\u0147\12\15\1\23\25\15\1\u0148"+
    "\11\15\1\23\17\15\12\u0149\1\u014a\25\u0149\13\u014b\1\u014a"+
    "\24\u014b\10\15\1\u014c\7\15\1\23\17\15\11\0\1\324"+
    "\26\0\10\15\1\u014d\7\15\1\23\30\15\1\327\6\15"+
    "\1\23\17\15\5\0\1\u014e\33\0\2\u011c\1\u0141\1\u014f"+
    "\4\u011c\1\0\1\u011b\1\u011d\5\0\14\u011c\2\0\1\u011c"+
    "\6\0\1\u0150\41\0\1\u0151\36\0\1\u0152\41\0\1\335"+
    "\26\0\10\15\1\u0153\7\15\1\23\25\15\1\u0154\11\15"+
    "\1\23\26\15\1\u0155\10\15\1\23\17\15\1\0\2\u0156"+
    "\1\u014a\1\u0157\4\u0156\7\0\1\374\14\u0156\2\0\1\u0156"+
    "\11\15\1\343\6\15\1\23\30\15\1\353\6\15\1\23"+
    "\17\15\6\0\1\u0158\36\0\1\u0159\41\0\1\u015a\41\0"+
    "\1\363\36\0\1\u015b\27\0\11\15\1\372\6\15\1\23"+
    "\26\15\1\u015c\10\15\1\23\27\15\1\u015d\7\15\1\23"+
    "\17\15\1\0\3\u0156\1\u015e\4\u0156\3\0\1\u015f\3\0"+
    "\1\374\14\u0156\2\0\1\u0156\5\0\1\u0160\41\0\1\u0161"+
    "\36\0\1\u0162\41\0\1\u0163\40\0\1\u010b\26\0\10\15"+
    "\1\u0164\7\15\1\23\30\15\1\u0112\6\15\1\23\17\15"+
    "\5\0\1\u0165\33\0\2\u014a\1\u015f\1\u0166\4\u014a\1\0"+
    "\1\u0149\1\u014b\5\0\14\u014a\2\0\1\u014a\6\0\1\u0167"+
    "\41\0\1\u0168\36\0\1\u0169\41\0\1\u011c\26\0\11\15"+
    "\1\u0128\6\15\1\23\17\15\6\0\1\u016a\36\0\1\u016b"+
    "\41\0\1\u016c\41\0\1\u0132\36\0\1\u016d\36\0\1\u016e"+
    "\36\0\1\u016f\41\0\1\u0170\40\0\1\u0141\36\0\1\u0171"+
    "\36\0\1\u0172\41\0\1\u014a\37\0\1\u0156\36\0\1\u0173"+
    "\40\0\1\u015f\26\0";

  private static int [] zzUnpackTrans() {
    int [] result = new int[11072];
    int offset = 0;
    offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result);
    return result;
  }

  private static int zzUnpackTrans(String packed, int offset, int [] result) {
    int i = 0;       /* index in packed string  */
    int j = offset;  /* index in unpacked array */
    int l = packed.length();
    while (i < l) {
      int count = packed.charAt(i++);
      int value = packed.charAt(i++);
      value--;
      do result[j++] = value; while (--count > 0);
    }
    return j;
  }


  /* error codes */
  private static final int ZZ_UNKNOWN_ERROR = 0;
  private static final int ZZ_NO_MATCH = 1;
  private static final int ZZ_PUSHBACK_2BIG = 2;

  /* error messages for the codes above */
  private static final String ZZ_ERROR_MSG[] = {
    "Unkown internal scanner error",
    "Error: could not match input",
    "Error: pushback value was too large"
  };

  /**
   * ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
   */
  private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute();

  private static final String ZZ_ATTRIBUTE_PACKED_0 =
    "\22\1\1\11\3\1\1\0\1\1\1\0\1\1\1\0"+
    "\3\1\1\11\6\1\1\11\7\1\1\0\4\1\1\0"+
    "\4\1\1\0\13\1\1\11\5\1\2\0\1\11\3\0"+
    "\5\1\1\0\5\1\1\0\15\1\1\11\7\1\1\0"+
    "\3\1\1\0\3\1\1\0\20\1\2\0\2\1\1\0"+
    "\3\1\1\0\2\1\1\11\1\0\5\1\3\0\14\1"+
    "\1\0\2\1\1\0\5\1\1\0\5\1\2\0\2\1"+
    "\1\11\10\1\2\0\2\1\1\0\3\1\1\0\3\1"+
    "\3\0\6\1\3\0\2\1\1\0\2\1\2\0\1\1"+
    "\3\0\11\1\2\0\2\1\1\11\1\0\3\1\1\11"+
    "\1\0\1\1\3\0\10\1\3\0\2\1\1\0\4\1"+
    "\4\0\3\1\3\0\2\1\7\0\6\1\2\0\3\1"+
    "\5\0\6\1\1\0\2\1\6\0\3\1\3\0\2\1"+
    "\5\0\3\1\6\0\2\1\6\0\1\1\17\0";

  private static int [] zzUnpackAttribute() {
    int [] result = new int[371];
    int offset = 0;
    offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
    return result;
  }

  private static int zzUnpackAttribute(String packed, int offset, int [] result) {
    int i = 0;       /* index in packed string  */
    int j = offset;  /* index in unpacked array */
    int l = packed.length();
    while (i < l) {
      int count = packed.charAt(i++);
      int value = packed.charAt(i++);
      do result[j++] = value; while (--count > 0);
    }
    return j;
  }

  /** the input device */
  private java.io.Reader zzReader;

  /** the current state of the DFA */
  private int zzState;

  /** the current lexical state */
  private int zzLexicalState = YYINITIAL;

  /** this buffer contains the current text to be matched and is
      the source of the yytext() string */
  private char zzBuffer[] = new char[ZZ_BUFFERSIZE];

  /** the textposition at the last accepting state */
  private int zzMarkedPos;

  /** the textposition at the last state to be included in yytext */
  private int zzPushbackPos;

  /** the current text position in the buffer */
  private int zzCurrentPos;

  /** startRead marks the beginning of the yytext() string in the buffer */
  private int zzStartRead;

  /** endRead marks the last character in the buffer, that has been read
      from input */
  private int zzEndRead;

  /** 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;

  /** 
   * zzAtBOL == true <=> the scanner is currently at the beginning of a line
   */
  private boolean zzAtBOL = true;

  /** zzAtEOF == true <=> the scanner is at the EOF */
  private boolean zzAtEOF;

  /* user code: */

	private int lastToken;

    private int nextState=YYINITIAL;
	
    /** 
     * next Token method that allows you to control if whitespace and comments are
     * returned as tokens.
     */
    public Token getNextToken(boolean returnComments, boolean returnWhiteSpace)throws IOException{
        Token t = getNextToken();
        while (t != null && ((!returnWhiteSpace && t.isWhiteSpace()) || (!returnComments && t.isComment()))){
            t = getNextToken();
        }
        return (t); 
    }

    /**
     * Prints out tokens from a file or System.in.
     * If no arguments are given, System.in will be used for input.
     * If more arguments are given, the first argument will be used as
     * the name of the file to use as input
     *
     * @param args program arguments, of which the first is a filename
     */
    public static void main(String[] args) {
        InputStream in;
        try {
            if (args.length > 0){
                File f = new File(args[0]);
                if (f.exists()){
                    if (f.canRead()){
                        in = new FileInputStream(f);
                    } else {
                        throw new IOException("Could not open " + args[0]);
                    }
                } else {
                    throw new IOException("Could not find " + args[0]);
                }                   
            } else {
                in = System.in;
            }       
            HTMLLexer shredder = new HTMLLexer(in);
            Token t;
            while ((t = shredder.getNextToken()) != null) {
                if (t.getID() != CToken.WHITE_SPACE){
                    System.out.println(t);
                }
            }
        } catch (IOException e){
            System.out.println(e.getMessage());
        }
    }

    /**
     * Closes the current input stream, and resets the scanner to read from a new input stream.
	 * All internal variables are reset, the old input stream  cannot be reused
	 * (content of the internal buffer is discarded and lost).
	 * The lexical state is set to the initial state.
     * Subsequent tokens read from the lexer will start with the line, char, and column
     * values given here.
     *
     * @param reader The new input.
     * @param yyline The line number of the first token.
     * @param yychar The position (relative to the start of the stream) of the first token.
     * @param yycolumn The position (relative to the line) of the first token.
     * @throws IOException if an IOExecption occurs while switching readers.
     */
    public void reset(java.io.Reader reader, int yyline, int yychar, int yycolumn) throws IOException{
        yyreset(reader);
        this.yyline = yyline;
		this.yychar = yychar;
		this.yycolumn = yycolumn;
	}


  /**
   * 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 HTMLLexer(java.io.Reader in) {
    this.zzReader = 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 HTMLLexer(java.io.InputStream in) {
    this(new java.io.InputStreamReader(in));
  }


  /**
   * Refills the input buffer.
   *
   * @return      <code>false</code>, iff there was new input.
   * 
   * @exception   java.io.IOException  if any I/O-Error occurs
   */
  private boolean zzRefill() throws java.io.IOException {

    /* first: make room (if you can) */
    if (zzStartRead > 0) {
      System.arraycopy(zzBuffer, zzStartRead,
                       zzBuffer, 0,
                       zzEndRead-zzStartRead);

      /* translate stored positions */
      zzEndRead-= zzStartRead;
      zzCurrentPos-= zzStartRead;
      zzMarkedPos-= zzStartRead;
      zzPushbackPos-= zzStartRead;
      zzStartRead = 0;
    }

    /* is the buffer big enough? */
    if (zzCurrentPos >= zzBuffer.length) {
      /* if not: blow it up */
      char newBuffer[] = new char[zzCurrentPos*2];
      System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length);
      zzBuffer = newBuffer;
    }

    /* finally: fill the buffer with new input */
    int numRead = zzReader.read(zzBuffer, zzEndRead,
                                            zzBuffer.length-zzEndRead);

    if (numRead < 0) {
      return true;
    }
    else {
      zzEndRead+= numRead;
      return false;
    }
  }

    
  /**
   * Closes the input stream.
   */
  public final void yyclose() throws java.io.IOException {
    zzAtEOF = true;            /* indicate end of file */
    zzEndRead = zzStartRead;  /* invalidate buffer    */

    if (zzReader != null)
      zzReader.close();
  }


  /**
   * Resets the scanner to read from a new input stream.
   * Does not close the old reader.
   *
   * All internal variables are reset, the old input stream 
   * <b>cannot</b> be reused (internal buffer is discarded and lost).
   * Lexical state is set to <tt>ZZ_INITIAL</tt>.
   *
   * @param reader   the new input stream 
   */
  public final void yyreset(java.io.Reader reader) {
    zzReader = reader;
    zzAtBOL  = true;
    zzAtEOF  = false;
    zzEndRead = zzStartRead = 0;
    zzCurrentPos = zzMarkedPos = zzPushbackPos = 0;
    yyline = yychar = yycolumn = 0;
    zzLexicalState = YYINITIAL;
  }


  /**
   * Returns the current lexical state.
   */
  public final int yystate() {
    return zzLexicalState;
  }


  /**
   * Enters a new lexical state
   *
   * @param newState the new lexical state
   */
  public final void yybegin(int newState) {
    zzLexicalState = newState;
  }


  /**
   * Returns the text matched by the current regular expression.
   */
  public final String yytext() {
    return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead );
  }


  /**
   * Returns the character at position <tt>pos</tt> from the 
   * matched text. 
   * 
   * It is equivalent to yytext().charAt(pos), but faster
   *
   * @param pos the position of the character to fetch. 
   *            A value from 0 to yylength()-1.
   *
   * @return the character at position pos
   */
  public final char yycharat(int pos) {
    return zzBuffer[zzStartRead+pos];
  }


  /**
   * Returns the length of the matched text region.
   */
  public final int yylength() {
    return zzMarkedPos-zzStartRead;
  }


  /**
   * Reports an error that occured while scanning.
   *
   * In a wellformed scanner (no or only correct usage of 
   * yypushback(int) and a match-all fallback rule) this method 
   * will only be called with things that "Can't Possibly Happen".
   * If this method is called, something is seriously wrong
   * (e.g. a JFlex bug producing a faulty scanner etc.).
   *
   * Usual syntax/scanner level error handling should be done
   * in error fallback rules.
   *
   * @param   errorCode  the code of the errormessage to display
   */
  private void zzScanError(int errorCode) {
    String message;
    try {
      message = ZZ_ERROR_MSG[errorCode];
    }
    catch (ArrayIndexOutOfBoundsException e) {
      message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
    }

    throw new Error(message);
  } 


  /**
   * 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()!
   */
  public void yypushback(int number)  {
    if ( number > yylength() )
      zzScanError(ZZ_PUSHBACK_2BIG);

    zzMarkedPos -= number;
  }


  /**
   * 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   java.io.IOException  if any I/O-Error occurs
   */
  public Token getNextToken() throws java.io.IOException {
    int zzInput;
    int zzAction;

    // cached fields:
    int zzCurrentPosL;
    int zzMarkedPosL;
    int zzEndReadL = zzEndRead;
    char [] zzBufferL = zzBuffer;
    char [] zzCMapL = ZZ_CMAP;

    int [] zzTransL = ZZ_TRANS;
    int [] zzRowMapL = ZZ_ROWMAP;
    int [] zzAttrL = ZZ_ATTRIBUTE;

    while (true) {
      zzMarkedPosL = zzMarkedPos;

      yychar+= zzMarkedPosL-zzStartRead;

      boolean zzR = false;
      for (zzCurrentPosL = zzStartRead; zzCurrentPosL < zzMarkedPosL;
                                                             zzCurrentPosL++) {
        switch (zzBufferL[zzCurrentPosL]) {
        case '\u000B':
        case '\u000C':
        case '\u0085':
        case '\u2028':
        case '\u2029':
          yyline++;
          zzR = false;
          break;
        case '\r':
          yyline++;
          zzR = true;
          break;
        case '\n':
          if (zzR)
            zzR = false;
          else {
            yyline++;
          }
          break;
        default:
          zzR = false;
        }
      }

      if (zzR) {
        // peek one character ahead if it is \n (if we have counted one line too much)
        boolean zzPeek;
        if (zzMarkedPosL < zzEndReadL)
          zzPeek = zzBufferL[zzMarkedPosL] == '\n';
        else if (zzAtEOF)
          zzPeek = false;
        else {
          boolean eof = zzRefill();
          zzEndReadL = zzEndRead;
          zzMarkedPosL = zzMarkedPos;
          zzBufferL = zzBuffer;
          if (eof) 
            zzPeek = false;
          else 
            zzPeek = zzBufferL[zzMarkedPosL] == '\n';
        }
        if (zzPeek) yyline--;
      }
      zzAction = -1;

      zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
  
      zzState = zzLexicalState;


      zzForAction: {
        while (true) {
    
          if (zzCurrentPosL < zzEndReadL)
            zzInput = zzBufferL[zzCurrentPosL++];
          else if (zzAtEOF) {
            zzInput = YYEOF;
            break zzForAction;
          }
          else {
            // store back cached positions
            zzCurrentPos  = zzCurrentPosL;
            zzMarkedPos   = zzMarkedPosL;
            boolean eof = zzRefill();
            // get translated positions and possibly new buffer
            zzCurrentPosL  = zzCurrentPos;
            zzMarkedPosL   = zzMarkedPos;
            zzBufferL      = zzBuffer;
            zzEndReadL     = zzEndRead;
            if (eof) {
              zzInput = YYEOF;
              break zzForAction;
            }
            else {
              zzInput = zzBufferL[zzCurrentPosL++];
            }
          }
          int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ];
          if (zzNext == -1) break zzForAction;
          zzState = zzNext;

          int zzAttributes = zzAttrL[zzState];
          if ( (zzAttributes & 1) == 1 ) {
            zzAction = zzState;
            zzMarkedPosL = zzCurrentPosL;
            if ( (zzAttributes & 8) == 8 ) break zzForAction;
          }

        }
      }

      // store back cached position
      zzMarkedPos = zzMarkedPosL;

      switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
        case 6: 
          { lastToken = HTMLToken.END_TAG;
	String text = yytext();    
	HTMLToken t = (new HTMLToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));
	return(t);
          }
        case 12: break;
        case 9: 
          { nextState = SCRIPT;
	lastToken = HTMLToken.START_TAG;
	String text = yytext();    
	HTMLToken t = (new HTMLToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));
	yybegin(nextState);
	return(t);
          }
        case 13: break;
        case 2: 
          { lastToken = HTMLToken.SCRIPT;
	String text = yytext();    
	HTMLToken t = (new HTMLToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));
	return(t);
          }
        case 14: break;
        case 11: 
          { nextState = TEXTAREA;
	lastToken = HTMLToken.START_TAG;
	String text = yytext();    
	HTMLToken t = (new HTMLToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));
	yybegin(nextState);
	return(t);
          }
        case 15: break;
        case 10: 
          { lastToken = HTMLToken.DOCTYPE_TAG;
	String text = yytext();    
	HTMLToken t = (new HTMLToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));
	return(t);
          }
        case 16: break;
        case 1: 
          { lastToken = HTMLToken.TEXT;
	String text = yytext();    
	HTMLToken t = (new HTMLToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));
	return(t);
          }
        case 17: break;
        case 7: 
          { nextState = YYINITIAL;
	lastToken = HTMLToken.END_TAG;
	String text = yytext();    
	HTMLToken t = (new HTMLToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));
	yybegin(nextState);
	return(t);
          }
        case 18: break;
        case 5: 
          { lastToken = HTMLToken.COMMENT;
    String text = yytext();    
	HTMLToken t = (new HTMLToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));
	return(t);
          }
        case 19: break;
        case 4: 
          { lastToken = HTMLToken.START_TAG;
	String text = yytext();    
	HTMLToken t = (new HTMLToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));
	return(t);
          }
        case 20: break;
        case 3: 
          { lastToken = HTMLToken.ERROR_MALFORMED_TAG;
	String text = yytext();    
	HTMLToken t = (new HTMLToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));
	return(t);
          }
        case 21: break;
        case 8: 
          { nextState = PRE;
	lastToken = HTMLToken.START_TAG;
	String text = yytext();    
	HTMLToken t = (new HTMLToken(lastToken,text,yyline,yychar,yychar+text.length(),nextState));
	yybegin(nextState);
	return(t);
          }
        case 22: break;
        default: 
          if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
            zzAtEOF = true;
            return null;
          } 
          else {
            zzScanError(ZZ_NO_MATCH);
          }
      }
    }
  }


}
