lr_parser.html
来自「数据挖掘的最常用工具。由于开源」· HTML 代码 · 共 1,039 行 · 第 1/3 页
HTML
1,039 行
<A NAME="done_parsing()"><!-- --></A><H3>done_parsing</H3><PRE>public void <B>done_parsing</B>()</PRE><DL><DD>This method is called to indicate that the parser should quit. This is normally called by an accept action, but can be used to cancel parsing early in other circumstances if desired.<P><DD><DL></DL></DD></DL><HR><A NAME="setScanner(weka.core.parser.java_cup.runtime.Scanner)"><!-- --></A><H3>setScanner</H3><PRE>public void <B>setScanner</B>(<A HREF="../../../../../weka/core/parser/java_cup/runtime/Scanner.html" title="interface in weka.core.parser.java_cup.runtime">Scanner</A> s)</PRE><DL><DD>Simple accessor method to set the default scanner.<P><DD><DL></DL></DD></DL><HR><A NAME="getScanner()"><!-- --></A><H3>getScanner</H3><PRE>public <A HREF="../../../../../weka/core/parser/java_cup/runtime/Scanner.html" title="interface in weka.core.parser.java_cup.runtime">Scanner</A> <B>getScanner</B>()</PRE><DL><DD>Simple accessor method to get the default scanner.<P><DD><DL></DL></DD></DL><HR><A NAME="do_action(int, weka.core.parser.java_cup.runtime.lr_parser, java.util.Stack, int)"><!-- --></A><H3>do_action</H3><PRE>public abstract <A HREF="../../../../../weka/core/parser/java_cup/runtime/Symbol.html" title="class in weka.core.parser.java_cup.runtime">Symbol</A> <B>do_action</B>(int act_num, <A HREF="../../../../../weka/core/parser/java_cup/runtime/lr_parser.html" title="class in weka.core.parser.java_cup.runtime">lr_parser</A> parser, java.util.Stack stack, int top) throws java.lang.Exception</PRE><DL><DD>Perform a bit of user supplied action code (supplied by generated subclass). Actions are indexed by an internal action number assigned at parser generation time.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>act_num</CODE> - the internal index of the action to be performed.<DD><CODE>parser</CODE> - the parser object we are acting for.<DD><CODE>stack</CODE> - the parse stack of that object.<DD><CODE>top</CODE> - the index of the top element of the parse stack.<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE></DL></DD></DL><HR><A NAME="user_init()"><!-- --></A><H3>user_init</H3><PRE>public void <B>user_init</B>() throws java.lang.Exception</PRE><DL><DD>User code for initialization inside the parser. Typically this initializes the scanner. This is called before the parser requests the first Symbol. Here this is just a placeholder for subclasses that might need this and we perform no action. This method is normally overridden by the generated code using this contents of the "init with" clause as its body.<P><DD><DL><DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE></DL></DD></DL><HR><A NAME="scan()"><!-- --></A><H3>scan</H3><PRE>public <A HREF="../../../../../weka/core/parser/java_cup/runtime/Symbol.html" title="class in weka.core.parser.java_cup.runtime">Symbol</A> <B>scan</B>() throws java.lang.Exception</PRE><DL><DD>Get the next Symbol from the input (supplied by generated subclass). Once end of file has been reached, all subsequent calls to scan should return an EOF Symbol (which is Symbol number 0). By default this method returns getScanner().next_token(); this implementation can be overriden by the generated parser using the code declared in the "scan with" clause. Do not recycle objects; every call to scan() should return a fresh object.<P><DD><DL><DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE></DL></DD></DL><HR><A NAME="report_fatal_error(java.lang.String, java.lang.Object)"><!-- --></A><H3>report_fatal_error</H3><PRE>public void <B>report_fatal_error</B>(java.lang.String message, java.lang.Object info) throws java.lang.Exception</PRE><DL><DD>Report a fatal error. This method takes a message string and an additional object (to be used by specializations implemented in subclasses). Here in the base class a very simple implementation is provided which reports the error then throws an exception.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>message</CODE> - an error message.<DD><CODE>info</CODE> - an extra object reserved for use by specialized subclasses.<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE></DL></DD></DL><HR><A NAME="report_error(java.lang.String, java.lang.Object)"><!-- --></A><H3>report_error</H3><PRE>public void <B>report_error</B>(java.lang.String message, java.lang.Object info)</PRE><DL><DD>Report a non fatal error (or warning). This method takes a message string and an additional object (to be used by specializations implemented in subclasses). Here in the base class a very simple implementation is provided which simply prints the message to System.err.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>message</CODE> - an error message.<DD><CODE>info</CODE> - an extra object reserved for use by specialized subclasses.</DL></DD></DL><HR><A NAME="syntax_error(weka.core.parser.java_cup.runtime.Symbol)"><!-- --></A><H3>syntax_error</H3><PRE>public void <B>syntax_error</B>(<A HREF="../../../../../weka/core/parser/java_cup/runtime/Symbol.html" title="class in weka.core.parser.java_cup.runtime">Symbol</A> cur_token)</PRE><DL><DD>This method is called when a syntax error has been detected and recovery is about to be invoked. Here in the base class we just emit a "Syntax error" error message.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>cur_token</CODE> - the current lookahead Symbol.</DL></DD></DL><HR><A NAME="unrecovered_syntax_error(weka.core.parser.java_cup.runtime.Symbol)"><!-- --></A><H3>unrecovered_syntax_error</H3><PRE>public void <B>unrecovered_syntax_error</B>(<A HREF="../../../../../weka/core/parser/java_cup/runtime/Symbol.html" title="class in weka.core.parser.java_cup.runtime">Symbol</A> cur_token) throws java.lang.Exception</PRE><DL><DD>This method is called if it is determined that syntax error recovery has been unsuccessful. Here in the base class we report a fatal error.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>cur_token</CODE> - the current lookahead Symbol.<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE></DL></DD></DL><HR><A NAME="parse()"><!-- --></A><H3>parse</H3><PRE>public <A HREF="../../../../../weka/core/parser/java_cup/runtime/Symbol.html" title="class in weka.core.parser.java_cup.runtime">Symbol</A> <B>parse</B>() throws java.lang.Exception</PRE><DL><DD>This method provides the main parsing routine. It returns only when done_parsing() has been called (typically because the parser has accepted, or a fatal error has been reported). See the header documentation for the class regarding how shift/reduce parsers operate and how the various tables are used.<P><DD><DL><DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE></DL></DD></DL><HR><A NAME="debug_message(java.lang.String)"><!-- --></A><H3>debug_message</H3><PRE>public void <B>debug_message</B>(java.lang.String mess)</PRE><DL><DD>Write a debugging message to System.err for the debugging version of the parser.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>mess</CODE> - the text of the debugging message.</DL></DD></DL><HR><A NAME="dump_stack()"><!-- --></A><H3>dump_stack</H3><PRE>public void <B>dump_stack</B>()</PRE><DL><DD>Dump the parse stack for debugging purposes.<P><DD><DL></DL></DD></DL><HR><A NAME="debug_reduce(int, int, int)"><!-- --></A><H3>debug_reduce</H3><PRE>public void <B>debug_reduce</B>(int prod_num, int nt_num, int rhs_size)</PRE><DL><DD>Do debug output for a reduce.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>prod_num</CODE> - the production we are reducing with.<DD><CODE>nt_num</CODE> - the index of the LHS non terminal.<DD><CODE>rhs_size</CODE> - the size of the RHS.</DL></DD></DL><HR><A NAME="debug_shift(weka.core.parser.java_cup.runtime.Symbol)"><!-- --></A><H3>debug_shift</H3><PRE>public void <B>debug_shift</B>(<A HREF="../../../../../weka/core/parser/java_cup/runtime/Symbol.html" title="class in weka.core.parser.java_cup.runtime">Symbol</A> shift_tkn)</PRE><DL><DD>Do debug output for shift.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>shift_tkn</CODE> - the Symbol being shifted onto the stack.</DL></DD></DL><HR><A NAME="debug_stack()"><!-- --></A><H3>debug_stack</H3><PRE>public void <B>debug_stack</B>()</PRE><DL><DD>Do debug output for stack state. [CSA]<P><DD><DL></DL></DD></DL><HR><A NAME="debug_parse()"><!-- --></A><H3>debug_parse</H3><PRE>public <A HREF="../../../../../weka/core/parser/java_cup/runtime/Symbol.html" title="class in weka.core.parser.java_cup.runtime">Symbol</A> <B>debug_parse</B>() throws java.lang.Exception</PRE><DL><DD>Perform a parse with debugging output. This does exactly the same things as parse(), except that it calls debug_shift() and debug_reduce() when shift and reduce moves are taken by the parser and produces various other debugging messages.<P><DD><DL><DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="http://www.cs.waikato.ac.nz/ml/weka/" target="_blank"><FONT CLASS="NavBarFont1"><B>Weka's home</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../weka/core/parser/java_cup/runtime/DefaultSymbolFactory.html" title="class in weka.core.parser.java_cup.runtime"><B>PREV CLASS</B></A> <A HREF="../../../../../weka/core/parser/java_cup/runtime/Scanner.html" title="interface in weka.core.parser.java_cup.runtime"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?weka/core/parser/java_cup/runtime/lr_parser.html" target="_top"><B>FRAMES</B></A> <A HREF="lr_parser.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?