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

📄 exprscanner.java

📁 SkipOOMiniJOOL教学语言的编译器前端
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
/* The following code was generated by JFlex 1.4.1 on 07-6-20 上午3:59 */

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-20 上午3:59 from the specification file
 * <tt>D:/workspace/Lab3/JFlex/MiniJOOL.flex</tt>
 */
public class ExprScanner 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 StringHandle = 1;
  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\13"+
    "\1\55\1\60\1\16\1\44\1\45\1\6\1\53\1\51\1\54\1\52"+
    "\1\4\12\12\1\13\1\50\1\63\1\56\1\62\2\13\22\10\1\40"+
    "\7\10\1\42\1\14\1\43\3\13\1\21\1\25\1\23\1\32\1\30"+
    "\1\36\1\41\1\35\1\22\2\10\1\27\1\10\1\24\1\26\2\10"+
    "\1\15\1\17\1\20\1\37\1\31\1\34\1\33\2\10\1\46\1\61"+
    "\1\47\1\13\53\0\1\7\12\0\1\7\4\0\1\7\5\0\27\7"+
    "\1\0\37\7\1\0\u013f\7\31\0\162\7\4\0\14\7\16\0\5\7"+
    "\11\0\1\7\213\0\1\7\13\0\1\7\1\0\3\7\1\0\1\7"+
    "\1\0\24\7\1\0\54\7\1\0\46\7\1\0\5\7\4\0\202\7"+
    "\10\0\105\7\1\0\46\7\2\0\2\7\6\0\20\7\41\0\46\7"+
    "\2\0\1\7\7\0\47\7\110\0\33\7\5\0\3\7\56\0\32\7"+
    "\5\0\13\7\25\0\12\11\4\0\2\7\1\0\143\7\1\0\1\7"+
    "\17\0\2\7\7\0\2\7\12\11\3\7\2\0\1\7\20\0\1\7"+
    "\1\0\36\7\35\0\3\7\60\0\46\7\13\0\1\7\u0152\0\66\7"+
    "\3\0\1\7\22\0\1\7\7\0\12\7\4\0\12\11\25\0\10\7"+
    "\2\0\2\7\2\0\26\7\1\0\7\7\1\0\1\7\3\0\4\7"+
    "\3\0\1\7\36\0\2\7\1\0\3\7\4\0\12\11\2\7\23\0"+
    "\6\7\4\0\2\7\2\0\26\7\1\0\7\7\1\0\2\7\1\0"+
    "\2\7\1\0\2\7\37\0\4\7\1\0\1\7\7\0\12\11\2\0"+
    "\3\7\20\0\11\7\1\0\3\7\1\0\26\7\1\0\7\7\1\0"+
    "\2\7\1\0\5\7\3\0\1\7\22\0\1\7\17\0\2\7\4\0"+
    "\12\11\25\0\10\7\2\0\2\7\2\0\26\7\1\0\7\7\1\0"+
    "\2\7\1\0\5\7\3\0\1\7\36\0\2\7\1\0\3\7\4\0"+
    "\12\11\1\0\1\7\21\0\1\7\1\0\6\7\3\0\3\7\1\0"+
    "\4\7\3\0\2\7\1\0\1\7\1\0\2\7\3\0\2\7\3\0"+
    "\3\7\3\0\10\7\1\0\3\7\55\0\11\11\25\0\10\7\1\0"+
    "\3\7\1\0\27\7\1\0\12\7\1\0\5\7\46\0\2\7\4\0"+
    "\12\11\25\0\10\7\1\0\3\7\1\0\27\7\1\0\12\7\1\0"+
    "\5\7\3\0\1\7\40\0\1\7\1\0\2\7\4\0\12\11\25\0"+
    "\10\7\1\0\3\7\1\0\27\7\1\0\20\7\46\0\2\7\4\0"+
    "\12\11\25\0\22\7\3\0\30\7\1\0\11\7\1\0\1\7\2\0"+
    "\7\7\72\0\60\7\1\0\2\7\14\0\7\7\11\0\12\11\47\0"+
    "\2\7\1\0\1\7\2\0\2\7\1\0\1\7\2\0\1\7\6\0"+
    "\4\7\1\0\7\7\1\0\3\7\1\0\1\7\1\0\1\7\2\0"+
    "\2\7\1\0\4\7\1\0\2\7\11\0\1\7\2\0\5\7\1\0"+
    "\1\7\11\0\12\11\2\0\2\7\42\0\1\7\37\0\12\11\26\0"+
    "\10\7\1\0\42\7\35\0\4\7\164\0\42\7\1\0\5\7\1\0"+
    "\2\7\25\0\12\11\6\0\6\7\112\0\46\7\12\0\51\7\7\0"+
    "\132\7\5\0\104\7\5\0\122\7\6\0\7\7\1\0\77\7\1\0"+
    "\1\7\1\0\4\7\2\0\7\7\1\0\1\7\1\0\4\7\2\0"+
    "\47\7\1\0\1\7\1\0\4\7\2\0\37\7\1\0\1\7\1\0"+
    "\4\7\2\0\7\7\1\0\1\7\1\0\4\7\2\0\7\7\1\0"+
    "\7\7\1\0\27\7\1\0\37\7\1\0\1\7\1\0\4\7\2\0"+
    "\7\7\1\0\47\7\1\0\23\7\16\0\11\11\56\0\125\7\14\0"+
    "\u026c\7\2\0\10\7\12\0\32\7\5\0\113\7\25\0\15\7\1\0"+
    "\4\7\16\0\22\7\16\0\22\7\16\0\15\7\1\0\3\7\17\0"+
    "\64\7\43\0\1\7\4\0\1\7\3\0\12\11\46\0\12\11\6\0"+
    "\130\7\10\0\51\7\127\0\35\7\51\0\12\11\36\7\2\0\5\7"+
    "\u038b\0\154\7\224\0\234\7\4\0\132\7\6\0\26\7\2\0\6\7"+
    "\2\0\46\7\2\0\6\7\2\0\10\7\1\0\1\7\1\0\1\7"+
    "\1\0\1\7\1\0\37\7\2\0\65\7\1\0\7\7\1\0\1\7"+
    "\3\0\3\7\1\0\7\7\3\0\4\7\2\0\6\7\4\0\15\7"+
    "\5\0\3\7\1\0\7\7\164\0\1\7\15\0\1\7\202\0\1\7"+
    "\4\0\1\7\2\0\12\7\1\0\1\7\3\0\5\7\6\0\1\7"+
    "\1\0\1\7\1\0\1\7\1\0\4\7\1\0\3\7\1\0\7\7"+
    "\3\0\3\7\5\0\5\7\u0ebb\0\2\7\52\0\5\7\5\0\2\7"+
    "\4\0\126\7\6\0\3\7\1\0\132\7\1\0\4\7\5\0\50\7"+
    "\4\0\136\7\21\0\30\7\70\0\20\7\u0200\0\u19b6\7\112\0\u51a6\7"+
    "\132\0\u048d\7\u0773\0\u2ba4\7\u215c\0\u012e\7\2\0\73\7\225\0\7\7"+
    "\14\0\5\7\5\0\1\7\1\0\12\7\1\0\15\7\1\0\5\7"+
    "\1\0\1\7\1\0\2\7\1\0\2\7\1\0\154\7\41\0\u016b\7"+
    "\22\0\100\7\2\0\66\7\50\0\14\7\164\0\5\7\1\0\207\7"+
    "\23\0\12\11\7\0\32\7\6\0\32\7\13\0\131\7\3\0\6\7"+
    "\2\0\6\7\2\0\6\7\2\0\3\7\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\1\1\1\2\1\3\1\4\1\5\1\6\1\7"+
    "\1\10\14\7\1\11\1\12\1\13\1\14\1\15\1\16"+
    "\1\17\1\20\1\21\1\22\1\23\1\24\1\25\1\26"+
    "\2\2\1\27\1\30\1\31\1\1\1\0\1\4\1\0"+
    "\1\32\1\33\5\7\1\34\12\7\1\35\1\36\1\37"+
    "\1\40\1\41\1\42\1\43\1\44\1\45\1\46\1\47"+
    "\1\0\4\7\1\50\1\7\1\51\10\7\1\52\1\53"+
    "\1\4\2\7\1\54\1\55\1\7\1\56\1\7\1\57"+
    "\1\7\1\60\4\7\1\61\2\7\1\62\1\7\1\63"+
    "\1\64\2\7\1\65\1\66\1\67";

  private static int [] zzUnpackAction() {
    int [] result = new int[118];
    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\150\0\150\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\u03a8\0\150\0\150\0\150"+
    "\0\150\0\150\0\150\0\150\0\150\0\150\0\u03dc\0\u0410"+
    "\0\u0444\0\u0478\0\u04ac\0\u04e0\0\u0514\0\u0548\0\u057c\0\150"+
    "\0\u05b0\0\u05e4\0\u0618\0\u064c\0\150\0\150\0\u0680\0\u06b4"+
    "\0\u06e8\0\u071c\0\u0750\0\u0104\0\u0784\0\u07b8\0\u07ec\0\u0820"+
    "\0\u0854\0\u0888\0\u08bc\0\u08f0\0\u0924\0\u0958\0\150\0\150"+
    "\0\150\0\150\0\150\0\150\0\150\0\150\0\u098c\0\150"+
    "\0\u09c0\0\u09f4\0\u0a28\0\u0a5c\0\u0a90\0\u0ac4\0\u0104\0\u0af8"+
    "\0\u0104\0\u0b2c\0\u0b60\0\u0b94\0\u0bc8\0\u0bfc\0\u0c30\0\u0c64"+
    "\0\u0c98\0\150\0\150\0\u064c\0\u0ccc\0\u0d00\0\u0104\0\u0104"+
    "\0\u0d34\0\u0104\0\u0d68\0\u0104\0\u0d9c\0\u0104\0\u0dd0\0\u0e04"+
    "\0\u0e38\0\u0e6c\0\u0104\0\u0ea0\0\u0ed4\0\u0104\0\u0f08\0\u0104"+
    "\0\u0104\0\u0f3c\0\u0f70\0\u0104\0\u0104\0\u0104";

  private static int [] zzUnpackRowMap() {
    int [] result = new int[118];
    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\3\1\4\2\5\1\6\1\5\1\7\2\10\2\11"+
    "\2\3\1\12\1\3\1\13\1\14\1\10\1\15\1\16"+
    "\1\17\1\20\2\10\1\21\1\22\2\10\1\23\1\10"+
    "\1\24\1\10\1\25\1\10\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\1\47\1\0\1\50"+
    "\1\0\2\51\1\0\1\51\1\0\1\51\1\0\2\51"+
    "\1\52\47\51\70\0\1\53\1\0\1\54\47\0\1\55"+
    "\63\0\1\56\14\0\4\10\2\0\1\10\1\0\23\10"+
    "\33\0\2\11\60\0\4\10\2\0\1\10\1\0\11\10"+
    "\1\57\11\10\31\0\4\10\2\0\1\10\1\0\1\10"+
    "\1\60\21\10\31\0\4\10\2\0\1\61\1\0\16\10"+
    "\1\62\4\10\31\0\4\10\2\0\1\10\1\0\5\10"+
    "\1\63\11\10\1\64\3\10\31\0\4\10\2\0\1\10"+
    "\1\0\10\10\1\65\12\10\31\0\4\10\2\0\1\10"+
    "\1\0\11\10\1\66\6\10\1\67\2\10\31\0\4\10"+
    "\2\0\1\10\1\0\7\10\1\70\13\10\31\0\4\10"+
    "\2\0\1\10\1\0\10\10\1\71\3\10\1\72\6\10"+
    "\31\0\4\10\2\0\1\10\1\0\7\10\1\73\13\10"+
    "\31\0\4\10\2\0\1\10\1\0\16\10\1\74\4\10"+
    "\31\0\4\10\2\0\1\10\1\0\2\10\1\75\20\10"+
    "\31\0\4\10\2\0\1\10\1\0\1\10\1\76\21\10"+
    "\100\0\1\77\63\0\1\100\63\0\1\101\63\0\1\102"+
    "\63\0\1\103\65\0\1\104\64\0\1\105\60\0\1\106"+
    "\3\0\1\107\57\0\1\110\4\0\1\111\3\0\2\51"+
    "\1\0\1\51\1\0\1\51\1\0\2\51\1\52\47\51"+
    "\1\0\1\51\12\0\3\51\1\0\1\51\3\0\1\51"+
    "\11\0\1\51\26\0\1\53\1\0\4\53\1\0\1\53"+
    "\1\0\52\53\1\0\1\54\1\0\3\54\1\112\1\0"+
    "\1\54\1\0\52\54\7\0\4\10\2\0\1\10\1\0"+
    "\1\10\1\113\21\10\31\0\4\10\2\0\1\10\1\0"+
    "\2\10\1\114\20\10\31\0\4\10\2\0\1\10\1\0"+
    "\20\10\1\115\2\10\31\0\4\10\2\0\1\10\1\0"+
    "\3\10\1\116\17\10\31\0\4\10\2\0\1\10\1\0"+
    "\1\10\1\117\21\10\31\0\4\10\2\0\1\10\1\0"+
    "\2\10\1\120\20\10\31\0\4\10\2\0\1\10\1\0"+
    "\15\10\1\121\5\10\31\0\4\10\2\0\1\10\1\0"+
    "\10\10\1\122\12\10\31\0\4\10\2\0\1\10\1\0"+
    "\7\10\1\123\13\10\31\0\4\10\2\0\1\10\1\0"+
    "\1\124\22\10\31\0\4\10\2\0\1\10\1\0\1\10"+
    "\1\125\21\10\31\0\4\10\2\0\1\10\1\0\3\10"+
    "\1\126\17\10\31\0\4\10\2\0\1\10\1\0\3\10"+
    "\1\127\17\10\31\0\4\10\2\0\1\10\1\0\10\10"+
    "\1\130\12\10\31\0\4\10\2\0\1\131\1\0\23\10"+
    "\100\0\1\132\63\0\1\133\6\0\1\54\1\0\1\54"+
    "\1\134\1\54\1\112\1\0\1\54\1\0\52\54\7\0"+
    "\4\10\2\0\1\10\1\0\20\10\1\135\2\10\31\0"+
    "\4\10\2\0\1\10\1\0\1\10\1\136\21\10\31\0"+
    "\4\10\2\0\1\10\1\0\11\10\1\137\11\10\31\0"+
    "\4\10\2\0\1\10\1\0\1\140\22\10\31\0\4\10"+
    "\2\0\1\10\1\0\1\141\22\10\31\0\4\10\2\0"+
    "\1\10\1\0\10\10\1\142\12\10\31\0\4\10\2\0"+
    "\1\10\1\0\10\10\1\143\12\10\31\0\4\10\2\0"+
    "\1\10\1\0\11\10\1\144\11\10\31\0\4\10\2\0"+
    "\1\10\1\0\11\10\1\145\11\10\31\0\4\10\2\0"+
    "\1\10\1\0\13\10\1\146\7\10\31\0\4\10\2\0"+
    "\1\10\1\0\10\10\1\147\12\10\31\0\4\10\2\0"+
    "\1\10\1\0\1\115\22\10\31\0\4\10\2\0\1\10"+
    "\1\0\3\10\1\150\17\10\31\0\4\10\2\0\1\151"+
    "\1\0\23\10\31\0\4\10\2\0\1\10\1\0\3\10"+
    "\1\152\17\10\31\0\4\10\2\0\1\10\1\0\1\153"+
    "\22\10\31\0\4\10\2\0\1\10\1\0\11\10\1\154"+
    "\11\10\31\0\4\10\2\0\1\10\1\0\5\10\1\155"+
    "\15\10\31\0\4\10\2\0\1\10\1\0\11\10\1\156"+
    "\11\10\31\0\4\10\2\0\1\10\1\0\5\10\1\157"+
    "\15\10\31\0\4\10\2\0\1\10\1\0\5\10\1\160"+
    "\15\10\31\0\4\10\2\0\1\10\1\0\4\10\1\161"+
    "\16\10\31\0\4\10\2\0\1\10\1\0\2\10\1\162"+
    "\20\10\31\0\4\10\2\0\1\10\1\0\13\10\1\163"+
    "\7\10\31\0\4\10\2\0\1\10\1\0\22\10\1\164"+
    "\31\0\4\10\2\0\1\10\1\0\5\10\1\165\15\10"+
    "\31\0\4\10\2\0\1\10\1\0\1\166\22\10\22\0";

  private static int [] zzUnpackTrans() {
    int [] result = new int[4004];
    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\1\3\11\20\1\11\11\11\1\1\11\1\1"+
    "\1\0\1\1\1\0\2\11\20\1\10\11\1\1\1\11"+
    "\1\1\1\0\17\1\2\11\33\1";

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

⌨️ 快捷键说明

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