// Generated by JFlex 1.9.1 http://jflex.de/  (tweaked for IntelliJ platform)
// source: Requirements.flex

package com.jetbrains.python.requirements;

import com.intellij.lexer.FlexLexer;
import com.intellij.psi.tree.IElementType;
import java.util.ArrayDeque;
import java.util.Deque;

import static com.intellij.psi.TokenType.BAD_CHARACTER;
import static com.intellij.psi.TokenType.WHITE_SPACE;
import static com.jetbrains.python.requirements.psi.RequirementsTypes.*;


public class RequirementsLexer implements FlexLexer {

  /** 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 YYINITIAL = 0;
  public static final int WAITING_VERSION = 2;
  public static final int DQUOTE_STR = 4;
  public static final int SQUOTE_STR = 6;
  public static final int QUOTED_MARK = 8;
  public static final int URI = 10;
  public static final int REQ = 12;
  public static final int SHORT_OPTION_STATE = 14;
  public static final int LONG_OPTION_STATE = 16;
  public static final int BINARY = 18;
  public static final int WAITING_HASH = 20;
  public static final int WAITING_EQUAL = 22;
  public static final int WAITING_ALG = 24;
  public static final int WAITING_COLON = 26;
  public static final int WAITING_HASH_VALUE = 28;
  public static final int WAITING_IDENTIFIER = 30;

  /**
   * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l
   * ZZ_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 static final int ZZ_LEXSTATE[] = {
     0,  0,  1,  1,  2,  2,  3,  3,  4,  4,  5,  5,  6,  6,  7,  7, 
     8,  8,  9,  9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15
  };

  /**
   * Top-level table for translating characters to character classes
   */
  private static final int [] ZZ_CMAP_TOP = zzUnpackcmap_top();

  private static final String ZZ_CMAP_TOP_PACKED_0 =
    "\1\0\25\u0100\1\u0200\11\u0100\1\u0300\17\u0100\1\u0400\247\u0100"+
    "\10\u0500\u1020\u0100";

  private static int [] zzUnpackcmap_top() {
    int [] result = new int[4352];
    int offset = 0;
    offset = zzUnpackcmap_top(ZZ_CMAP_TOP_PACKED_0, offset, result);
    return result;
  }

  private static int zzUnpackcmap_top(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;
  }


  /**
   * Second-level tables for translating characters to character classes
   */
  private static final int [] ZZ_CMAP_BLOCKS = zzUnpackcmap_blocks();

  private static final String ZZ_CMAP_BLOCKS_PACKED_0 =
    "\11\0\1\1\1\2\2\3\1\2\22\0\1\1\1\4"+
    "\1\5\1\6\1\7\1\10\1\11\1\12\1\13\1\14"+
    "\1\15\1\16\1\17\1\20\1\21\1\22\12\23\1\24"+
    "\1\25\1\26\1\27\1\26\1\30\1\31\6\32\24\33"+
    "\1\34\1\35\1\36\1\37\1\40\1\37\1\41\1\42"+
    "\1\43\1\44\1\45\1\46\1\33\1\47\1\50\1\33"+
    "\1\51\1\52\1\53\1\54\1\55\1\56\1\57\1\60"+
    "\1\61\1\62\1\63\1\64\1\33\1\65\1\66\1\33"+
    "\1\67\1\70\1\71\1\72\6\0\1\3\32\0\1\1"+
    "\u01df\0\1\1\177\0\13\1\35\0\2\3\5\0\1\1"+
    "\57\0\1\1\240\0\1\1\377\0\u0100\73";

  private static int [] zzUnpackcmap_blocks() {
    int [] result = new int[1536];
    int offset = 0;
    offset = zzUnpackcmap_blocks(ZZ_CMAP_BLOCKS_PACKED_0, offset, result);
    return result;
  }

