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

📄 mjscanner.java

📁 SkipOOMiniJOOL教学语言的编译器前端
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
/* The following code was generated by JFlex 1.4.1 on 07-6-6 上午12:45 */package edu.ustc.cs.minijool.parser;

import java_cup.runtime.*;

/** * This class is a scanner generated by  * <a href="http://www.jflex.de/">JFlex</a> 1.4.1 * on 07-6-6 上午12:45 from the specification file * <tt>/home/taotao/workspace/Lab3/JFlex/MiniJOOL.flex</tt> */public class MJScanner implements java_cup.runtime.Scanner {  /** 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;  /**    * Translates characters to character classes   */  private static final String ZZ_CMAP_PACKED =     "\11\0\1\5\1\2\1\0\2\2\22\0\1\3\1\57\1\1\2\12"+    "\1\55\1\60\1\15\1\43\1\44\1\54\1\52\1\50\1\53\1\51"+    "\1\4\12\11\1\12\1\47\1\63\1\56\1\62\2\12\22\7\1\37"+    "\7\7\1\41\1\13\1\42\3\12\1\20\1\24\1\22\1\31\1\27"+    "\1\35\1\40\1\34\1\21\2\7\1\26\1\7\1\23\1\25\2\7"+    "\1\14\1\16\1\17\1\36\1\30\1\33\1\32\2\7\1\45\1\61"+    "\1\46\1\12\53\0\1\6\12\0\1\6\4\0\1\6\5\0\27\6"+    "\1\0\37\6\1\0\u013f\6\31\0\162\6\4\0\14\6\16\0\5\6"+    "\11\0\1\6\213\0\1\6\13\0\1\6\1\0\3\6\1\0\1\6"+    "\1\0\24\6\1\0\54\6\1\0\46\6\1\0\5\6\4\0\202\6"+    "\10\0\105\6\1\0\46\6\2\0\2\6\6\0\20\6\41\0\46\6"+    "\2\0\1\6\7\0\47\6\110\0\33\6\5\0\3\6\56\0\32\6"+    "\5\0\13\6\25\0\12\10\4\0\2\6\1\0\143\6\1\0\1\6"+    "\17\0\2\6\7\0\2\6\12\10\3\6\2\0\1\6\20\0\1\6"+    "\1\0\36\6\35\0\3\6\60\0\46\6\13\0\1\6\u0152\0\66\6"+    "\3\0\1\6\22\0\1\6\7\0\12\6\4\0\12\10\25\0\10\6"+    "\2\0\2\6\2\0\26\6\1\0\7\6\1\0\1\6\3\0\4\6"+    "\3\0\1\6\36\0\2\6\1\0\3\6\4\0\12\10\2\6\23\0"+    "\6\6\4\0\2\6\2\0\26\6\1\0\7\6\1\0\2\6\1\0"+    "\2\6\1\0\2\6\37\0\4\6\1\0\1\6\7\0\12\10\2\0"+    "\3\6\20\0\11\6\1\0\3\6\1\0\26\6\1\0\7\6\1\0"+    "\2\6\1\0\5\6\3\0\1\6\22\0\1\6\17\0\2\6\4\0"+    "\12\10\25\0\10\6\2\0\2\6\2\0\26\6\1\0\7\6\1\0"+    "\2\6\1\0\5\6\3\0\1\6\36\0\2\6\1\0\3\6\4\0"+    "\12\10\1\0\1\6\21\0\1\6\1\0\6\6\3\0\3\6\1\0"+    "\4\6\3\0\2\6\1\0\1\6\1\0\2\6\3\0\2\6\3\0"+    "\3\6\3\0\10\6\1\0\3\6\55\0\11\10\25\0\10\6\1\0"+    "\3\6\1\0\27\6\1\0\12\6\1\0\5\6\46\0\2\6\4\0"+    "\12\10\25\0\10\6\1\0\3\6\1\0\27\6\1\0\12\6\1\0"+    "\5\6\3\0\1\6\40\0\1\6\1\0\2\6\4\0\12\10\25\0"+    "\10\6\1\0\3\6\1\0\27\6\1\0\20\6\46\0\2\6\4\0"+    "\12\10\25\0\22\6\3\0\30\6\1\0\11\6\1\0\1\6\2\0"+    "\7\6\72\0\60\6\1\0\2\6\14\0\7\6\11\0\12\10\47\0"+    "\2\6\1\0\1\6\2\0\2\6\1\0\1\6\2\0\1\6\6\0"+    "\4\6\1\0\7\6\1\0\3\6\1\0\1\6\1\0\1\6\2\0"+    "\2\6\1\0\4\6\1\0\2\6\11\0\1\6\2\0\5\6\1\0"+    "\1\6\11\0\12\10\2\0\2\6\42\0\1\6\37\0\12\10\26\0"+    "\10\6\1\0\42\6\35\0\4\6\164\0\42\6\1\0\5\6\1\0"+    "\2\6\25\0\12\10\6\0\6\6\112\0\46\6\12\0\51\6\7\0"+    "\132\6\5\0\104\6\5\0\122\6\6\0\7\6\1\0\77\6\1\0"+    "\1\6\1\0\4\6\2\0\7\6\1\0\1\6\1\0\4\6\2\0"+    "\47\6\1\0\1\6\1\0\4\6\2\0\37\6\1\0\1\6\1\0"+    "\4\6\2\0\7\6\1\0\1\6\1\0\4\6\2\0\7\6\1\0"+    "\7\6\1\0\27\6\1\0\37\6\1\0\1\6\1\0\4\6\2\0"+    "\7\6\1\0\47\6\1\0\23\6\16\0\11\10\56\0\125\6\14\0"+    "\u026c\6\2\0\10\6\12\0\32\6\5\0\113\6\25\0\15\6\1\0"+    "\4\6\16\0\22\6\16\0\22\6\16\0\15\6\1\0\3\6\17\0"+    "\64\6\43\0\1\6\4\0\1\6\3\0\12\10\46\0\12\10\6\0"+    "\130\6\10\0\51\6\127\0\35\6\51\0\12\10\36\6\2\0\5\6"+    "\u038b\0\154\6\224\0\234\6\4\0\132\6\6\0\26\6\2\0\6\6"+    "\2\0\46\6\2\0\6\6\2\0\10\6\1\0\1\6\1\0\1\6"+    "\1\0\1\6\1\0\37\6\2\0\65\6\1\0\7\6\1\0\1\6"+    "\3\0\3\6\1\0\7\6\3\0\4\6\2\0\6\6\4\0\15\6"+    "\5\0\3\6\1\0\7\6\164\0\1\6\15\0\1\6\202\0\1\6"+    "\4\0\1\6\2\0\12\6\1\0\1\6\3\0\5\6\6\0\1\6"+    "\1\0\1\6\1\0\1\6\1\0\4\6\1\0\3\6\1\0\7\6"+    "\3\0\3\6\5\0\5\6\u0ebb\0\2\6\52\0\5\6\5\0\2\6"+    "\4\0\126\6\6\0\3\6\1\0\132\6\1\0\4\6\5\0\50\6"+    "\4\0\136\6\21\0\30\6\70\0\20\6\u0200\0\u19b6\6\112\0\u51a6\6"+    "\132\0\u048d\6\u0773\0\u2ba4\6\u215c\0\u012e\6\2\0\73\6\225\0\7\6"+    "\14\0\5\6\5\0\1\6\1\0\12\6\1\0\15\6\1\0\5\6"+    "\1\0\1\6\1\0\2\6\1\0\2\6\1\0\154\6\41\0\u016b\6"+    "\22\0\100\6\2\0\66\6\50\0\14\6\164\0\5\6\1\0\207\6"+    "\23\0\12\10\7\0\32\6\6\0\32\6\13\0\131\6\3\0\6\6"+    "\2\0\6\6\2\0\6\6\2\0\3\6\43\0";  /**    * Translates characters to character classes   */  private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED);  /**    * Translates DFA states to action switch labels.   */  private static final int [] ZZ_ACTION = zzUnpackAction();  private static final String ZZ_ACTION_PACKED_0 =    "\1\0\2\1\1\2\1\3\1\4\1\5\14\4\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\1\23\1\24\2\1\1\25"+    "\1\26\1\27\2\0\1\2\1\30\5\4\1\31\12\4"+    "\1\32\1\33\1\34\1\35\1\36\1\37\1\40\1\41"+    "\1\42\1\43\1\44\1\45\4\4\1\46\1\4\1\47"+    "\10\4\1\50\1\51\2\4\1\52\1\53\1\4\1\54"+    "\1\4\1\55\1\4\1\56\4\4\1\57\2\4\1\60"+    "\1\4\1\61\1\62\2\4\1\63\1\64\1\65";  private static int [] zzUnpackAction() {    int [] result = new int[114];    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\64\0\150\0\64\0\234\0\320\0\u0104\0\u0138"+    "\0\u016c\0\u01a0\0\u01d4\0\u0208\0\u023c\0\u0270\0\u02a4\0\u02d8"+    "\0\u030c\0\u0340\0\u0374\0\64\0\64\0\64\0\64\0\64"+    "\0\64\0\64\0\64\0\64\0\u03a8\0\u03dc\0\u0410\0\u0444"+    "\0\u0478\0\u04ac\0\u04e0\0\u0514\0\u0548\0\u057c\0\64\0\150"+    "\0\u05b0\0\u05e4\0\64\0\u0618\0\u064c\0\u0680\0\u06b4\0\u06e8"+    "\0\320\0\u071c\0\u0750\0\u0784\0\u07b8\0\u07ec\0\u0820\0\u0854"+    "\0\u0888\0\u08bc\0\u08f0\0\64\0\64\0\64\0\64\0\64"+    "\0\64\0\64\0\64\0\64\0\u0924\0\64\0\u0958\0\u098c"+    "\0\u09c0\0\u09f4\0\u0a28\0\320\0\u0a5c\0\320\0\u0a90\0\u0ac4"+    "\0\u0af8\0\u0b2c\0\u0b60\0\u0b94\0\u0bc8\0\u0bfc\0\64\0\64"+    "\0\u0c30\0\u0c64\0\320\0\320\0\u0c98\0\320\0\u0ccc\0\320"+    "\0\u0d00\0\320\0\u0d34\0\u0d68\0\u0d9c\0\u0dd0\0\320\0\u0e04"+    "\0\u0e38\0\320\0\u0e6c\0\320\0\320\0\u0ea0\0\u0ed4\0\320"+    "\0\320\0\320";  private static int [] zzUnpackRowMap() {    int [] result = new int[114];    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\2\1\3\2\4\1\5\1\4\2\6\2\7\2\2"+    "\1\10\1\2\1\11\1\12\1\6\1\13\1\14\1\15"+    "\1\16\2\6\1\17\1\20\2\6\1\21\1\6\1\22"+    "\1\6\1\23\1\6\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\45\1\46\65\0\1\47"+    "\1\0\2\50\2\0\1\50\1\0\2\50\1\51\50\50"+    "\4\0\1\52\51\0\1\53\13\0\4\6\2\0\1\6"+    "\1\0\23\6\33\0\2\7\60\0\4\6\2\0\1\6"+    "\1\0\11\6\1\54\11\6\31\0\4\6\2\0\1\6"+    "\1\0\1\6\1\55\21\6\31\0\4\6\2\0\1\56"+    "\1\0\16\6\1\57\4\6\31\0\4\6\2\0\1\6"+    "\1\0\5\6\1\60\11\6\1\61\3\6\31\0\4\6"+    "\2\0\1\6\1\0\10\6\1\62\12\6\31\0\4\6"+    "\2\0\1\6\1\0\11\6\1\63\6\6\1\64\2\6"+    "\31\0\4\6\2\0\1\6\1\0\7\6\1\65\13\6"+    "\31\0\4\6\2\0\1\6\1\0\10\6\1\66\3\6"+    "\1\67\6\6\31\0\4\6\2\0\1\6\1\0\7\6"+    "\1\70\13\6\31\0\4\6\2\0\1\6\1\0\16\6"+    "\1\71\4\6\31\0\4\6\2\0\1\6\1\0\2\6"+    "\1\72\20\6\31\0\4\6\2\0\1\6\1\0\1\6"+    "\1\73\21\6\101\0\1\74\63\0\1\75\63\0\1\76"+    "\63\0\1\77\63\0\1\100\63\0\1\101\65\0\1\102"+    "\64\0\1\103\60\0\1\104\3\0\1\105\57\0\1\106"+    "\4\0\1\107\1\0\1\50\11\0\3\50\1\0\1\50"+    "\3\0\1\50\11\0\1\50\27\0\1\52\1\0\3\52"+    "\1\0\1\52\1\0\53\52\6\0\4\6\2\0\1\6"+    "\1\0\1\6\1\110\21\6\31\0\4\6\2\0\1\6"+    "\1\0\2\6\1\111\20\6\31\0\4\6\2\0\1\6"+    "\1\0\20\6\1\112\2\6\31\0\4\6\2\0\1\6"+    "\1\0\3\6\1\113\17\6\31\0\4\6\2\0\1\6"+    "\1\0\1\6\1\114\21\6\31\0\4\6\2\0\1\6"+    "\1\0\2\6\1\115\20\6\31\0\4\6\2\0\1\6"+    "\1\0\15\6\1\116\5\6\31\0\4\6\2\0\1\6"+    "\1\0\10\6\1\117\12\6\31\0\4\6\2\0\1\6"+    "\1\0\7\6\1\120\13\6\31\0\4\6\2\0\1\6"+    "\1\0\1\121\22\6\31\0\4\6\2\0\1\6\1\0"+    "\1\6\1\122\21\6\31\0\4\6\2\0\1\6\1\0"+    "\3\6\1\123\17\6\31\0\4\6\2\0\1\6\1\0"+    "\3\6\1\124\17\6\31\0\4\6\2\0\1\6\1\0"+    "\10\6\1\125\12\6\31\0\4\6\2\0\1\126\1\0"+    "\23\6\101\0\1\127\63\0\1\130\13\0\4\6\2\0"+    "\1\6\1\0\20\6\1\131\2\6\31\0\4\6\2\0"+    "\1\6\1\0\1\6\1\132\21\6\31\0\4\6\2\0"+    "\1\6\1\0\11\6\1\133\11\6\31\0\4\6\2\0"+    "\1\6\1\0\1\134\22\6\31\0\4\6\2\0\1\6"+    "\1\0\1\135\22\6\31\0\4\6\2\0\1\6\1\0"+    "\10\6\1\136\12\6\31\0\4\6\2\0\1\6\1\0"+    "\10\6\1\137\12\6\31\0\4\6\2\0\1\6\1\0"+    "\11\6\1\140\11\6\31\0\4\6\2\0\1\6\1\0"+    "\11\6\1\141\11\6\31\0\4\6\2\0\1\6\1\0"+    "\13\6\1\142\7\6\31\0\4\6\2\0\1\6\1\0"+    "\10\6\1\143\12\6\31\0\4\6\2\0\1\6\1\0"+    "\1\112\22\6\31\0\4\6\2\0\1\6\1\0\3\6"+    "\1\144\17\6\31\0\4\6\2\0\1\145\1\0\23\6"+    "\31\0\4\6\2\0\1\6\1\0\3\6\1\146\17\6"+    "\31\0\4\6\2\0\1\6\1\0\1\147\22\6\31\0"+    "\4\6\2\0\1\6\1\0\11\6\1\150\11\6\31\0"+    "\4\6\2\0\1\6\1\0\5\6\1\151\15\6\31\0"+    "\4\6\2\0\1\6\1\0\11\6\1\152\11\6\31\0"+    "\4\6\2\0\1\6\1\0\5\6\1\153\15\6\31\0"+    "\4\6\2\0\1\6\1\0\5\6\1\154\15\6\31\0"+    "\4\6\2\0\1\6\1\0\4\6\1\155\16\6\31\0"+    "\4\6\2\0\1\6\1\0\2\6\1\156\20\6\31\0"+    "\4\6\2\0\1\6\1\0\13\6\1\157\7\6\31\0"+    "\4\6\2\0\1\6\1\0\22\6\1\160\31\0\4\6"+    "\2\0\1\6\1\0\5\6\1\161\15\6\31\0\4\6"+    "\2\0\1\6\1\0\1\162\22\6\23\0";  private static int [] zzUnpackTrans() {    int [] result = new int[3848];    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 =    "\1\0\1\11\1\1\1\11\17\1\11\11\12\1\1\11"+    "\2\0\1\1\1\11\20\1\11\11\1\1\1\11\20\1"+    "\2\11\32\1";  private static int [] zzUnpackAttribute() {    int [] result = new int[114];    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

⌨️ 快捷键说明

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