亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? production.java

?? 本設計Tiger語言為源語言
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
package java_cup;import java.util.Hashtable;import java.util.Enumeration;/** This class represents a production in the grammar.  It contains *  a LHS non terminal, and an array of RHS symbols.  As various  *  transformations are done on the RHS of the production, it may shrink. *  As a result a separate length is always maintained to indicate how much *  of the RHS array is still valid.<p> *  *  I addition to construction and manipulation operations, productions provide *  methods for factoring out actions (see  remove_embedded_actions()), for *  computing the nullability of the production (i.e., can it derive the empty *  string, see check_nullable()), and operations for computing its first *  set (i.e., the set of terminals that could appear at the beginning of some *  string derived from the production, see check_first_set()). *  * @see     java_cup.production_part * @see     java_cup.symbol_part * @see     java_cup.action_part * @version last updated: 7/3/96 * @author  Frank Flannery */public class production {  /*-----------------------------------------------------------*/  /*--- Constructor(s) ----------------------------------------*/  /*-----------------------------------------------------------*/  /** Full constructor.  This constructor accepts a LHS non terminal,   *  an array of RHS parts (including terminals, non terminals, and    *  actions), and a string for a final reduce action.   It does several   *  manipulations in the process of  creating a production object.   *  After some validity checking it translates labels that appear in   *  actions into code for accessing objects on the runtime parse stack.   *  It them merges adjacent actions if they appear and moves any trailing   *  action into the final reduce actions string.  Next it removes any   *  embedded actions by factoring them out with new action productions.     *  Finally it assigns a unique index to the production.<p>   *   *  Factoring out of actions is accomplished by creating new "hidden"   *  non terminals.  For example if the production was originally: <pre>   *    A ::= B {action} C D   *  </pre>   *  then it is factored into two productions:<pre>   *    A ::= B X C D   *    X ::= {action}   *  </pre>    *  (where X is a unique new non terminal).  This has the effect of placing   *  all actions at the end where they can be handled as part of a reduce by   *  the parser.   */  public production(    non_terminal    lhs_sym,     production_part rhs_parts[],     int             rhs_l,    String          action_str)    throws internal_error    {      int         i;      action_part tail_action;      String declare_str;      int rightlen = rhs_l;      /* remember the length */      if (rhs_l >= 0)	_rhs_length = rhs_l;      else if (rhs_parts != null)	_rhs_length = rhs_parts.length;      else	_rhs_length = 0;	      /* make sure we have a valid left-hand-side */      if (lhs_sym == null) 	throw new internal_error(	  "Attempt to construct a production with a null LHS");      /* I'm not translating labels anymore, I'm adding code to declare	 labels as valid variables.  This way, the users code string is	 untouched 	 6/96 frankf */      /* check if the last part of the right hand side is an action.  If         it is, it won't be on the stack, so we don't want to count it 	 in the rightlen.  Then when we search down the stack for a         Symbol, we don't try to search past action */      if (rhs_l > 0) {	if (rhs_parts[rhs_l - 1].is_action()) {	  rightlen = rhs_l - 1;	} else {	  rightlen = rhs_l;	}      }      /* get the generated declaration code for the necessary labels. */      declare_str = declare_labels(		    rhs_parts, rightlen, action_str);      if (action_str == null) 	action_str = declare_str;      else 	action_str = declare_str + action_str;	 	        /* count use of lhs */      lhs_sym.note_use();      /* create the part for left-hand-side */      _lhs = new symbol_part(lhs_sym);      /* merge adjacent actions (if any) */      _rhs_length = merge_adjacent_actions(rhs_parts, _rhs_length);      /* strip off any trailing action */      tail_action = strip_trailing_action(rhs_parts, _rhs_length);      if (tail_action != null) _rhs_length--;      /* Why does this run through the right hand side happen	 over and over?  here a quick combination of two 	 prior runs plus one I wanted of my own	 frankf 6/25/96 */      /* allocate and copy over the right-hand-side */      /* count use of each rhs symbol */      _rhs = new production_part[_rhs_length];      for (i=0; i<_rhs_length; i++) {	_rhs[i] = rhs_parts[i];	if (!_rhs[i].is_action()) {	  ((symbol_part)_rhs[i]).the_symbol().note_use();	  if (((symbol_part)_rhs[i]).the_symbol() instanceof terminal) {	    _rhs_prec = 	      ((terminal)((symbol_part)_rhs[i]).the_symbol()).precedence_num();	    _rhs_assoc = 	      ((terminal)((symbol_part)_rhs[i]).the_symbol()).precedence_side();	  }	}      }      /*now action string is really declaration string, so put it in front!	6/14/96 frankf */      if (action_str == null) action_str = "";      if (tail_action != null && tail_action.code_string() != null)	action_str = action_str + "\t\t" +  tail_action.code_string();      /* stash the action */      _action = new action_part(action_str);      /* rewrite production to remove any embedded actions */      remove_embedded_actions();      /* assign an index */      _index = next_index++;      /* put us in the global collection of productions */      _all.put(new Integer(_index),this);      /* put us in the production list of the lhs non terminal */      lhs_sym.add_production(this);    }  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/  /** Constructor with no action string. */  public production(    non_terminal    lhs_sym,     production_part rhs_parts[],     int             rhs_l)    throws internal_error    {      this(lhs_sym,rhs_parts,rhs_l,null);    }   /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/  /* Constructor with precedence and associativity of production     contextually define */  public production(    non_terminal    lhs_sym,     production_part rhs_parts[],     int             rhs_l,    String          action_str,    int		    prec_num,    int             prec_side)    throws internal_error    {      this(lhs_sym,rhs_parts,rhs_l,action_str);            /* set the precedence */      set_precedence_num(prec_num);      set_precedence_side(prec_side);    }  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/	       /* Constructor w/ no action string and contextual precedence     defined */  public production(    non_terminal    lhs_sym,     production_part rhs_parts[],     int             rhs_l,    int             prec_num,    int             prec_side)    throws internal_error    {      this(lhs_sym,rhs_parts,rhs_l,null);      /* set the precedence */      set_precedence_num(prec_num);      set_precedence_side(prec_side);    }  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/  /*-----------------------------------------------------------*/  /*--- (Access to) Static (Class) Variables ------------------*/  /*-----------------------------------------------------------*/       /** Table of all productions.  Elements are stored using their index as    *  the key.   */  protected static Hashtable _all = new Hashtable();   /** Access to all productions. */  public static Enumeration all() {return _all.elements();}    /** Lookup a production by index. */  public static production find(int indx) {    return (production) _all.get(new Integer(indx));  }  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/   /** Total number of productions. */  public static int number() {return _all.size();}  /** Static counter for assigning unique index numbers. */  protected static int next_index;  /*-----------------------------------------------------------*/  /*--- (Access to) Instance Variables ------------------------*/  /*-----------------------------------------------------------*/  /** The left hand side non-terminal. */  protected symbol_part _lhs;  /** The left hand side non-terminal. */  public symbol_part lhs() {return _lhs;}  /** The precedence of the rule */  protected int _rhs_prec = -1;  protected int _rhs_assoc = -1;  /** Access to the precedence of the rule */  public int precedence_num() { return _rhs_prec; }  public int precedence_side() { return _rhs_assoc; }  /** Setting the precedence of a rule */  public void set_precedence_num(int prec_num) {      _rhs_prec = prec_num;  }  public void set_precedence_side(int prec_side) {     _rhs_assoc = prec_side;  }  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/  /** A collection of parts for the right hand side. */  protected production_part _rhs[];  /** Access to the collection of parts for the right hand side. */  public production_part rhs(int indx) throws internal_error    {      if (indx >= 0 && indx < _rhs_length)	return _rhs[indx];      else	throw new internal_error(	  "Index out of range for right hand side of production");    }  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/  /** How much of the right hand side array we are presently using. */  protected int _rhs_length;  /** How much of the right hand side array we are presently using. */  public int rhs_length() {return _rhs_length;}  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/  /** An action_part containing code for the action to be performed when we    *  reduce with this production.    */  protected action_part _action;  /** An action_part containing code for the action to be performed when we    *  reduce with this production.    */  public action_part action() {return _action;}  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/  /** Index number of the production. */  protected int _index;  /** Index number of the production. */  public int index() {return _index;}  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/  /** Count of number of reductions using this production. */  protected int _num_reductions = 0;  /** Count of number of reductions using this production. */  public int num_reductions() {return _num_reductions;}  /** Increment the count of reductions with this non-terminal */  public void note_reduction_use() {_num_reductions++;}  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/  /** Is the nullability of the production known or unknown? */  protected boolean _nullable_known = false;  /** Is the nullability of the production known or unknown? */  public boolean nullable_known() {return _nullable_known;}  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/  /** Nullability of the production (can it derive the empty string). */  protected boolean _nullable = false;  /** Nullability of the production (can it derive the empty string). */  public boolean nullable() {return _nullable;}  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/  /** First set of the production.  This is the set of terminals that    *  could appear at the front of some string derived from this production.   */  protected terminal_set _first_set = new terminal_set();  /** First set of the production.  This is the set of terminals that    *  could appear at the front of some string derived from this production.   */  public terminal_set first_set() {return _first_set;}  /*-----------------------------------------------------------*/  /*--- Static Methods ----------------------------------------*/  /*-----------------------------------------------------------*/  /** Determine if a given character can be a label id starter.    * @param c the character in question.    */  protected static boolean is_id_start(char c)    {      return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c == '_');      //later need to handle non-8-bit chars here    }  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/  /** Determine if a character can be in a label id.    * @param c the character in question.   */  protected static boolean is_id_char(char c)    {      return is_id_start(c) || (c >= '0' && c <= '9');    }  /*-----------------------------------------------------------*/  /*--- General Methods ---------------------------------------*/  /*-----------------------------------------------------------*/    /** Return label declaration code

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久天堂av| 日韩免费观看高清完整版| 亚洲免费观看高清| 国产一区在线不卡| 极品瑜伽女神91| 日韩三级在线免费观看| 日韩视频一区二区三区 | 欧美日韩久久久一区| 国产精品全国免费观看高清 | 婷婷久久综合九色综合伊人色| 亚洲与欧洲av电影| 色婷婷综合在线| 亚洲最新视频在线观看| 亚洲一本大道在线| 色婷婷综合激情| 加勒比av一区二区| 亚洲高清三级视频| 91在线免费看| 国产性做久久久久久| 99免费精品在线观看| 久久久久久久久久久黄色| 国产精品福利一区二区三区| 美女久久久精品| 麻豆精品蜜桃视频网站| 久久99久久99精品免视看婷婷 | 91网站最新网址| 亚洲第一狼人社区| 久久99精品久久只有精品| 蜜臀av一级做a爰片久久| 精品美女被调教视频大全网站| 久久免费精品国产久精品久久久久| 国内精品自线一区二区三区视频| 精品美女被调教视频大全网站| 一区二区三区蜜桃网| 欧美主播一区二区三区美女| 国产精品欧美经典| 视频一区二区中文字幕| 国产一区二区三区国产| 久久精品国产精品亚洲精品| 色综合色综合色综合色综合色综合| 久久久av毛片精品| 中文无字幕一区二区三区| 国产视频亚洲色图| 日韩欧美一级在线播放| 色婷婷激情综合| 久久国产视频网| 欧美日韩在线播| 欧美xxx久久| 欧美日韩高清一区二区三区| 99国产精品久久久久久久久久久 | 午夜精品福利久久久| 99久久国产综合精品女不卡| 精品不卡在线视频| 美女爽到高潮91| 国产精品资源网站| 91麻豆精品91久久久久同性| 欧美日韩激情一区二区三区| 欧美精品一区二区久久婷婷 | 欧美一区二区免费| 久久天天做天天爱综合色| 欧美日韩亚洲不卡| 北条麻妃一区二区三区| 一区二区三区欧美久久| 亚洲欧美一区二区三区极速播放| 精品久久五月天| 精品美女在线播放| 国产女人aaa级久久久级| 精品1区2区3区| 欧美精品一区二区在线播放| 国产九九视频一区二区三区| 久久久国产一区二区三区四区小说| 亚洲欧美综合另类在线卡通| 精品国产乱码久久久久久老虎 | 在线观看av不卡| 日韩一区二区三区观看| 精品国产乱码久久久久久浪潮| 麻豆成人久久精品二区三区红| 欧美日韩在线精品一区二区三区激情| 26uuu另类欧美| 欧美高清www午色夜在线视频| 精品久久久久香蕉网| 日本精品视频一区二区| 国产麻豆视频一区二区| 欧美色图一区二区三区| 久久久一区二区三区| 欧美一区二区日韩一区二区| 337p亚洲精品色噜噜狠狠| 18欧美亚洲精品| 日本vs亚洲vs韩国一区三区二区| 亚洲已满18点击进入久久| 国产成人鲁色资源国产91色综| 日韩高清国产一区在线| 欧美综合在线视频| 中文字幕一区免费在线观看| 91蝌蚪porny成人天涯| 日韩欧美国产午夜精品| 亚洲精品水蜜桃| 国产精品欧美综合在线| 欧美国产一区视频在线观看| av爱爱亚洲一区| 国产精品嫩草影院com| 国产精品私人自拍| 欧美日韩国产一级二级| 欧美一区二区三区日韩| 国产日韩欧美精品在线| 欧洲在线/亚洲| 欧美mv和日韩mv国产网站| 国产午夜一区二区三区| 一区二区三区色| 久久99精品国产麻豆不卡| 国产精品欧美精品| 亚洲品质自拍视频| 成人黄色片在线观看| 91精品国产乱| 亚洲精品一卡二卡| 日日夜夜精品视频免费| 国产馆精品极品| 欧美精选在线播放| 国产成人免费视频网站高清观看视频| 99久久精品国产导航| 日韩一区二区精品| 成人精品高清在线| 欧美国产1区2区| 亚洲视频每日更新| 中文字幕欧美一| 久久综合网色—综合色88| 亚洲高清一区二区三区| 春色校园综合激情亚洲| 麻豆91精品91久久久的内涵| 3atv一区二区三区| 91精品国产色综合久久ai换脸 | 亚洲成人资源在线| 欧美精品123区| 欧美日韩一区二区电影| 视频在线观看91| 日韩一区二区三| 国产一区在线精品| 成人黄色综合网站| 日韩精品1区2区3区| 国产一区在线观看视频| 国产精品看片你懂得| 欧美影片第一页| 宅男在线国产精品| 激情综合色综合久久综合| 国产精品一区在线观看你懂的| 福利一区二区在线观看| 99精品欧美一区二区三区综合在线| 亚洲一区二区三区中文字幕| 精品一区二区影视| 国产在线一区观看| 91网站在线播放| 人人狠狠综合久久亚洲| 久久精品国产一区二区三区免费看| 欧美午夜精品久久久久久超碰| 在线观看日韩国产| 婷婷久久综合九色综合绿巨人 | 亚洲丝袜自拍清纯另类| 国产精品欧美久久久久一区二区| 国产成人在线视频播放| 国产精品一区二区三区乱码| 久久国产婷婷国产香蕉| 精品免费视频一区二区| 91精品欧美一区二区三区综合在| 一区二区三区免费在线观看| 亚洲精品ww久久久久久p站| 天天色天天操综合| 欧美一区二区三区播放老司机| 亚欧色一区w666天堂| 青青草91视频| 亚洲欧洲日韩一区二区三区| 99精品久久只有精品| 天堂蜜桃91精品| 91精品欧美一区二区三区综合在| 成人夜色视频网站在线观看| 欧美人妇做爰xxxⅹ性高电影| 国产亚洲欧美在线| 欧美日韩中文国产| 成人av影视在线观看| 亚洲欧美另类小说| 欧美日韩亚洲综合在线| 制服.丝袜.亚洲.另类.中文| 国产欧美精品一区二区三区四区| 久久99热狠狠色一区二区| 国产精品无圣光一区二区| 国产蜜臀97一区二区三区| 国产欧美中文在线| 欧美丝袜第三区| www日韩大片| 欧美日本一区二区| 国产日产亚洲精品系列| 色老综合老女人久久久| 欧美麻豆精品久久久久久| 国产欧美日韩综合精品一区二区| 91网站在线播放| 国产成人av电影在线播放| 亚洲丝袜另类动漫二区| 亚洲午夜免费视频| 久久久噜噜噜久噜久久综合| 欧美日韩一级二级三级| 国产亚洲综合在线|