  private static int zzUnpackcmap_blocks(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 DFA states to action switch labels.
   */
  private static final int [] ZZ_ACTION = zzUnpackAction();

  private static final String ZZ_ACTION_PACKED_0 =
    "\20\0\1\1\1\2\1\3\1\4\1\5\2\6\1\1"+
    "\1\7\1\10\1\11\1\12\1\11\1\13\1\1\1\14"+
    "\1\15\1\16\1\17\1\20\1\21\10\1\1\2\1\22"+
    "\1\23\1\24\1\25\1\26\1\27\1\30\1\31\1\32"+
    "\1\33\1\34\1\35\1\36\1\37\1\40\1\41\1\42"+
    "\1\43\1\44\1\2\1\1\1\45\1\1\1\46\1\47"+
    "\1\50\1\51\1\1\1\52\1\53\1\54\1\55\1\56"+
    "\1\57\12\1\1\47\2\1\1\60\1\61\1\62\1\63"+
    "\1\64\1\65\1\66\1\67\1\0\1\70\1\21\3\0"+
    "\1\71\1\0\1\72\4\0\1\51\1\73\22\0\1\74"+
    "\2\0\1\75\13\0\1\76\32\0\1\77\1\100\21\0"+
    "\1\101\22\0\1\102\32\0\1\103\16\0\1\104\36\0"+
    "\1\105\3\0\1\106\12\0\1\107\7\0\1\110\6\0"+
    "\1\111\2\0\1\112\13\0";

  private static int [] zzUnpackAction() {
    int [] result = new int[332];
    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\74\0\170\0\264\0\360\0\u012c\0\u0168\0\u01a4"+
    "\0\u01e0\0\u021c\0\u0258\0\u0294\0\u02d0\0\u030c\0\u0348\0\u0384"+
    "\0\u03c0\0\u03fc\0\u03c0\0\u0438\0\u0474\0\u03c0\0\u04b0\0\u04ec"+
    "\0\u0528\0\u0564\0\u05a0\0\u03c0\0\u05dc\0\u03c0\0\u0618\0\u03c0"+
    "\0\u0654\0\u03c0\0\u03c0\0\u03c0\0\u0618\0\u0690\0\u06cc\0\u0708"+
    "\0\u0744\0\u0780\0\u07bc\0\u07f8\0\u0834\0\u0870\0\u03c0\0\u03c0"+
    "\0\u03c0\0\u03c0\0\u03c0\0\u03c0\0\u03c0\0\u03c0\0\u03c0\0\u03c0"+
    "\0\u03c0\0\u03c0\0\u03c0\0\u03c0\0\u03c0\0\u03c0\0\u03c0\0\u03c0"+
    "\0\u03c0\0\u08ac\0\u08e8\0\u03c0\0\u0924\0\u03c0\0\u0960\0\u03c0"+
    "\0\u08e8\0\u099c\0\u03c0\0\u03c0\0\u03c0\0\u03c0\0\u03c0\0\u03c0"+
    "\0\u09d8\0\u0a14\0\u0a50\0\u0a8c\0\u0ac8\0\u0b04\0\u0b40\0\u0b7c"+
    "\0\u0bb8\0\u0bf4\0\u0c30\0\u0c6c\0\u0ca8\0\u03c0\0\u0ce4\0\u03c0"+
    "\0\u0d20\0\u0d5c\0\u0d98\0\u0dd4\0\u03c0\0\u04b0\0\u03c0\0\u03c0"+
    "\0\u0e10\0\u0e4c\0\u0e88\0\u03c0\0\u0ec4\0\u03c0\0\u0f00\0\u0f3c"+
    "\0\u0f78\0\u0fb4\0\u03c0\0\u03c0\0\u0ff0\0\u102c\0\u1068\0\u10a4"+
    "\0\u10e0\0\u111c\0\u1158\0\u1194\0\u11d0\0\u120c\0\u1248\0\u1284"+
    "\0\u0c30\0\u12c0\0\u12fc\0\u1338\0\u0ce4\0\u0dd4\0\u03c0\0\u1374"+
    "\0\u13b0\0\u03c0\0\u13ec\0\u1428\0\u1464\0\u14a0\0\u14dc\0\u1518"+
    "\0\u1554\0\u1590\0\u15cc\0\u1608\0\u1644\0\u1680\0\u16bc\0\u16f8"+
    "\0\u1734\0\u1770\0\u17ac\0\u17e8\0\u1824\0\u1860\0\u189c\0\u18d8"+
    "\0\u1914\0\u1950\0\u198c\0\u19c8\0\u1a04\0\u1a40\0\u1a7c\0\u1ab8"+
    "\0\u1af4\0\u1b30\0\u1b6c\0\u1ba8\0\u1be4\0\u1c20\0\u1c5c\0\u1c98"+
    "\0\u03c0\0\u03c0\0\u1cd4\0\u1d10\0\u1d4c\0\u1d88\0\u1dc4\0\u1e00"+
    "\0\u1e3c\0\u1e78\0\u1eb4\0\u1ef0\0\u1f2c\0\u1f68\0\u1fa4\0\u1fe0"+
    "\0\u201c\0\u2058\0\u2094\0\u03c0\0\u20d0\0\u210c\0\u2148\0\u2184"+
    "\0\u21c0\0\u21fc\0\u2238\0\u2274\0\u22b0\0\u22ec\0\u2328\0\u2364"+
    "\0\u23a0\0\u23dc\0\u2418\0\u2454\0\u2490\0\u24cc\0\u03c0\0\u2508"+
    "\0\u2544\0\u2580\0\u25bc\0\u25f8\0\u2634\0\u2670\0\u26ac\0\u26e8"+
    "\0\u2724\0\u2760\0\u279c\0\u27d8\0\u2814\0\u2850\0\u288c\0\u28c8"+
    "\0\u2904\0\u2940\0\u297c\0\u29b8\0\u29f4\0\u2a30\0\u2a6c\0\u2aa8"+
    "\0\u2ae4\0\u03c0\0\u2b20\0\u2b5c\0\u2b98\0\u2bd4\0\u2c10\0\u2c4c"+
    "\0\u2c88\0\u2cc4\0\u2d00\0\u2d3c\0\u2d78\0\u2db4\0\u2df0\0\u2e2c"+
    "\0\u03c0\0\u2e68\0\u2ea4\0\u2ee0\0\u2f1c\0\u2f58\0\u2f94\0\u2fd0"+
    "\0\u300c\0\u3048\0\u3084\0\u30c0\0\u30fc\0\u3138\0\u3174\0\u31b0"+
    "\0\u31ec\0\u3228\0\u3264\0\u32a0\0\u32dc\0\u3318\0\u3354\0\u3390"+
    "\0\u33cc\0\u3408\0\u3444\0\u3480\0\u34bc\0\u34f8\0\u3534\0\u03c0"+
    "\0\u3570\0\u35ac\0\u35e8\0\u03c0\0\u3624\0\u3660\0\u369c\0\u36d8"+
    "\0\u3714\0\u3750\0\u378c\0\u37c8\0\u3804\0\u3840\0\u03c0\0\u387c"+
    "\0\u38b8\0\u38f4\0\u3930\0\u396c\0\u39a8\0\u39e4\0\u03c0\0\u3a20"+
    "\0\u3a5c\0\u3a98\0\u3ad4\0\u3b10\0\u3b4c\0\u03c0\0\u3b88\0\u3bc4"+
    "\0\u03c0\0\u3c00\0\u3c3c\0\u3c78\0\u3cb4\0\u3cf0\0\u3d2c\0\u3d68"+
    "\0\u3da4\0\u3de0\0\u3e1c\0\u3e58";

  private static int [] zzUnpackRowMap() {
    int [] result = new int[332];
    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() - 1;
    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 =
    "\1\21\1\22\1\23\1\22\2\21\1\24\11\21\1\25"+
    "\1\26\1\21\1\27\6\21\2\27\1\21\1\30\3\21"+
    "\26\27\1\21\1\23\4\21\1\22\1\23\1\22\1\31"+
    "\1\21\1\32\6\21\2\31\1\21\2\31\1\21\1\31"+
    "\6\21\2\31\1\21\1\30\2\21\27\31\1\21\1\23"+
    "\4\21\1\33\1\23\2\33\1\34\27\33\1\30\35\33"+
    "\2\21\1\35\1\23\7\35\1\36\22\35\1\30\35\35"+
    "\2\21\1\22\1\23\1\22\1\37\1\40\1\41\3\21"+
    "\1\42\1\43\1\44\11\21\1\45\1\46\5\21\1\30"+
    "\3\21\1\47\3\21\1\50\2\21\1\51\3\21\1\52"+
    "\1\53\1\54\2\21\1\55\6\21\1\23\1\21\1\37"+
    "\2\21\1\56\1\23\1\56\1\57\1\21\1\60\1\61"+
    "\1\62\5\57\1\63\1\57\1\64\1\65\1\66\1\67"+
    "\1\70\1\57\1\21\1\57\1\71\1\72\2\73\1\74"+
    "\1\30\1\75\1\21\1\76\26\73\1\77\1\23\1\100"+
    "\1\101\2\21\1\102\1\23\1\102\1\103\6\21\1\43"+
    "\1\44\2\21\1\104\1\105\1\106\1\21\1\107\1\21"+
    "\1\110\1\111\1\112\1\21\1\113\2\107\1\74\1\30"+
    "\1\75\2\21\26\107\1\21\1\23\1\21\1\103\2\21"+
    "\1\22\1\23\1\22\31\21\1\30\5\21\1\114\1\21"+
    "\1\115\1\116\1\21\1\117\7\21\1\120\7\21\1\23"+
    "\4\21\1\22\1\23\1\22\31\21\1\30\5\21\1\121"+
    "\1\21\1\122\1\123\1\21\1\124\3\21\1\125\1\126"+
    "\1\127\1\21\1\130\1\21\1\131\1\132\4\21\1\23"+
    "\4\21\1\22\1\23\1\22\13\21\1\104\3\21\1\133"+
    "\1\134\5\21\2\133\1\21\1\30\3\21\26\133\1\21"+
    "\1\23\4\21\1\22\1\23\1\22\31\21\1\30\11\21"+
    "\1\135\20\21\1\23\4\21\1\22\1\23\1\22\23\21"+
    "\1\136\5\21\1\30\32\21\1\23\4\21\1\22\1\23"+
    "\1\22\17\21\1\137\6\21\2\137\1\21\1\30\3\21"+
    "\26\137\1\21\1\23\4\21\1\22\1\23\1\22\20\21"+
    "\1\140\10\21\1\30\32\21\1\23\4\21\1\141\1\23"+
    "\1\141\2\21\1\142\14\21\1\143\6\21\1\143\2\21"+
    "\1\30\3\21\6\143\21\21\1\23\4\21\1\22\1\23"+
    "\1\22\17\21\1\144\6\21\2\144\1\21\1\30\3\21"+
    "\26\144\1\21\1\23\3\21\75\0\1\22\1\0\1\22"+
    "\70\0\2\24\2\0\67\24\21\0\1\145\73\0\2\146"+
    "\1\0\1\27\6\0\2\27\4\0\1\146\26\27\7\0"+
    "\1\147\65\0\1\147\7\0\1\31\10\0\2\31\1\0"+
    "\2\31\1\0\1\31\6\0\2\31\4\0\27\31\5\0"+
    "\2\32\2\0\67\32\2\0\1\33\1\0\2\33\1\0"+
    "\27\33\1\0\35\33\2\0\1\35\1\0\7\35\1\0"+
    "\22\35\1\0\35\35\30\0\1\150\44\0\2\41\2\0"+
    "\67\41\30\0\1\45\120\0\1\151\104\0\1\152\61\0"+
    "\1\153\1\154\74\0\1\155\76\0\1\156\1\157\64\0"+
    "\1\160\13\0\1\161\73\0\1\162\6\0\1\56\1\0"+
    "\1\56\2\0\1\41\16\0\1\110\47\0\1\102\1\0"+
    "\1\102\2\0\1\41\114\0\1\163\64\0\1\164\71\0"+
    "\1\106\1\0\2\165\1\106\1\107\1\106\5\0\2\107"+
    "\4\0\1\165\26\107\34\0\1\111\121\0\1\166\62\0"+
    "\1\167\20\0\1\170\56\0\1\171\77\0\1\172\74\0"+
    "\1\173\72\0\1\174\77\0\1\175\60\0\1\176\106\0"+
    "\1\177\74\0\1\200\32\0\2\201\1\0\1\133\6\0"+
    "\2\133\4\0\1\201\26\133\46\0\1\202\12\0\1\203"+
    "\60\0\1\204\52\0\2\205\1\0\1\137\6\0\2\137"+
    "\4\0\1\205\26\137\6\0\1\141\1\0\1\141\70\0"+
    "\2\142\2\0\67\142\24\0\1\143\6\0\1\143\6\0"+
    "\6\143\45\0\2\206\1\0\1\144\6\0\2\144\4\0"+
    "\1\206\26\144\51\0\1\207\111\0\1\210\67\0\1\211"+
    "\77\0\1\212\51\0\1\213\74\0\1\214\114\0\1\215"+
    "\72\0\1\216\32\0\2\165\1\0\1\107\6\0\2\107"+
    "\4\0\1\165\26\107\61\0\1\217\67\0\1\220\105\0"+
    "\1\221\65\0\1\222\63\0\1\223\47\0\1\224\125\0"+
    "\1\225\66\0\1\226\105\0\1\227\77\0\1\230\55\0"+
    "\1\231\100\0\1\232\76\0\1\233\77\0\1\234\72\0"+
    "\1\235\65\0\1\236\75\0\1\237\101\0\1\240\60\0"+
    "\1\241\64\0\1\242\114\0\1\243\74\0\1\244\71\0"+
    "\1\245\57\0\1\246\74\0\1\247\70\0\1\250\5\0"+
    "\1\251\111\0\1\252\53\0\1\253\110\0\1\254\71\0"+
    "\1\255\32\0\1\256\125\0\1\257\75\0\1\260\66\0"+
    "\1\261\65\0\1\262\77\0\1\263\67\0\1\264\100\0"+
    "\1\265\102\0\1\266\74\0\1\267\77\0\1\270\52\0"+
    "\1\271\73\0\1\272\52\0\1\273\140\0\1\274\56\0"+
    "\1\275\77\0\1\276\37\0\1\277\120\0\1\300\76\0"+
    "\1\301\105\0\1\302\57\0\1\303\51\0\1\304\114\0"+
    "\1\305\101\0\1\306\73\0\1\307\75\0\1\310\72\0"+
    "\1\311\71\0\1\312\101\0\1\313\55\0\1\314\51\0"+
    "\1\315\125\0\1\316\41\0\1\317\127\0\1\320\63\0"+
    "\1\321\71\0\1\322\111\0\1\323\73\0\1\324\60\0"+
    "\1\325\73\0\1\326\52\0\1\327\114\0\1\330\73\0"+
    "\1\262\106\0\1\331\53\0\1\332\74\0\1\333\73\0"+
    "\1\334\104\0\1\335\71\0\1\336\73\0\1\337\106\0"+
    "\1\340\51\0\1\341\77\0\1\342\76\0\1\343\43\0"+
    "\1\344\120\0\1\345\72\0\1\346\70\0\1\347\106\0"+
    "\1\350\72\0\1\351\66\0\1\352\15\0\1\353\71\0"+
    "\1\354\61\0\1\355\70\0\1\115\102\0\1\356\73\0"+
    "\1\357\77\0\1\360\73\0\1\361\100\0\1\362\62\0"+
    "\1\363\61\0\1\364\51\0\1\365\32\0\1\366\40\0"+
    "\1\367\135\0\1\370\73\0\1\371\51\0\1\372\116\0"+
    "\1\373\55\0\1\374\74\0\1\375\101\0\1\376\63\0"+
    "\1\377\100\0\1\u0100\74\0\1\117\107\0\1\u0101\46\0"+
    "\1\u0102\102\0\1\u0103\72\0\1\u0104\71\0\1\u0105\75\0"+
    "\1\u0106\107\0\1\u0107\51\0\1\u0108\105\0\1\u0109\2\0"+
    "\1\u010a\1\0\1\u010b\1\u010c\2\0\1\353\61\0\1\u010d"+
    "\101\0\1\u010e\70\0\1\u010f\100\0\1\114\56\0\1\u0110"+
    "\107\0\1\116\72\0\1\u0111\67\0\1\u0112\60\0\1\u0113"+
    "\106\0\1\u0114\74\0\1\u0115\76\0\1\u0116\75\0\1\u0117"+
    "\52\0\1\u0118\120\0\1\u0119\52\0\1\u011a\114\0\1\u011b"+
    "\57\0\1\u011c\102\0\1\u011d\72\0\1\u011e\100\0\1\u011f"+
    "\74\0\1\u0120\46\0\1\u0121\113\0\1\u0122\74\0\1\120"+
    "\72\0\1\u0123\57\0\1\u0124\76\0\1\u0125\66\0\1\u0126"+
    "\112\0\1\u0127\63\0\1\u0128\102\0\1\u0129\52\0\1\u012a"+
    "\103\0\1\u012b\76\0\1\262\40\0\1\u012c\133\0\1\u012d"+
    "\62\0\1\u012e\106\0\1\u012f\66\0\1\u0130\65\0\1\u0131"+
    "\73\0\1\u0132\71\0\1\u0133\110\0\1\u0134\75\0\1\353"+
    "\64\0\1\u0135\101\0\1\u0136\76\0\1\u0137\52\0\1\u0138"+
    "\102\0\1\u0139\67\0\1\u013a\100\0\1\u013b\57\0\1\u013c"+
    "\77\0\1\u011e\102\0\1\262\77\0\1\u013d\74\0\1\u013e"+
    "\52\0\1\u013f\107\0\1\307\73\0\1\u0140\100\0\1\307"+
    "\64\0\1\u0141\75\0\1\237\7\0\1\353\47\0\1\u0142"+
    "\103\0\1\u0143\76\0\1\u0144\76\0\1\u0145\67\0\1\u0146"+
    "\66\0\1\u0147\101\0\1\u0148\65\0\1\u0149\102\0\1\u014a"+
    "\101\0\1\u014b\52\0\1\u014c\114\0\1\u011d\11\0";

  private static int [] zzUnpacktrans() {
    int [] result = new int[16020];
    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 = {
    "Unknown internal scanner error",
    "Error: could not match input",
    "Error: pushback value was too large"
  };

  /**
   * ZZ_ATTRIBUTE[aState] contains the attributes of state {@code aState}
   */
  private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute();

  private static final String ZZ_ATTRIBUTE_PACKED_0 =
    "\20\0\1\11\1\1\1\11\2\1\1\11\5\1\1\11"+
    "\1\1\1\11\1\1\1\11\1\1\3\11\12\1\23\11"+
    "\2\1\1\11\1\1\1\11\1\1\1\11\2\1\6\11"+
    "\15\1\1\11\1\1\1\11\4\1\1\11\1\0\2\11"+
    "\3\0\1\11\1\0\1\11\4\0\2\11\22\0\1\11"+
    "\2\0\1\11\13\0\1\1\32\0\2\11\21\0\1\11"+
    "\22\0\1\11\32\0\1\11\16\0\1\11\36\0\1\11"+
    "\3\0\1\11\12\0\1\11\7\0\1\11\6\0\1\11"+
    "\2\0\1\11\13\0";

  private static int [] zzUnpackAttribute() {
    int [] result = new int[332];
    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 CharSequence zzBuffer = "";

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

  /** 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;

  /** zzAtEOF == true <=> the scanner is at the EOF */
  private boolean zzAtEOF;

  /** Number of newlines encountered up to the start of the matched text. */
  @SuppressWarnings("unused")
  private int yyline;

  /** Number of characters from the last newline up to the start of the matched text. */
  @SuppressWarnings("unused")
  protected int yycolumn;

  /** Number of characters up to the start of the matched text. */
  @SuppressWarnings("unused")
  private long yychar;

  /** Whether the scanner is currently at the beginning of a line. */
  @SuppressWarnings("unused")
  private boolean zzAtBOL = true;

  /** Whether the user-EOF-code has already been executed. */
  private boolean zzEOFDone;

  /* user code: */
  public RequirementsLexer() {
      this((java.io.Reader)null);
  }

  Deque<Integer> stack = new ArrayDeque<>();

  public final void yypush(int newState) {
      yybegin(newState);
      stack.push(newState);
  }

  public final int yypop() {
      if (stack.size() == 0) {
          yyinitial();
          return YYINITIAL;
      }

      int state = stack.pop();

      if (stack.peek() == null) {
          yyinitial();
      } else {
          yybegin(stack.peek());
      }

      return state;
  }

  public final void yyinitial() {
      stack.clear();
      yypush(YYINITIAL);
  }


  /**
   * Creates a new scanner
   *
   * @param   in  the java.io.Reader to read input from.
   */
  public RequirementsLexer(java.io.Reader in) {
    this.zzReader = in;
  }


  /** Returns the maximum size of the scanner buffer, which limits the size of tokens. */
  private int zzMaxBufferLen() {
    return Integer.MAX_VALUE;
  }

  /**  Whether the scanner buffer can grow to accommodate a larger token. */
  private boolean zzCanGrow() {
    return true;
  }

  /**
   * Translates raw input code points to DFA table row
   */
  private static int zzCMap(int input) {
    int offset = input & 255;
    return offset == input ? ZZ_CMAP_BLOCKS[offset] : ZZ_CMAP_BLOCKS[ZZ_CMAP_TOP[input >> 8] | offset];
  }

  public final int getTokenStart() {
    return zzStartRead;
  }

  public final int getTokenEnd() {
    return getTokenStart() + yylength();
  }

  public void reset(CharSequence buffer, int start, int end, int initialState) {
    zzBuffer = buffer;
    zzCurrentPos = zzMarkedPos = zzStartRead = start;
    zzAtEOF  = false;
    zzAtBOL = true;
    zzEndRead = end;
    yybegin(initialState);
  }

  /**
   * Refills the input buffer.
   *
   * @return      {@code false}, iff there was new input.
   *
   * @exception   java.io.IOException  if any I/O-Error occurs
   */
  private boolean zzRefill() throws java.io.IOException {
    return true;
  }


  /**
   * 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 CharSequence yytext() {
    return zzBuffer.subSequence(zzStartRead, zzMarkedPos);
  }


  /**
   * Returns the character at position {@code pos} 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.charAt(zzStartRead+pos);
  }


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


  /**
   * Reports an error that occurred 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;
  }


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


  /**
   * 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 IElementType advance() throws java.io.IOException
  {
    int zzInput;
    int zzAction;

    // cached fields:
    int zzCurrentPosL;
    int zzMarkedPosL;
    int zzEndReadL = zzEndRead;
    CharSequence zzBufferL = zzBuffer;

    int [] zzTransL = ZZ_TRANS;
    int [] zzRowMapL = ZZ_ROWMAP;
    int [] zzAttrL = ZZ_ATTRIBUTE;

    while (true) {
      zzMarkedPosL = zzMarkedPos;

      zzAction = -1;

      zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;

      zzState = ZZ_LEXSTATE[zzLexicalState];

      // set up zzAction for empty match case:
      int zzAttributes = zzAttrL[zzState];
      if ( (zzAttributes & 1) == 1 ) {
        zzAction = zzState;
      }


      zzForAction: {
        while (true) {

          if (zzCurrentPosL < zzEndReadL) {
            zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL);
            zzCurrentPosL += Character.charCount(zzInput);
          }
          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 = Character.codePointAt(zzBufferL, zzCurrentPosL);
              zzCurrentPosL += Character.charCount(zzInput);
            }
          }
          int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMap(zzInput) ];
          if (zzNext == -1) break zzForAction;
          zzState = zzNext;

          zzAttributes = zzAttrL[zzState];
          if ( (zzAttributes & 1) == 1 ) {
            zzAction = zzState;
            zzMarkedPosL = zzCurrentPosL;
            if ( (zzAttributes & 8) == 8 ) break zzForAction;
          }

        }
      }

      // store back cached position
      zzMarkedPos = zzMarkedPosL;

      if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
        zzAtEOF = true;
            zzDoEOF();
        return null;
      }
      else {
        switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
          case 1:
            { yyinitial(); return BAD_CHARACTER;
            }
          // fall through
          case 75: break;
          case 2:
            { return WHITE_SPACE;
            }
          // fall through
          case 76: break;
          case 3:
            { yyinitial(); return EOL;
            }
          // fall through
          case 77: break;
          case 4:
            { return COMMENT;
            }
          // fall through
          case 78: break;
          case 5:
            { yypush(SHORT_OPTION_STATE); return SHORT_OPTION;
            }
          // fall through
          case 79: break;
          case 6:
            { yypush(REQ); yypushback(yylength());
            }
          // fall through
          case 80: break;
          case 7:
            { yypop(); return VERSION;
            }
          // fall through
          case 81: break;
          case 8:
            { yypop(); return COMMENT;
            }
          // fall through
          case 82: break;
          case 9:
            { return PYTHON_STR_C;
            }
          // fall through
          case 83: break;
          case 10:
            { yypop(); return DQUOTE;
            }
          // fall through
          case 84: break;
          case 11:
            { yypop(); return SQUOTE;
            }
          // fall through
          case 85: break;
          case 12:
            { yypush(DQUOTE_STR); return DQUOTE;
            }
          // fall through
          case 86: break;
          case 13:
            { yyinitial(); return COMMENT;
            }
          // fall through
          case 87: break;
          case 14:
            { yypush(SQUOTE_STR); return SQUOTE;
            }
          // fall through
          case 88: break;
          case 15:
            { return LPARENTHESIS;
            }
          // fall through
          case 89: break;
          case 16:
            { return RPARENTHESIS;
            }
          // fall through
          case 90: break;
          case 17:
            { return VERSION_CMP;
            }
          // fall through
          case 91: break;
          case 18:
            { return SUB_DELIMS;
            }
          // fall through
          case 92: break;
          case 19:
            { return SHARP;
            }
          // fall through
          case 93: break;
          case 20:
            { return DOLLAR_SIGN;
            }
          // fall through
          case 94: break;
          case 21:
            { return PERCENT_SIGN;
            }
          // fall through
          case 95: break;
          case 22:
            { return PLUS;
            }
          // fall through
          case 96: break;
          case 23:
            { return MINUS;
            }
          // fall through
          case 97: break;
          case 24:
            { return DOT;
            }
          // fall through
          case 98: break;
          case 25:
            { return SLASH;
            }
          // fall through
          case 99: break;
          case 26:
            { return DIGIT;
            }
          // fall through
          case 100: break;
          case 27:
            { return COLON;
            }
          // fall through
          case 101: break;
          case 28:
            { return QUESTION_MARK;
            }
          // fall through
          case 102: break;
          case 29:
            { return AT;
            }
          // fall through
          case 103: break;
          case 30:
            { return LETTER;
            }
          // fall through
          case 104: break;
          case 31:
            { return LSBRACE;
            }
          // fall through
          case 105: break;
          case 32:
            { return RSBRACE;
            }
          // fall through
          case 106: break;
          case 33:
            { return UNDERSCORE;
            }
          // fall through
          case 107: break;
          case 34:
            { return LBRACE;
            }
          // fall through
          case 108: break;
          case 35:
            { return RBRACE;
            }
          // fall through
          case 109: break;
          case 36:
            { return TILDA;
            }
          // fall through
          case 110: break;
          case 37:
            { return COMMA;
            }
          // fall through
          case 111: break;
          case 38:
            { yypush(URI); yypushback(yylength());
            }
          // fall through
          case 112: break;
          case 39:
            { return IDENTIFIER;
            }
          // fall through
          case 113: break;
          case 40:
            { yypush(QUOTED_MARK); return SEMICOLON;
            }
          // fall through
          case 114: break;
          case 41:
            { yypush(WAITING_VERSION); return VERSION_CMP;
            }
          // fall through
          case 115: break;
          case 42:
            { yypush(URI); return AT;
            }
          // fall through
          case 116: break;
          case 43:
            { yypush(URI); return CONSTRAINT;
            }
          // fall through
          case 117: break;
          case 44:
            { yypush(URI); return EDITABLE;
            }
          // fall through
          case 118: break;
          case 45:
            { yypush(URI); return FIND_LINKS;
            }
          // fall through
          case 119: break;
          case 46:
            { yypush(URI); return INDEX_URL;
            }
          // fall through
          case 120: break;
          case 47:
            { yypush(URI); return REFER;
            }
          // fall through
          case 121: break;
          case 48:
            { yypush(WAITING_ALG); return EQUAL;
            }
          // fall through
          case 122: break;
          case 49:
            { yypush(WAITING_COLON); return IDENTIFIER;
            }
          // fall through
          case 123: break;
          case 50:
            { yypush(WAITING_HASH_VALUE); return COLON;
            }
          // fall through
          case 124: break;
          case 51:
            { yypush(REQ); return WHITE_SPACE;
            }
          // fall through
          case 125: break;
          case 52:
            { yypush(REQ); return COMMENT;
            }
          // fall through
          case 126: break;
          case 53:
            { yypush(REQ); return HEX;
            }
          // fall through
          case 127: break;
          case 54:
            { yyinitial(); return IDENTIFIER;
            }
          // fall through
          case 128: break;
          case 55:
            { yypush(LONG_OPTION_STATE); return LONG_OPTION;
            }
