⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scanner.java

📁 非常好的编译源代码 将一个l语言转换为中间代码 java版本
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
    "\1\0\1\11\4\0\1\11\1\345\23\11\1\0\1\11"+
    "\23\0\1\11\6\0\13\11\1\0\1\11\4\0\17\11"+
    "\1\346\5\11\1\0\1\11\23\0\1\11\6\0\13\11"+
    "\1\0\1\11\4\0\4\11\1\347\20\11\1\0\1\11"+
    "\23\0\1\11\6\0\13\11\1\0\1\11\4\0\10\11"+
    "\1\350\14\11\1\0\1\11\23\0\1\11\6\0\13\11"+
    "\1\0\1\11\4\0\16\11\1\351\6\11\1\0\1\11"+
    "\23\0\1\11\6\0\13\11\1\0\1\11\4\0\3\11"+
    "\1\352\21\11\1\0\1\11\23\0\1\11\6\0\13\11"+
    "\1\0\1\11\4\0\7\11\1\353\15\11\1\0\1\11"+
    "\23\0\1\11\6\0\13\11\1\0\1\11\4\0\13\11"+
    "\1\354\11\11\1\0\1\11\23\0\1\11\25\0\1\277"+
    "\64\0\2\355\1\311\1\0\5\355\1\0\1\355\5\0"+
    "\1\355\1\0\1\355\2\0\1\355\1\0\1\311\2\0"+
    "\2\355\5\0\1\355\27\0\1\355\10\0\1\356\1\103"+
    "\1\224\2\0\3\356\1\111\1\112\1\113\5\0\1\113"+
    "\6\0\1\224\2\0\1\114\6\0\1\111\27\0\1\114"+
    "\10\0\1\357\1\103\1\224\2\0\3\357\1\111\1\112"+
    "\1\113\5\0\1\113\6\0\1\224\2\0\1\114\6\0"+
    "\1\111\27\0\1\114\6\0\13\11\1\0\1\11\4\0"+
    "\3\11\1\360\21\11\1\0\1\11\23\0\1\11\6\0"+
    "\13\11\1\0\1\11\4\0\1\361\24\11\1\0\1\11"+
    "\23\0\1\11\6\0\13\11\1\0\1\11\4\0\1\11"+
    "\1\362\23\11\1\0\1\11\23\0\1\11\6\0\13\11"+
    "\1\0\1\11\4\0\1\363\24\11\1\0\1\11\23\0"+
    "\1\11\6\0\13\11\1\0\1\11\4\0\5\11\1\364"+
    "\17\11\1\0\1\11\23\0\1\11\6\0\13\11\1\0"+
    "\1\11\4\0\12\11\1\365\12\11\1\0\1\11\23\0"+
    "\1\11\6\0\13\11\1\0\1\11\4\0\11\11\1\366"+
    "\13\11\1\0\1\11\23\0\1\11\6\0\13\11\1\0"+
    "\1\11\4\0\1\11\1\367\23\11\1\0\1\11\23\0"+
    "\1\11\6\0\13\11\1\0\1\11\4\0\20\11\1\370"+
    "\4\11\1\0\1\11\23\0\1\11\6\0\13\11\1\0"+
    "\1\11\4\0\17\11\1\371\5\11\1\0\1\11\23\0"+
    "\1\11\6\0\13\11\1\0\1\11\4\0\4\11\1\372"+
    "\20\11\1\0\1\11\23\0\1\11\6\0\13\11\1\0"+
    "\1\11\4\0\4\11\1\373\20\11\1\0\1\11\23\0"+
    "\1\11\6\0\13\11\1\0\1\11\4\0\14\11\1\374"+
    "\10\11\1\0\1\11\23\0\1\11\6\0\13\11\1\0"+
    "\1\11\4\0\23\11\1\375\1\11\1\0\1\11\23\0"+
    "\1\11\6\0\13\11\1\0\1\11\4\0\10\11\1\376"+
    "\14\11\1\0\1\11\23\0\1\11\6\0\13\11\1\0"+
    "\1\11\4\0\1\11\1\377\23\11\1\0\1\11\23\0"+
    "\1\11\6\0\13\11\1\0\1\11\4\0\1\11\1\u0100"+
    "\23\11\1\0\1\11\23\0\1\11\6\0\13\11\1\0"+
    "\1\11\4\0\1\11\1\u0101\23\11\1\0\1\11\23\0"+
    "\1\11\6\0\13\11\1\0\1\11\4\0\4\11\1\u0102"+
    "\20\11\1\0\1\11\23\0\1\11\10\0\2\u0103\1\311"+
    "\1\0\5\u0103\1\0\1\u0103\5\0\1\u0103\1\0\1\u0103"+
    "\2\0\1\u0103\1\0\1\311\2\0\2\u0103\5\0\1\u0103"+
    "\27\0\1\u0103\10\0\1\u0104\1\103\1\224\2\0\3\u0104"+
    "\1\111\1\112\1\113\5\0\1\113\6\0\1\224\2\0"+
    "\1\114\6\0\1\111\27\0\1\114\10\0\1\u0105\1\103"+
    "\1\224\2\0\3\u0105\1\111\1\112\1\113\5\0\1\113"+
    "\6\0\1\224\2\0\1\114\6\0\1\111\27\0\1\114"+
    "\6\0\13\11\1\0\1\11\4\0\4\11\1\u0106\20\11"+
    "\1\0\1\11\23\0\1\11\6\0\13\11\1\0\1\11"+
    "\4\0\11\11\1\u0107\13\11\1\0\1\11\23\0\1\11"+
    "\6\0\13\11\1\0\1\11\4\0\13\11\1\u0108\11\11"+
    "\1\0\1\11\23\0\1\11\6\0\13\11\1\0\1\11"+
    "\4\0\3\11\1\u0109\21\11\1\0\1\11\23\0\1\11"+
    "\6\0\13\11\1\0\1\11\4\0\3\11\1\u010a\21\11"+
    "\1\0\1\11\23\0\1\11\6\0\13\11\1\0\1\11"+
    "\4\0\10\11\1\u010b\14\11\1\0\1\11\23\0\1\11"+
    "\6\0\13\11\1\0\1\11\4\0\11\11\1\u010c\13\11"+
    "\1\0\1\11\23\0\1\11\6\0\13\11\1\0\1\11"+
    "\4\0\15\11\1\u010d\7\11\1\0\1\11\23\0\1\11"+
    "\6\0\13\11\1\0\1\11\4\0\1\11\1\u010e\23\11"+
    "\1\0\1\11\23\0\1\11\10\0\2\u010f\1\311\1\0"+
    "\5\u010f\1\0\1\u010f\5\0\1\u010f\1\0\1\u010f\2\0"+
    "\1\u010f\1\0\1\311\2\0\2\u010f\5\0\1\u010f\27\0"+
    "\1\u010f\10\0\1\u0110\1\103\1\224\2\0\3\u0110\1\111"+
    "\1\112\1\113\5\0\1\113\6\0\1\224\2\0\1\114"+
    "\6\0\1\111\27\0\1\114\10\0\1\u0111\1\103\1\224"+
    "\2\0\3\u0111\1\111\1\112\1\113\5\0\1\113\6\0"+
    "\1\224\2\0\1\114\6\0\1\111\27\0\1\114\6\0"+
    "\13\11\1\0\1\11\4\0\20\11\1\u0112\4\11\1\0"+
    "\1\11\23\0\1\11\6\0\13\11\1\0\1\11\4\0"+
    "\24\11\1\u0113\1\0\1\11\23\0\1\11\6\0\13\11"+
    "\1\0\1\11\4\0\11\11\1\u0114\13\11\1\0\1\11"+
    "\23\0\1\11\6\0\13\11\1\0\1\11\4\0\4\11"+
    "\1\u0115\20\11\1\0\1\11\23\0\1\11\6\0\13\11"+
    "\1\0\1\11\4\0\20\11\1\u0116\4\11\1\0\1\11"+
    "\23\0\1\11\6\0\13\11\1\0\1\11\4\0\1\u0117"+
    "\24\11\1\0\1\11\23\0\1\11\10\0\2\u0118\1\311"+
    "\1\0\5\u0118\1\0\1\u0118\5\0\1\u0118\1\0\1\u0118"+
    "\2\0\1\u0118\1\0\1\311\2\0\2\u0118\5\0\1\u0118"+
    "\27\0\1\u0118\10\0\1\u0119\1\103\1\224\2\0\3\u0119"+
    "\1\111\1\112\1\113\5\0\1\113\6\0\1\224\2\0"+
    "\1\114\6\0\1\111\27\0\1\114\10\0\1\u011a\1\103"+
    "\1\224\2\0\3\u011a\1\111\1\112\1\113\5\0\1\113"+
    "\6\0\1\224\2\0\1\114\6\0\1\111\27\0\1\114"+
    "\6\0\13\11\1\0\1\11\4\0\1\u011b\24\11\1\0"+
    "\1\11\23\0\1\11\6\0\13\11\1\0\1\11\4\0"+
    "\1\11\1\u011c\23\11\1\0\1\11\23\0\1\11\10\0"+
    "\2\u011d\1\311\1\0\5\u011d\1\0\1\u011d\5\0\1\u011d"+
    "\1\0\1\u011d\2\0\1\u011d\1\0\1\311\2\0\2\u011d"+
    "\5\0\1\u011d\27\0\1\u011d\10\0\1\u011e\1\103\1\224"+
    "\2\0\3\u011e\1\111\1\112\1\113\5\0\1\113\6\0"+
    "\1\224\2\0\1\114\6\0\1\111\27\0\1\114\10\0"+
    "\1\u011f\1\103\1\224\2\0\3\u011f\1\111\1\112\1\113"+
    "\5\0\1\113\6\0\1\224\2\0\1\114\6\0\1\111"+
    "\27\0\1\114\6\0\13\11\1\0\1\11\4\0\1\11"+
    "\1\u0120\23\11\1\0\1\11\23\0\1\11\10\0\2\u0121"+
    "\1\311\1\0\5\u0121\1\0\1\u0121\5\0\1\u0121\1\0"+
    "\1\u0121\2\0\1\u0121\1\0\1\311\2\0\2\u0121\5\0"+
    "\1\u0121\27\0\1\u0121\10\0\1\u0122\1\103\1\224\2\0"+
    "\3\u0122\1\111\1\112\1\113\5\0\1\113\6\0\1\224"+
    "\2\0\1\114\6\0\1\111\27\0\1\114\10\0\1\u0123"+
    "\1\103\1\224\2\0\3\u0123\1\111\1\112\1\113\5\0"+
    "\1\113\6\0\1\224\2\0\1\114\6\0\1\111\27\0"+
    "\1\114\10\0\2\u0124\1\311\1\0\5\u0124\1\0\1\u0124"+
    "\5\0\1\u0124\1\0\1\u0124\2\0\1\u0124\1\0\1\311"+
    "\2\0\2\u0124\5\0\1\u0124\27\0\1\u0124\10\0\1\u0125"+
    "\1\103\1\224\2\0\3\u0125\1\111\1\112\1\113\5\0"+
    "\1\113\6\0\1\224\2\0\1\114\6\0\1\111\27\0"+
    "\1\114\10\0\1\u0126\1\103\1\224\2\0\3\u0126\1\111"+
    "\1\112\1\113\5\0\1\113\6\0\1\224\2\0\1\114"+
    "\6\0\1\111\27\0\1\114\10\0\2\u0127\1\311\1\0"+
    "\5\u0127\1\0\1\u0127\5\0\1\u0127\1\0\1\u0127\2\0"+
    "\1\u0127\1\0\1\311\2\0\2\u0127\5\0\1\u0127\27\0"+
    "\1\u0127\10\0\1\u0128\1\103\1\224\2\0\3\u0128\1\111"+
    "\1\112\1\113\5\0\1\113\6\0\1\224\2\0\1\114"+
    "\6\0\1\111\27\0\1\114\10\0\1\u0129\1\103\1\224"+
    "\2\0\3\u0129\1\111\1\112\1\113\5\0\1\113\6\0"+
    "\1\224\2\0\1\114\6\0\1\111\27\0\1\114\10\0"+
    "\2\u012a\1\311\1\0\5\u012a\1\0\1\u012a\5\0\1\u012a"+
    "\1\0\1\u012a\2\0\1\u012a\1\0\1\311\2\0\2\u012a"+
    "\5\0\1\u012a\27\0\1\u012a\10\0\1\u012b\1\103\1\224"+
    "\2\0\3\u012b\1\111\1\112\1\113\5\0\1\113\6\0"+
    "\1\224\2\0\1\114\6\0\1\111\27\0\1\114\10\0"+
    "\1\u012c\1\103\1\224\2\0\3\u012c\1\111\1\112\1\113"+
    "\5\0\1\113\6\0\1\224\2\0\1\114\6\0\1\111"+
    "\27\0\1\114\10\0\2\u012d\1\311\1\0\5\u012d\1\0"+
    "\1\u012d\5\0\1\u012d\1\0\1\u012d\2\0\1\u012d\1\0"+
    "\1\311\2\0\2\u012d\5\0\1\u012d\27\0\1\u012d\10\0"+
    "\1\u012e\1\103\1\224\2\0\3\u012e\1\111\1\112\1\113"+
    "\5\0\1\113\6\0\1\224\2\0\1\114\6\0\1\111"+
    "\27\0\1\114\10\0\1\u012f\1\103\1\224\2\0\3\u012f"+
    "\1\111\1\112\1\113\5\0\1\113\6\0\1\224\2\0"+
    "\1\114\6\0\1\111\27\0\1\114\10\0\2\u0130\1\311"+
    "\1\0\5\u0130\1\0\1\u0130\5\0\1\u0130\1\0\1\u0130"+
    "\2\0\1\u0130\1\0\1\311\2\0\2\u0130\5\0\1\u0130"+
    "\27\0\1\u0130\10\0\1\u0131\1\103\1\224\2\0\3\u0131"+
    "\1\111\1\112\1\113\5\0\1\113\6\0\1\224\2\0"+
    "\1\114\6\0\1\111\27\0\1\114\10\0\1\u0132\1\103"+
    "\1\224\2\0\3\u0132\1\111\1\112\1\113\5\0\1\113"+
    "\6\0\1\224\2\0\1\114\6\0\1\111\27\0\1\114"+
    "\10\0\2\u0133\1\311\1\0\5\u0133\1\0\1\u0133\5\0"+
    "\1\u0133\1\0\1\u0133\2\0\1\u0133\1\0\1\311\2\0"+
    "\2\u0133\5\0\1\u0133\27\0\1\u0133\10\0\1\u0134\1\103"+
    "\1\224\2\0\3\u0134\1\111\1\112\1\113\5\0\1\113"+
    "\6\0\1\224\2\0\1\114\6\0\1\111\27\0\1\114"+
    "\10\0\1\u0135\1\103\1\224\2\0\3\u0135\1\111\1\112"+
    "\1\113\5\0\1\113\6\0\1\224\2\0\1\114\6\0"+
    "\1\111\27\0\1\114\10\0\2\u0136\1\311\1\0\5\u0136"+
    "\1\0\1\u0136\5\0\1\u0136\1\0\1\u0136\2\0\1\u0136"+
    "\1\0\1\311\2\0\2\u0136\5\0\1\u0136\27\0\1\u0136"+
    "\10\0\1\u0137\1\103\1\224\2\0\3\u0137\1\111\1\112"+
    "\1\113\5\0\1\113\6\0\1\224\2\0\1\114\6\0"+
    "\1\111\27\0\1\114\10\0\1\u0138\1\103\1\224\2\0"+
    "\3\u0138\1\111\1\112\1\113\5\0\1\113\6\0\1\224"+
    "\2\0\1\114\6\0\1\111\27\0\1\114\10\0\2\u0139"+
    "\1\311\1\0\5\u0139\1\0\1\u0139\5\0\1\u0139\1\0"+
    "\1\u0139\2\0\1\u0139\1\0\1\311\2\0\2\u0139\5\0"+
    "\1\u0139\27\0\1\u0139\10\0\1\u013a\1\103\1\224\2\0"+
    "\3\u013a\1\111\1\112\1\113\5\0\1\113\6\0\1\224"+
    "\2\0\1\114\6\0\1\111\27\0\1\114\12\0\1\311"+
    "\24\0\1\311\52\0\1\u013b\1\103\1\224\2\0\3\u013b"+
    "\1\111\1\112\1\113\5\0\1\113\6\0\1\224\2\0"+
    "\1\114\6\0\1\111\27\0\1\114\10\0\1\u013c\1\103"+
    "\1\224\2\0\3\u013c\1\111\1\112\1\113\5\0\1\113"+
    "\6\0\1\224\2\0\1\114\6\0\1\111\27\0\1\114"+
    "\10\0\1\u013d\1\103\1\224\2\0\3\u013d\1\111\1\112"+
    "\1\113\5\0\1\113\6\0\1\224\2\0\1\114\6\0"+
    "\1\111\27\0\1\114\10\0\1\u013e\1\103\1\224\2\0"+
    "\3\u013e\1\111\1\112\1\113\5\0\1\113\6\0\1\224"+
    "\2\0\1\114\6\0\1\111\27\0\1\114\10\0\2\103"+
    "\1\224\2\0\3\103\1\111\1\112\1\113\5\0\1\113"+
    "\6\0\1\224\2\0\1\114\6\0\1\111\27\0\1\114";

  private static int [] zzUnpackTrans() {
    int [] result = new int[14454];
    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\1\11\1\1\1\11\7\1\2\11\22\1\10\11"+
    "\4\1\2\11\7\1\2\11\3\1\1\11\2\1\1\0"+
    "\2\11\2\1\1\11\1\0\3\1\1\11\1\1\1\0"+
    "\3\11\41\1\3\11\1\1\2\11\1\1\7\11\2\1"+
    "\11\11\12\1\1\0\1\11\5\1\1\0\40\1\3\11"+
    "\1\0\1\11\1\0\11\11\13\1\1\11\116\1\1\0"+
    "\2\1\1\0\2\1\1\0\2\1\1\0\2\1\1\0"+
    "\2\1\1\0\2\1\1\0\2\1\1\0\5\1";

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

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

  /* user code: */
  StringBuffer string = new StringBuffer();    private Symbol symbol(int type) {    return new MySymbol(type, yyline+1, yycolumn+1);  }  private Symbol symbol(int type, Object value) {    return new MySymbol(type, yyline+1, yycolumn+1, value);  }  /**    * assumes correct representation of a long value for    * specified radix in scanner buffer from <code>start</code>    * to <code>end</code>    */  private long parseLong(int start, int end, int radix) {    long result = 0;    long digit;    for (int i = start; i < end; i++) {      digit  = Character.digit(yycharat(i),radix);      result*= radix;      result+= digit;    }    return result;  }

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

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


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

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -