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

📄 parser.java

📁 用JAVA写的shell程序
💻 JAVA
📖 第 1 页 / 共 2 页
字号:

//----------------------------------------------------
// The following code was generated by CUP v0.10j
// Fri Jan 28 10:53:17 EST 2000
//----------------------------------------------------

package jshell.commandline;

import java_cup.runtime.*;

/** CUP v0.10j generated parser.
  * @version Fri Jan 28 10:53:17 EST 2000
  */
public class parser extends java_cup.runtime.lr_parser {

  /** Default constructor. */
  public parser() {super();}

  /** Constructor which sets the default scanner. */
  public parser(java_cup.runtime.Scanner s) {super(s);}

  /** Production table. */
  protected static final short _production_table[][] = 
    unpackFromStrings(new String[] {
    "\000\031\000\002\005\003\000\002\002\004\000\002\005" +
    "\004\000\002\006\003\000\002\006\005\000\002\007\003" +
    "\000\002\007\005\000\002\007\005\000\002\007\007\000" +
    "\002\007\007\000\002\010\003\000\002\010\005\000\002" +
    "\003\003\000\002\003\004\000\002\003\003\000\002\011" +
    "\003\000\002\011\004\000\002\004\003\000\002\004\003" +
    "\000\002\004\003\000\002\014\003\000\002\014\004\000" +
    "\002\012\003\000\002\013\003\000\002\013\003" });

  /** Access to production table. */
  public short[][] production_table() {return _production_table;}

  /** Parse-action table. */
  protected static final short[][] _action_table = 
    unpackFromStrings(new String[] {
    "\000\042\000\014\006\015\007\013\011\016\015\017\016" +
    "\004\001\002\000\026\002\ufff0\004\ufff0\005\ufff0\010\ufff0" +
    "\011\ufff0\012\ufff0\013\ufff0\014\ufff0\015\ufff0\016\ufff0\001" +
    "\002\000\026\002\ufff5\004\ufff5\005\ufff5\010\ufff5\011\ufff5" +
    "\012\ufff5\013\ufff5\014\ufff5\015\ufff5\016\ufff5\001\002\000" +
    "\026\002\ufff3\004\ufff3\005\ufff3\010\ufff3\011\ufff3\012\ufff3" +
    "\013\ufff3\014\ufff3\015\ufff3\016\ufff3\001\002\000\010\002" +
    "\001\004\042\014\040\001\002\000\012\002\ufffe\004\ufffe" +
    "\010\036\014\ufffe\001\002\000\004\002\035\001\002\000" +
    "\020\002\ufffc\004\ufffc\005\023\010\ufffc\012\025\013\024" +
    "\014\ufffc\001\002\000\026\002\ufff2\004\ufff2\005\ufff2\010" +
    "\ufff2\011\ufff2\012\ufff2\013\ufff2\014\ufff2\015\ufff2\016\ufff2" +
    "\001\002\000\026\002\ufff7\004\ufff7\005\ufff7\010\ufff7\011" +
    "\016\012\ufff7\013\ufff7\014\ufff7\015\017\016\004\001\002" +
    "\000\004\015\020\001\002\000\026\002\uffee\004\uffee\005" +
    "\uffee\010\uffee\011\uffee\012\uffee\013\uffee\014\uffee\015\uffee" +
    "\016\uffee\001\002\000\026\002\uffef\004\uffef\005\uffef\010" +
    "\uffef\011\uffef\012\uffef\013\uffef\014\uffef\015\uffef\016\uffef" +
    "\001\002\000\026\002\ufff1\004\ufff1\005\ufff1\010\ufff1\011" +
    "\ufff1\012\ufff1\013\ufff1\014\ufff1\015\ufff1\016\ufff1\001\002" +
    "\000\026\002\ufff4\004\ufff4\005\ufff4\010\ufff4\011\ufff4\012" +
    "\ufff4\013\ufff4\014\ufff4\015\ufff4\016\ufff4\001\002\000\010" +
    "\011\016\015\017\016\004\001\002\000\010\011\uffe9\015" +
    "\uffe9\016\uffe9\001\002\000\010\011\uffea\015\uffea\016\uffea" +
    "\001\002\000\010\011\uffeb\015\uffeb\016\uffeb\001\002\000" +
    "\010\011\016\015\017\016\004\001\002\000\014\002\ufffa" +
    "\004\ufffa\010\ufffa\012\025\014\ufffa\001\002\000\010\011" +
    "\016\015\017\016\004\001\002\000\012\002\ufff8\004\ufff8" +
    "\010\ufff8\014\ufff8\001\002\000\016\002\ufffb\004\ufffb\005" +
    "\023\010\ufffb\013\024\014\ufffb\001\002\000\010\011\016" +
    "\015\017\016\004\001\002\000\012\002\ufff9\004\ufff9\010" +
    "\ufff9\014\ufff9\001\002\000\004\002\000\001\002\000\014" +
    "\006\015\007\013\011\016\015\017\016\004\001\002\000" +
    "\026\002\ufff6\004\ufff6\005\ufff6\010\ufff6\011\016\012\ufff6" +
    "\013\ufff6\014\ufff6\015\017\016\004\001\002\000\016\006" +
    "\uffed\007\uffed\011\uffed\014\uffed\015\uffed\016\uffed\001\002" +
    "\000\016\006\015\007\013\011\016\014\043\015\017\016" +
    "\004\001\002\000\004\002\uffff\001\002\000\016\006\uffec" +
    "\007\uffec\011\uffec\014\uffec\015\uffec\016\uffec\001\002\000" +
    "\012\002\ufffd\004\ufffd\010\036\014\ufffd\001\002" });

