/* ---------------------------------------------------------------------
%   Copyright (C) 2007 Association for the COINS Compiler Infrastructure
%       (Read COPYING for detailed information.)
--------------------------------------------------------------------- */
/* The following code was generated by JFlex 1.4.1 on 04/11/16 11:07 */

package coins.ffront;


/**
 * This class is a scanner generated by 
 * <a href="http://www.jflex.de/">JFlex</a> 1.4.1
 * on 04/11/16 11:07 from the specification file
 * <tt>D:/ko1/coins/coins-0.10.2/src/coins/ffront/f77k.lex</tt>
 */
public class Scanner implements Parser.yyInput {

  /** 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 FORMAT = 1;
  public static final int FORMAT_H = 2;

  /** 
   * Translates characters to character classes
   */
  private static final char [] ZZ_CMAP = {
     0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  1,  0,  0,  2,  0,  0, 
     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 
     2, 23, 13, 28,  0,  0,  0, 12, 48, 47, 15,  8,  3,  8,  6, 16, 
     4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  3, 30, 17, 20, 21,  0, 
    29, 25, 39, 41,  7,  9, 32, 22, 14, 38,  5, 45, 18, 42, 24, 10, 
    40, 11, 26, 33, 19, 31, 27, 46, 43, 44,  5,  0,  0,  0,  0, 34, 
     0,  5,  5,  5,  5, 36,  5,  5,  5,  5,  5,  5, 35,  5,  5,  5, 
     5,  5,  5,  5, 37,  5,  5,  5,  5,  5,  5,  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 =
    "\3\0\1\1\1\2\1\3\1\4\1\5\1\6\3\1"+
    "\2\4\1\7\1\4\1\10\1\1\1\11\1\1\1\12"+
    "\1\1\4\13\1\14\1\15\1\16\3\0\1\17\11\0"+
    "\1\20\1\0\1\20\1\21\1\22\1\23\1\24\1\25"+
    "\1\26\1\27\21\0\1\30\1\0\1\13\1\0\1\13"+
    "\1\0\1\31\1\0\1\17\14\0\1\32\10\0\1\33"+
    "\14\0\1\34\12\0\1\35\1\0\1\36\1\7\1\0"+
    "\1\10\11\0\1\37\20\0\1\40\17\0\1\41\2\0"+
    "\1\42\1\43\2\0\1\44\2\0\1\45\6\0\1\46"+
    "\1\0\1\47\1\50\3\0\1\51\1\52\3\0\1\53"+
    "\1\54\20\0\1\55\1\0\1\56\1\57\5\0\1\60"+
    "\2\0\1\61\1\62\20\0\1\63\1\0\1\64\5\0"+
    "\1\65\1\66\1\67\3\0\1\70\1\0\1\71\3\0"+
    "\1\72\1\73\1\74\1\75\15\0\1\76\4\0\1\77"+
    "\1\0\1\100\4\0\1\101\1\102\5\0\1\103\1\0"+
    "\1\104\5\0\1\105\1\106\1\0\1\107\2\0\1\110"+
    "\3\0\1\111\3\0\1\112\3\0\1\113\1\114\1\115"+
    "\1\116\1\117\1\120\3\0\1\121\1\0\1\122\1\123"+
    "\3\0\1\124";

  private static int [] zzUnpackAction() {
    int [] result = new int[347];
    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\61\0\142\0\223\0\223\0\223\0\223\0\304"+
    "\0\365\0\u0126\0\u0157\0\u0188\0\u01b9\0\u01ea\0\u021b\0\u024c"+
    "\0\u027d\0\u02ae\0\223\0\u02df\0\223\0\u0310\0\223\0\u0341"+
    "\0\u0372\0\u03a3\0\223\0\223\0\223\0\u03d4\0\u0405\0\u0436"+
    "\0\u0467\0\u0498\0\u04c9\0\u04fa\0\u052b\0\u055c\0\u058d\0\u05be"+
    "\0\u05ef\0\u0157\0\u0620\0\u0188\0\u0651\0\223\0\223\0\223"+
    "\0\223\0\223\0\223\0\u02df\0\u0682\0\u06b3\0\u06e4\0\u0715"+
    "\0\u0746\0\u0777\0\u07a8\0\u07d9\0\u080a\0\u083b\0\u086c\0\u089d"+
    "\0\u08ce\0\u08ff\0\u0930\0\u0961\0\u0341\0\223\0\u0372\0\u0992"+
    "\0\u03a3\0\u09c3\0\u09f4\0\u0a25\0\u0a25\0\u0a56\0\u0a56\0\u0a87"+
    "\0\u0ab8\0\u0ae9\0\u0b1a\0\u0b4b\0\u0b7c\0\u0bad\0\u0bde\0\u0c0f"+
    "\0\u0c40\0\u0c71\0\u0ca2\0\u0cd3\0\u0d04\0\u0d35\0\u0d66\0\u0d97"+
    "\0\u0dc8\0\u0df9\0\u0e2a\0\223\0\u0e5b\0\u0e8c\0\u0ebd\0\u0eee"+
    "\0\u0f1f\0\u0f50\0\u0f81\0\u0fb2\0\u0fe3\0\u1014\0\u1045\0\u1076"+
    "\0\223\0\u10a7\0\u10d8\0\u1109\0\u113a\0\u116b\0\u119c\0\u11cd"+
    "\0\u11fe\0\u122f\0\u1260\0\223\0\u1291\0\223\0\223\0\u12c2"+
    "\0\223\0\u12f3\0\u1324\0\u1355\0\u1386\0\u13b7\0\u13e8\0\u1419"+
    "\0\u144a\0\u147b\0\u14ac\0\u14dd\0\u150e\0\u153f\0\u1570\0\u15a1"+
    "\0\u15d2\0\u1603\0\u1634\0\u1665\0\u1696\0\u16c7\0\u16f8\0\u1729"+
    "\0\u175a\0\u178b\0\u17bc\0\223\0\u17ed\0\u181e\0\u184f\0\u1880"+
    "\0\u18b1\0\u18e2\0\u1913\0\u1944\0\u1975\0\u19a6\0\u19d7\0\u1a08"+
    "\0\u1a39\0\u1a6a\0\u1a9b\0\223\0\u1acc\0\u1afd\0\223\0\223"+
    "\0\u1b2e\0\u1b5f\0\223\0\u1b90\0\u1bc1\0\u1bf2\0\u1c23\0\u1c54"+
    "\0\u1c85\0\u1cb6\0\u1ce7\0\u1d18\0\223\0\u1d49\0\223\0\223"+
    "\0\u1d7a\0\u1dab\0\u1ddc\0\223\0\223\0\u1e0d\0\u1e3e\0\u1e6f"+
    "\0\223\0\223\0\u1ea0\0\u1ed1\0\u1f02\0\u1f33\0\u1f64\0\u1f95"+
    "\0\u1fc6\0\u1ff7\0\u2028\0\u2059\0\u208a\0\u20bb\0\u20ec\0\u211d"+
    "\0\u214e\0\u217f\0\223\0\u21b0\0\223\0\223\0\u21e1\0\u2212"+
    "\0\u2243\0\u2274\0\u22a5\0\223\0\u22d6\0\u2307\0\223\0\223"+
    "\0\u2338\0\u2369\0\u239a\0\u23cb\0\u23fc\0\u242d\0\u245e\0\u248f"+
    "\0\u24c0\0\u24f1\0\u2522\0\u2553\0\u2584\0\u25b5\0\u25e6\0\u2617"+
    "\0\223\0\u2648\0\223\0\u2679\0\u26aa\0\u26db\0\u270c\0\u273d"+
    "\0\223\0\223\0\223\0\u276e\0\u279f\0\u27d0\0\223\0\u2801"+
    "\0\223\0\u2832\0\u2863\0\u2894\0\u28c5\0\223\0\223\0\223"+
    "\0\u28f6\0\u2927\0\u2958\0\u2989\0\u29ba\0\u29eb\0\u2a1c\0\u2a4d"+
    "\0\u2a7e\0\u2aaf\0\u2ae0\0\u2b11\0\u2b42\0\223\0\u2b73\0\u2ba4"+
    "\0\u2bd5\0\u2c06\0\223\0\u2c37\0\223\0\u2c68\0\u2c99\0\u2cca"+
    "\0\u2cfb\0\223\0\223\0\u2d2c\0\u2d5d\0\u2d8e\0\u2dbf\0\u2df0"+
    "\0\223\0\u2e21\0\223\0\u2e52\0\u2e83\0\u2eb4\0\u2ee5\0\u2f16"+
    "\0\223\0\223\0\u2f47\0\223\0\u2f78\0\u2fa9\0\223\0\u2fda"+
    "\0\u300b\0\u303c\0\223\0\u306d\0\u309e\0\u30cf\0\223\0\u3100"+
    "\0\u3131\0\u3162\0\223\0\223\0\223\0\223\0\223\0\223"+
    "\0\u3193\0\u31c4\0\u31f5\0\223\0\u3226\0\223\0\223\0\u3257"+
    "\0\u3288\0\u32b9\0\223";

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

  private static int [] zzUnpackTrans() {
    int [] result = new int[13034];
    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 =
    "\3\0\4\11\13\1\1\11\1\1\1\11\1\1\1\11"+
    "\3\1\3\11\3\0\1\1\11\0\1\1\1\0\1\1"+
    "\6\11\1\1\21\0\1\11\1\0\1\1\1\0\1\1"+
    "\1\0\1\1\1\0\1\1\14\0\1\1\10\0\1\11"+
    "\14\0\1\11\12\0\1\11\1\0\2\11\1\0\1\11"+
    "\11\0\1\1\20\0\1\11\17\0\1\11\2\0\2\11"+
    "\2\0\1\11\2\0\1\1\6\0\1\11\1\0\2\11"+
    "\3\0\2\11\3\0\2\11\20\0\1\11\1\0\2\11"+
    "\5\0\1\11\2\0\2\11\20\0\1\11\1\0\1\11"+
    "\5\0\3\11\3\0\1\11\1\0\1\11\3\0\1\1"+
    "\3\11\15\0\1\11\4\0\1\11\1\0\1\11\4\0"+
    "\2\11\5\0\1\11\1\0\1\11\5\0\2\11\1\0"+
    "\1\11\2\0\1\11\3\0\1\11\3\0\1\11\3\0"+
    "\6\11\3\0\1\11\1\0\2\11\3\0\1\11";

  private static int [] zzUnpackAttribute() {
    int [] result = new int[347];
    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 token;
    private StringBuffer format_string;
    private int format_h_num;
    private int paren_level;

    /** move on to next token.
        @return false if positioned beyond tokens.
        @throws IOException on input error.
      */
    public boolean advance () throws java.io.IOException {
	  token=yylex();
	  return token != YYEOF;
    }

    /** classifies current token.
        Should not be called if advance() returned false.
        @return current %token or single character.
      */
    public int token () {
	  dp("TK: " + value);
	  return token;
    }

    protected void dp(String msg){
	//
    }

    /** associated with current token.
        Should not be called if advance() returned false.
        @return value for token().
      */
    public Object value () {
	  return value;
    }

    Object value;
    int lineNo = 1;


  /**
   * 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 Scanner(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 Scanner(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 int yylex() 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;

      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 16: 
          { String str = yytext();
             str = str.substring(1, str.length() - 1);
             int i;
             while((i = str.indexOf("''")) != -1){
               str = str.substring(0,i) + str.substring(i+1);
             }
             value = new Token(lineNo, str.intern(), Parser.CHAR_CONST);
             return Parser.CHAR_CONST;
          }
        case 85: break;
        case 5: 
          { value = new Token(lineNo, yytext().intern(), Parser.INT_CONST); 
                       return Parser.INT_CONST;
          }
        case 86: break;
        case 61: 
          { value = new Token(lineNo, yytext().intern());
              format_string = new StringBuffer();
              yybegin(FORMAT);
              return Parser.FORMAT;
          }
        case 87: break;
        case 59: 
          { value = new Token(lineNo, yytext().intern()); 
                       return Parser.RETURN;
          }
        case 88: break;
        case 30: 
          { value = new Token(lineNo, yytext().intern(), Parser.OR);  return Parser.OR;
          }
        case 89: break;
        case 28: 
          { value = new Token(lineNo, yytext().intern()); 
                       return Parser.IF;
          }
        case 90: break;
        case 68: 
          { value = new Token(lineNo, yytext().intern(), Parser.COMPLEX); 
                       return Parser.COMPLEX;
          }
        case 91: break;
        case 35: 
          { value = new Token(lineNo, yytext().intern(), Parser.AND); return Parser.AND;
          }
        case 92: break;
        case 67: 
          { value = new Token(lineNo, yytext().intern(), Parser.PROGRAM); 
                       return Parser.PROGRAM;
          }
        case 93: break;
        case 78: 
          { value = new Token(lineNo, yytext().intern()); 
                       return Parser.PARAM;
          }
        case 94: break;
        case 14: 
          { format_string.append(yytext());
    format_h_num--;
    if(format_h_num == 0){
      yybegin(FORMAT);
    }
          }
        case 95: break;
        case 53: 
          { value = new Token(lineNo, yytext().intern());
                       return Parser.CLOSE;
          }
        case 96: break;
        case 8: 
          { value = new Token(lineNo, yytext().intern(), Parser.GREATER_THAN);  return Parser.GREATER_THAN;
          }
        case 97: break;
        case 72: 
          { value = new Token(lineNo, yytext().intern()); 
                       return Parser.IMPLICIT;
          }
        case 98: break;
        case 33: 
          { value = new Token(lineNo, yytext().intern(), Parser.EQV); return Parser.EQV;
          }
        case 99: break;
        case 36: 
          { value = new Token(lineNo, yytext().intern()); 
                       return Parser.DATA;
          }
        case 100: break;
        case 23: 
          { value = new Token(lineNo, yytext().substring(1).intern(), 
              Parser.LABEL_DEF); return Parser.LABEL_DEF;
          }
        case 101: break;
        case 73: 
          { value = new Token(lineNo, yytext().intern()); 
                       return Parser.CONTINUE;
          }
        case 102: break;
        case 10: 
          { value = new Token(lineNo, ";"); return Parser.EOS;
          }
        case 103: break;
        case 22: 
          { value = new Token(lineNo, yytext().intern(), Parser.NOT_EQUAL);     return Parser.NOT_EQUAL;
          }
        case 104: break;
        case 27: 
          { value = new Token(lineNo, yytext().intern()); 
                       return Parser.TO;
          }
        case 105: break;
        case 2: 
          { lineNo++;
          }
        case 106: break;
        case 66: 
          { value = new Token(lineNo, yytext().intern(), Parser.INTEGER); 
                       return Parser.INTEGER;
          }
        case 107: break;
        case 57: 
          { value = new Token(lineNo, yytext().intern()); 
                       return Parser.END_DO;
          }
        case 108: break;
        case 81: 
          { value = new Token(lineNo, yytext().intern(), Parser.SUBROUTINE); 
                       return Parser.SUBROUTINE;
          }
        case 109: break;
        case 46: 
          { value = new Token(lineNo, yytext().intern(),Parser.TRUE_CONST);
                       return Parser.TRUE_CONST;
          }
        case 110: break;
        case 11: 
          { format_string.append(yytext());
          }
        case 111: break;
        case 77: 
          { value = new Token(lineNo, yytext().intern());
              return Parser.BACKSPACE;
          }
        case 112: break;
        case 55: 
          { value = new Token(lineNo, yytext().intern(),Parser.FALSE_CONST);
                       return Parser.FALSE_CONST;
          }
        case 113: break;
        case 20: 
          { value = new Token(lineNo, yytext().intern(), Parser.EQUAL); return Parser.EQUAL;
          }
        case 114: break;
        case 65: 
          { value = new Token(lineNo, yytext().intern());
              return Parser.INQUIRE;
          }
        case 115: break;
        case 76: 
          { value = new Token(lineNo, yytext().intern(), Parser.BLOCKDATA); 
                       return Parser.BLOCKDATA;
          }
        case 116: break;
        case 15: 
          { value = new Token(lineNo, yytext().intern(), Parser.REAL_CONST); 
                       return Parser.REAL_CONST;
          }
        case 117: break;
        case 50: 
          { value = new Token(lineNo, yytext().intern(), Parser.ENTRY); 
                       return Parser.ENTRY;
          }
        case 118: break;
        case 79: 
          { value = new Token(lineNo, yytext().intern()); 
                       return Parser.COMP_GOTO;
          }
        case 119: break;
        case 4: 
          { value = new Token(lineNo, yytext().intern()); return yytext().charAt(0);
          }
        case 120: break;
        case 70: 
          { value = new Token(lineNo, yytext().intern()); 
                       return Parser.ARITH_IF;
          }
        case 121: break;
        case 34: 
          { value = new Token(lineNo, yytext().intern(), Parser.NOT); return Parser.NOT;
          }
        case 122: break;
        case 54: 
          { value = new Token(lineNo, yytext().intern()); 
                       return Parser.WRITE;
          }
        case 123: break;
        case 58: 
          { value = new Token(lineNo, yytext().intern()); 
                       return Parser.ASSIGN;
          }
        case 124: break;
        case 13: 
          { paren_level++;
      format_string.append(yytext());
          }
        case 125: break;
        case 38: 
          { value = new Token(lineNo, yytext().intern());
                       return Parser.OPEN;
          }
        case 126: break;
        case 42: 
          { value = new Token(lineNo, yytext().intern(), Parser.REAL); 
                       return Parser.REAL;
          }
        case 127: break;
        case 64: 
          { value = new Token(lineNo, yytext().intern(), Parser.LOGICAL); 
                       return Parser.LOGICAL;
          }
        case 128: break;
        case 83: 
          { value = new Token(lineNo, yytext().intern()); 
                       return Parser.ASSIGN_GOTO;
          }
        case 129: break;
        case 49: 
          { value = new Token(lineNo, yytext().intern()); 
                       return Parser.END_IF;
          }
        case 130: break;
        case 63: 
          { value = new Token(lineNo, yytext().intern());
              return Parser.END_FILE;
          }
        case 131: break;
        case 75: 
          { value = new Token(lineNo, yytext().intern()); 
                       return Parser.INTRINSIC;
          }
        case 132: break;
        case 52: 
          { value = new Token(lineNo, yytext().intern());
                       return Parser.PRINT;
          }
        case 133: break;
        case 12: 
          { paren_level--;
          format_string.append(yytext());
          if(paren_level == 0){
            yybegin(YYINITIAL);
            value = new Token(lineNo, format_string.toString(), Parser.FORMAT_SPECIFICATION);
            return Parser.FORMAT_SPECIFICATION;
          }
          else if(paren_level < 0){
            // error
          }
          }
        case 134: break;
        case 44: 
          { value = new Token(lineNo, yytext().intern()); 
                       return Parser.SAVE;
          }
        case 135: break;
        case 1: 
          { System.err.println("Illegal char " + yytext().charAt(0) + " ignored");
          }
        case 136: break;
        case 9: 
          { value = new Token(lineNo, "#"); return Parser.NO_LABEL;
          }
        case 137: break;
        case 37: 
          { value = new Token(lineNo, yytext().intern()); 
                       return Parser.ELSE;
          }
        case 138: break;
        case 60: 
          { value = new Token(lineNo, yytext().intern());
              return Parser.REWIND;
          }
        case 139: break;
        case 32: 
          { value = new Token(lineNo, yytext().intern()); 
                       return Parser.LET;
          }
        case 140: break;
        case 82: 
          { value = new Token(lineNo, yytext().intern()); 
                       return Parser.EQUIVALENCE;
          }
        case 141: break;
        case 40: 
          { value = new Token(lineNo, yytext().intern()); 
                       return Parser.GOTO;
          }
        case 142: break;
        case 39: 
          { value = new Token(lineNo, yytext().intern()); 
                       return Parser.THEN;
          }
        case 143: break;
        case 69: 
          { value = new Token(lineNo, yytext().intern()); 
                       return Parser.EXTERNAL;
          }
        case 144: break;
        case 6: 
          { value = new Token(lineNo, yytext().toLowerCase().intern(),
                               Parser.IDENT);
             return Parser.IDENT;
          }
        case 145: break;
        case 21: 
          { value = new Token(lineNo, yytext().intern(), Parser.GREATER_OR_EQUAL); return Parser.GREATER_OR_EQUAL;
          }
        case 146: break;
        case 26: 
          { value = new Token(lineNo, yytext().intern()); 
                       return Parser.DO;
          }
        case 147: break;
        case 41: 
          { value = new Token(lineNo, yytext().intern()); 
                       return Parser.READ;
          }
        case 148: break;
        case 74: 
          { value = new Token(lineNo, yytext().intern(), Parser.DIMENSION); 
                       return Parser.DIMENSION;
          }
        case 149: break;
        case 47: 
          { value = new Token(lineNo, yytext().intern(), Parser.NEQV);return Parser.NEQV;
          }
        case 150: break;
        case 48: 
          { value = new Token(lineNo, yytext().intern());
                       return Parser.END_DO;
          }
        case 151: break;
        case 31: 
          { value = new Token(lineNo, yytext().intern()); 
                       return Parser.END;
          }
        case 152: break;
        case 45: 
          { value = new Token(lineNo, yytext().intern()); 
                       return Parser.CALL;
          }
        case 153: break;
        case 71: 
          { value = new Token(lineNo, yytext().intern(), Parser.FUNCTION); 
                       return Parser.FUNCTION;
          }
        case 154: break;
        case 84: 
          { value = new Token(lineNo, yytext().intern(), Parser.DOUBLE_PREC); 
                       return Parser.DOUBLE_PREC;
          }
        case 155: break;
        case 29: 
          { yypushback(2) ; value = new Token(lineNo, yytext().intern(), Parser.REAL_CONST); 
                       return Parser.REAL_CONST;
          }
        case 156: break;
        case 7: 
          { value = new Token(lineNo, yytext().intern(), Parser.LESS_THAN);     return Parser.LESS_THAN;
          }
        case 157: break;
        case 17: 
          { value = new Token(lineNo, yytext().intern());  return Parser.POWER;
          }
        case 158: break;
        case 62: 
          { value = new Token(lineNo, yytext().intern());
                       return Parser.COMMON;
          }
        case 159: break;
        case 25: 
          { value = new Token(lineNo, yytext().intern(), Parser.DOUBLE_CONST); 
                       return Parser.DOUBLE_CONST;
          }
        case 160: break;
        case 19: 
          { value = new Token(lineNo, yytext().intern(), Parser.LESS_OR_EQUAL); return Parser.LESS_OR_EQUAL;
          }
        case 161: break;
        case 18: 
          { value = new Token(lineNo, yytext().intern());  return Parser.DOUBLE_SLASH;
          }
        case 162: break;
        case 56: 
          { value = new Token(lineNo, yytext().intern()); 
                       return Parser.ELSE_IF;
          }
        case 163: break;
        case 43: 
          { value = new Token(lineNo, yytext().intern());
              return Parser.STOP;
          }
        case 164: break;
        case 51: 
          { value = new Token(lineNo, yytext().intern());
              return Parser.PAUSE;
          }
        case 165: break;
        case 80: 
          { value = new Token(lineNo, yytext().intern(), Parser.CHARACTER); 
                       return Parser.CHARACTER;
          }
        case 166: break;
        case 3: 
          { 
          }
        case 167: break;
        case 24: 
          { // numHstr
	  String text = yytext();
	  format_h_num = Integer.parseInt(text.substring(0, text.indexOf('H')));
	  format_string.append(text);
	  yybegin(FORMAT_H);
          }
        case 168: break;
        default: 
          if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
            zzAtEOF = true;
              { 	return YYEOF;
 }
          } 
          else {
            zzScanError(ZZ_NO_MATCH);
          }
      }
    }
  }


}
