lr_parser.html

来自「数据挖掘的最常用工具。由于开源」· HTML 代码 · 共 1,039 行 · 第 1/3 页

HTML
1,039
字号
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dump the parse stack for debugging purposes.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract &nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../weka/core/parser/java_cup/runtime/lr_parser.html#EOF_sym()">EOF_sym</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The index of the end of file terminal Symbol (supplied by generated   subclass).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract &nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../weka/core/parser/java_cup/runtime/lr_parser.html#error_sym()">error_sym</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The index of the special error Symbol (supplied by generated subclass).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../../../weka/core/parser/java_cup/runtime/Scanner.html" title="interface in weka.core.parser.java_cup.runtime">Scanner</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../weka/core/parser/java_cup/runtime/lr_parser.html#getScanner()">getScanner</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Simple accessor method to get the default scanner.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../../../weka/core/parser/java_cup/runtime/SymbolFactory.html" title="interface in weka.core.parser.java_cup.runtime">SymbolFactory</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../weka/core/parser/java_cup/runtime/lr_parser.html#getSymbolFactory()">getSymbolFactory</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Whenever creation of a new Symbol is necessary, one should use this factory.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../../../weka/core/parser/java_cup/runtime/Symbol.html" title="class in weka.core.parser.java_cup.runtime">Symbol</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../weka/core/parser/java_cup/runtime/lr_parser.html#parse()">parse</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This method provides the main parsing routine.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract &nbsp;short[][]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../weka/core/parser/java_cup/runtime/lr_parser.html#production_table()">production_table</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Table of production information (supplied by generated subclass).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract &nbsp;short[][]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../weka/core/parser/java_cup/runtime/lr_parser.html#reduce_table()">reduce_table</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The reduce-goto table (supplied by generated subclass).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../weka/core/parser/java_cup/runtime/lr_parser.html#report_error(java.lang.String, java.lang.Object)">report_error</A></B>(java.lang.String&nbsp;message,             java.lang.Object&nbsp;info)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Report a non fatal error (or warning).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../weka/core/parser/java_cup/runtime/lr_parser.html#report_fatal_error(java.lang.String, java.lang.Object)">report_fatal_error</A></B>(java.lang.String&nbsp;message,                   java.lang.Object&nbsp;info)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Report a fatal error.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../../../weka/core/parser/java_cup/runtime/Symbol.html" title="class in weka.core.parser.java_cup.runtime">Symbol</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../weka/core/parser/java_cup/runtime/lr_parser.html#scan()">scan</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the next Symbol from the input (supplied by generated subclass).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../weka/core/parser/java_cup/runtime/lr_parser.html#setScanner(weka.core.parser.java_cup.runtime.Scanner)">setScanner</A></B>(<A HREF="../../../../../weka/core/parser/java_cup/runtime/Scanner.html" title="interface in weka.core.parser.java_cup.runtime">Scanner</A>&nbsp;s)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Simple accessor method to set the default scanner.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract &nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../weka/core/parser/java_cup/runtime/lr_parser.html#start_production()">start_production</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The index of the start production (supplied by generated subclass).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract &nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../weka/core/parser/java_cup/runtime/lr_parser.html#start_state()">start_state</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The index of the start state (supplied by generated subclass).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../weka/core/parser/java_cup/runtime/lr_parser.html#syntax_error(weka.core.parser.java_cup.runtime.Symbol)">syntax_error</A></B>(<A HREF="../../../../../weka/core/parser/java_cup/runtime/Symbol.html" title="class in weka.core.parser.java_cup.runtime">Symbol</A>&nbsp;cur_token)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This method is called when a syntax error has been detected and recovery   is about to be invoked.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../weka/core/parser/java_cup/runtime/lr_parser.html#unrecovered_syntax_error(weka.core.parser.java_cup.runtime.Symbol)">unrecovered_syntax_error</A></B>(<A HREF="../../../../../weka/core/parser/java_cup/runtime/Symbol.html" title="class in weka.core.parser.java_cup.runtime">Symbol</A>&nbsp;cur_token)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This method is called if it is determined that syntax error recovery   has been unsuccessful.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../weka/core/parser/java_cup/runtime/lr_parser.html#user_init()">user_init</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;User code for initialization inside the parser.</TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD></TR></TABLE>&nbsp;<P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Field Detail</B></FONT></TH></TR></TABLE><A NAME="symbolFactory"><!-- --></A><H3>symbolFactory</H3><PRE>public <A HREF="../../../../../weka/core/parser/java_cup/runtime/SymbolFactory.html" title="interface in weka.core.parser.java_cup.runtime">SymbolFactory</A> <B>symbolFactory</B></PRE><DL><DL></DL></DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TH></TR></TABLE><A NAME="lr_parser()"><!-- --></A><H3>lr_parser</H3><PRE>public <B>lr_parser</B>()</PRE><DL><DD>Simple constructor.<P></DL><HR><A NAME="lr_parser(weka.core.parser.java_cup.runtime.Scanner)"><!-- --></A><H3>lr_parser</H3><PRE>public <B>lr_parser</B>(<A HREF="../../../../../weka/core/parser/java_cup/runtime/Scanner.html" title="interface in weka.core.parser.java_cup.runtime">Scanner</A>&nbsp;s)</PRE><DL><DD>Constructor that sets the default scanner. [CSA/davidm]<P></DL><HR><A NAME="lr_parser(weka.core.parser.java_cup.runtime.Scanner, weka.core.parser.java_cup.runtime.SymbolFactory)"><!-- --></A><H3>lr_parser</H3><PRE>public <B>lr_parser</B>(<A HREF="../../../../../weka/core/parser/java_cup/runtime/Scanner.html" title="interface in weka.core.parser.java_cup.runtime">Scanner</A>&nbsp;s,                 <A HREF="../../../../../weka/core/parser/java_cup/runtime/SymbolFactory.html" title="interface in weka.core.parser.java_cup.runtime">SymbolFactory</A>&nbsp;symfac)</PRE><DL><DD>Constructor that sets the default scanner and a SymbolFactory<P></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="getSymbolFactory()"><!-- --></A><H3>getSymbolFactory</H3><PRE>public <A HREF="../../../../../weka/core/parser/java_cup/runtime/SymbolFactory.html" title="interface in weka.core.parser.java_cup.runtime">SymbolFactory</A> <B>getSymbolFactory</B>()</PRE><DL><DD>Whenever creation of a new Symbol is necessary, one should use this factory.<P><DD><DL></DL></DD></DL><HR><A NAME="production_table()"><!-- --></A><H3>production_table</H3><PRE>public abstract short[][] <B>production_table</B>()</PRE><DL><DD>Table of production information (supplied by generated subclass).  This table contains one entry per production and is indexed by   the negative-encoded values (reduce actions) in the action_table.    Each entry has two parts, the index of the non-terminal on the   left hand side of the production, and the number of Symbols   on the right hand side.<P><DD><DL></DL></DD></DL><HR><A NAME="action_table()"><!-- --></A><H3>action_table</H3><PRE>public abstract short[][] <B>action_table</B>()</PRE><DL><DD>The action table (supplied by generated subclass).  This table is  indexed by state and terminal number indicating what action is to  be taken when the parser is in the given state (i.e., the given state   is on top of the stack) and the given terminal is next on the input.    States are indexed using the first dimension, however, the entries for   a given state are compacted and stored in adjacent index, value pairs   which are searched for rather than accessed directly (see get_action()).    The actions stored in the table will be either shifts, reduces, or   errors.  Shifts are encoded as positive values (one greater than the   state shifted to).  Reduces are encoded as negative values (one less   than the production reduced by).  Error entries are denoted by zero.<P><DD><DL><DT><B>See Also:</B><DD><CODE>java_cup.runtime.lr_parser#get_action</CODE></DL></DD></DL><HR><A NAME="reduce_table()"><!-- --></A><H3>reduce_table</H3><PRE>public abstract short[][] <B>reduce_table</B>()</PRE><DL><DD>The reduce-goto table (supplied by generated subclass).  This  table is indexed by state and non-terminal number and contains  state numbers.  States are indexed using the first dimension, however,  the entries for a given state are compacted and stored in adjacent  index, value pairs which are searched for rather than accessed   directly (see get_reduce()).  When a reduce occurs, the handle   (corresponding to the RHS of the matched production) is popped off   the stack.  The new top of stack indicates a state.  This table is   then indexed by that state and the LHS of the reducing production to   indicate where to "shift" to.<P><DD><DL><DT><B>See Also:</B><DD><CODE>java_cup.runtime.lr_parser#get_reduce</CODE></DL></DD></DL><HR><A NAME="start_state()"><!-- --></A><H3>start_state</H3><PRE>public abstract int <B>start_state</B>()</PRE><DL><DD>The index of the start state (supplied by generated subclass).<P><DD><DL></DL></DD></DL><HR><A NAME="start_production()"><!-- --></A><H3>start_production</H3><PRE>public abstract int <B>start_production</B>()</PRE><DL><DD>The index of the start production (supplied by generated subclass).<P><DD><DL></DL></DD></DL><HR><A NAME="EOF_sym()"><!-- --></A><H3>EOF_sym</H3><PRE>public abstract int <B>EOF_sym</B>()</PRE><DL><DD>The index of the end of file terminal Symbol (supplied by generated   subclass).<P><DD><DL></DL></DD></DL><HR><A NAME="error_sym()"><!-- --></A><H3>error_sym</H3><PRE>public abstract int <B>error_sym</B>()</PRE><DL><DD>The index of the special error Symbol (supplied by generated subclass).<P><DD><DL></DL></DD></DL><HR>

⌨️ 快捷键说明

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