  /** Access to parse-action table. */
  public short[][] action_table() {return _action_table;}

  /** <code>reduce_goto</code> table. */
  protected static final short[][] _reduce_table = 
    unpackFromStrings(new String[] {
    "\000\042\000\020\003\013\004\004\005\010\006\006\007" +
    "\007\010\011\011\005\001\001\000\002\001\001\000\002" +
    "\001\001\000\002\001\001\000\004\014\040\001\001\000" +
    "\002\001\001\000\002\001\001\000\006\012\021\013\025" +
    "\001\001\000\002\001\001\000\004\004\020\001\001\000" +
    "\002\001\001\000\002\001\001\000\002\001\001\000\002" +
    "\001\001\000\002\001\001\000\004\004\031\001\001\000" +
    "\002\001\001\000\002\001\001\000\002\001\001\000\004" +
    "\004\026\001\001\000\004\012\027\001\001\000\004\004" +
    "\030\001\001\000\002\001\001\000\004\013\032\001\001" +
    "\000\004\004\033\001\001\000\002\001\001\000\002\001" +
    "\001\000\010\003\036\004\004\011\005\001\001\000\004" +
    "\004\020\001\001\000\002\001\001\000\014\003\013\004" +
    "\004\007\043\010\011\011\005\001\001\000\002\001\001" +
    "\000\002\001\001\000\002\001\001" });

  /** Access to <code>reduce_goto</code> table. */
  public short[][] reduce_table() {return _reduce_table;}

  /** Instance of action encapsulation class. */
  protected CUP$parser$actions action_obj;

  /** Action encapsulation object initializer. */
  protected void init_actions()
    {
      action_obj = new CUP$parser$actions(this);
    }

  /** Invoke a user supplied parse action. */
  public java_cup.runtime.Symbol do_action(
    int                        act_num,
    java_cup.runtime.lr_parser parser,
    java.util.Stack            stack,
    int                        top)
    throws java.lang.Exception
  {
    /* call code in generated class */
    return action_obj.CUP$parser$do_action(act_num, parser, stack, top);
  }

  /** Indicates start state. */
  public int start_state() {return 0;}
  /** Indicates start production. */
  public int start_production() {return 1;}

  /** <code>EOF</code> Symbol index. */
  public int EOF_sym() {return 0;}

  /** <code>error</code> Symbol index. */
  public int error_sym() {return 1;}

}

/** Cup generated class to encapsulate user supplied action code.*/
class CUP$parser$actions {
  private final parser parser;

  /** Constructor */
  CUP$parser$actions(parser parser) {
    this.parser = parser;
  }

  /** Method with the actual generated action code. */
  public final java_cup.runtime.Symbol CUP$parser$do_action(
    int                        CUP$parser$act_num,
    java_cup.runtime.lr_parser CUP$parser$parser,
    java.util.Stack            CUP$parser$stack,
    int                        CUP$parser$top)
    throws java.lang.Exception
    {
      /* Symbol object for return from actions */
      java_cup.runtime.Symbol CUP$parser$result;

      /* select the action based on the action number */
      switch (CUP$parser$act_num)
        {
          /*. . . . . . . . . . . . . . . . . . . .*/
          case 24: // redirect_out ::= APPEND 
            {
              Object RESULT = null;
		int xleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;		int xright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;		Object x = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;		 RESULT = x; 
              CUP$parser$result = new java_cup.runtime.Symbol(9/*redirect_out*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 23: // redirect_out ::= REDIRECT_OUT 
            {
              Object RESULT = null;
		int xleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;		int xright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;		Object x = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;		 RESULT = x; 
              CUP$parser$result = new java_cup.runtime.Symbol(9/*redirect_out*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 22: // redirect_in ::= REDIRECT_IN 
            {
              Object RESULT = null;

              CUP$parser$result = new java_cup.runtime.Symbol(8/*redirect_in*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 21: // separators ::= separators SEPARATOR 
            {
              Object RESULT = null;

              CUP$parser$result = new java_cup.runtime.Symbol(10/*separators*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 20: // separators ::= SEPARATOR 
            {
              Object RESULT = null;

              CUP$parser$result = new java_cup.runtime.Symbol(10/*separators*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 19: // command_element ::= QUOTED_STRING 
            {
              Object RESULT = null;
		int sleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;		int sright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;		Object s = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;		 RESULT = QuotedString.create((String)s); 
              CUP$parser$result = new java_cup.runtime.Symbol(2/*command_element*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 18: // command_element ::= STRING 
            {
              Object RESULT = null;
		int sleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;		int sright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;		Object s = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;		 RESULT = UnquotedString.create((String)s); 
              CUP$parser$result = new java_cup.runtime.Symbol(2/*command_element*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 17: // command_element ::= VARIABLE 
            {
              Object RESULT = null;
		int vleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;		int vright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;		Object v = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;		 RESULT = Variable.create((String)v); 
              CUP$parser$result = new java_cup.runtime.Symbol(2/*command_element*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 16: // recalled_command ::= EARLIER_COMMAND STRING 
            {
              Object RESULT = null;
		int nleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;		int nright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;		Object n = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;		 RESULT = EarlierCommand.create((String)n); 
              CUP$parser$result = new java_cup.runtime.Symbol(7/*recalled_command*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 15: // recalled_command ::= LAST_COMMAND 
            {

⌨️ 快捷键说明

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