emit.html
来自「数据挖掘的最常用工具。由于开源」· HTML 代码 · 共 808 行 · 第 1/2 页
HTML
808 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.5.0_13) on Tue Jul 15 15:48:47 NZST 2008 --><TITLE>emit</TITLE><META NAME="keywords" CONTENT="weka.core.parser.java_cup.emit class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){ parent.document.title="emit";}</SCRIPT><NOSCRIPT></NOSCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" 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_top_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/assoc.html" title="class in weka.core.parser.java_cup"><B>PREV CLASS</B></A> <A HREF="../../../../weka/core/parser/java_cup/ErrorManager.html" title="class in weka.core.parser.java_cup"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?weka/core/parser/java_cup/emit.html" target="_top"><B>FRAMES</B></A> <A HREF="emit.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> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">weka.core.parser.java_cup</FONT><BR>Class emit</H2><PRE>java.lang.Object <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>weka.core.parser.java_cup.emit</B></PRE><HR><DL><DT><PRE>public class <B>emit</B><DT>extends java.lang.Object</DL></PRE><P>This class handles emitting generated code for the resulting parser. The various parse tables must be constructed, etc. before calling any routines in this class.<p> Three classes are produced by this code: <dl> <dt> symbol constant class <dd> this contains constant declarations for each terminal (and optionally each non-terminal). <dt> action class <dd> this non-public class contains code to invoke all the user actions that were embedded in the parser specification. <dt> parser class <dd> the specialized parser class consisting primarily of some user supplied general and initialization code, and the parse tables. </dl><p> Three parse tables are created as part of the parser class: <dl> <dt> production table <dd> lists the LHS non terminal number, and the length of the RHS of each production. <dt> action table <dd> for each state of the parse machine, gives the action to be taken (shift, reduce, or error) under each lookahead symbol.<br> <dt> reduce-goto table <dd> when a reduce on a given production is taken, the parse stack is popped back a number of elements corresponding to the RHS of the production. This reveals a prior state, which we transition out of under the LHS non terminal symbol for the production (as if we had seen the LHS symbol rather than all the symbols matching the RHS). This table is indexed by non terminal numbers and indicates how to make these transitions. </dl><p> In addition to the method interface, this class maintains a series of public global variables and flags indicating how misc. parts of the code and other output is to be produced, and counting things such as number of conflicts detected (see the source code and public variables below for more details).<p> This class is "static" (contains only static data and methods).<p><P><P><DL><DT><B>Version:</B></DT> <DD>last update: 11/25/95</DD><DT><B>Author:</B></DT> <DD>Scott Hudson</DD><DT><B>See Also:</B><DD><CODE>weka.core.parser.java_cup.main</CODE></DL><HR><P><!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>Field Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/core/parser/java_cup/emit.html#action_code">action_code</A></B></CODE><BR> User declarations for direct inclusion in user action class.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static long</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/core/parser/java_cup/emit.html#action_code_time">action_code_time</A></B></CODE><BR> Time to produce action code class.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static long</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/core/parser/java_cup/emit.html#action_table_time">action_table_time</A></B></CODE><BR> Time to produce the action table.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/core/parser/java_cup/emit.html#class_type_argument">class_type_argument</A></B></CODE><BR> TUM changes; proposed by Henning Niss 20050628: Type arguments for class declaration</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static long</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/core/parser/java_cup/emit.html#goto_table_time">goto_table_time</A></B></CODE><BR> Time to produce the reduce-goto table.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.util.Stack</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/core/parser/java_cup/emit.html#import_list">import_list</A></B></CODE><BR> List of imports (Strings containing class names) to go with actions.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/core/parser/java_cup/emit.html#init_code">init_code</A></B></CODE><BR> User code for user_init() which is called during parser initialization.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/core/parser/java_cup/emit.html#not_reduced">not_reduced</A></B></CODE><BR> Count of the number on non-reduced productions found.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/core/parser/java_cup/emit.html#nowarn">nowarn</A></B></CODE><BR> Do we skip warnings?</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/core/parser/java_cup/emit.html#num_conflicts">num_conflicts</A></B></CODE><BR> Number of conflict found while building tables.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/core/parser/java_cup/emit.html#package_name">package_name</A></B></CODE><BR> Package that the resulting code goes into (null is used for unnamed).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/core/parser/java_cup/emit.html#parser_class_name">parser_class_name</A></B></CODE><BR> Name of the generated parser class.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/core/parser/java_cup/emit.html#parser_code">parser_code</A></B></CODE><BR> User declarations for direct inclusion in parser class.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static long</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/core/parser/java_cup/emit.html#parser_time">parser_time</A></B></CODE><BR> Time to produce parser class.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/core/parser/java_cup/emit.html#prefix">prefix</A></B></CODE><BR> The prefix placed on names that pollute someone else's name space.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static long</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/core/parser/java_cup/emit.html#production_table_time">production_table_time</A></B></CODE><BR> Time to produce the production table.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/core/parser/java_cup/emit.html#scan_code">scan_code</A></B></CODE><BR> User code for scan() which is called to get the next Symbol.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../../../weka/core/parser/java_cup/production.html" title="class in weka.core.parser.java_cup">production</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/core/parser/java_cup/emit.html#start_production">start_production</A></B></CODE><BR> The start production of the grammar.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/core/parser/java_cup/emit.html#symbol_const_class_name">symbol_const_class_name</A></B></CODE><BR> Name of the generated class for symbol constants.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static long</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/core/parser/java_cup/emit.html#symbols_time">symbols_time</A></B></CODE><BR> Time to produce symbol constant class.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/core/parser/java_cup/emit.html#unused_non_term">unused_non_term</A></B></CODE><BR> Count of unused non terminals.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/core/parser/java_cup/emit.html#unused_term">unused_term</A></B></CODE><BR> Count of unused terminals.</TD></TR></TABLE> <!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>Method Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/core/parser/java_cup/emit.html#clear()">clear</A></B>()</CODE><BR> </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/core/parser/java_cup/emit.html#lr_values()">lr_values</A></B>()</CODE><BR> whether or not to emit code for left and right values</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/core/parser/java_cup/emit.html#parser(java.io.PrintWriter, weka.core.parser.java_cup.parse_action_table, weka.core.parser.java_cup.parse_reduce_table, int, weka.core.parser.java_cup.production, boolean, boolean)">parser</A></B>(java.io.PrintWriter out, <A HREF="../../../../weka/core/parser/java_cup/parse_action_table.html" title="class in weka.core.parser.java_cup">parse_action_table</A> action_table, <A HREF="../../../../weka/core/parser/java_cup/parse_reduce_table.html" title="class in weka.core.parser.java_cup">parse_reduce_table</A> reduce_table, int start_st, <A HREF="../../../../weka/core/parser/java_cup/production.html" title="class in weka.core.parser.java_cup">production</A> start_prod, boolean compact_reduces, boolean suppress_scanner)</CODE><BR> Emit the parser subclass with embedded tables.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/core/parser/java_cup/emit.html#symbols(java.io.PrintWriter, boolean, boolean)">symbols</A></B>(java.io.PrintWriter out, boolean emit_non_terms, boolean sym_interface)</CODE><BR> Emit code for the symbol constant class, optionally including non terms, if they have been requested.</TD></TR></TABLE> <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> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?