<!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_01) on Mon Apr 23 21:09:02 GMT 2007 -->
<TITLE>
symbol
</TITLE>
<META NAME="keywords" CONTENT="java_cup.symbol class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="symbol";
}
</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="class-use/symbol.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </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-files/index-1.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>
</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="../java_cup/sym.html" title="class in java_cup"><B>PREV CLASS</B></A>
<A HREF="../java_cup/symbol_part.html" title="class in java_cup"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../index.html?java_cup/symbol.html" target="_top"><B>FRAMES</B></A>
<A HREF="symbol.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_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
java_cup</FONT>
<BR>
Class symbol</H2>
<PRE>
java.lang.Object
<IMG SRC="../resources/inherit.gif" ALT="extended by "><B>java_cup.symbol</B>
</PRE>
<DL>
<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../java_cup/non_terminal.html" title="class in java_cup">non_terminal</A>, <A HREF="../java_cup/terminal.html" title="class in java_cup">terminal</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public abstract class <B>symbol</B><DT>extends java.lang.Object</DL>
</PRE>
<P>
This abstract class serves as the base class for grammar symbols (i.e.,
both terminals and non-terminals). Each symbol has a name string, and
a string giving the type of object that the symbol will be represented by
on the runtime parse stack. In addition, each symbol maintains a use count
in order to detect symbols that are declared but never used, and an index
number that indicates where it appears in parse tables (index numbers are
unique within terminals or non terminals, but not across both).
<P>
<P>
<DL>
<DT><B>Version:</B></DT>
<DD>last updated: 7/3/96</DD>
<DT><B>Author:</B></DT>
<DD>Frank Flannery</DD>
<DT><B>See Also:</B><DD><A HREF="../java_cup/terminal.html" title="class in java_cup"><CODE>terminal</CODE></A>,
<A HREF="../java_cup/non_terminal.html" title="class in java_cup"><CODE>non_terminal</CODE></A></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>protected int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../java_cup/symbol.html#_index">_index</A></B></CODE>
<BR>
Index of this symbol (terminal or non terminal) in the parse tables.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../java_cup/symbol.html#_name">_name</A></B></CODE>
<BR>
String for the human readable name of the symbol.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../java_cup/symbol.html#_stack_type">_stack_type</A></B></CODE>
<BR>
String for the type of object used for the symbol on the parse stack.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../java_cup/symbol.html#_use_count">_use_count</A></B></CODE>
<BR>
Count of how many times the symbol appears in productions.</TD>
</TR>
</TABLE>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_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>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../java_cup/symbol.html#symbol(java.lang.String)">symbol</A></B>(java.lang.String nm)</CODE>
<BR>
Constructor with default type.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../java_cup/symbol.html#symbol(java.lang.String, java.lang.String)">symbol</A></B>(java.lang.String nm,
java.lang.String tp)</CODE>
<BR>
Full constructor.</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> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../java_cup/symbol.html#index()">index</A></B>()</CODE>
<BR>
Index of this symbol (terminal or non terminal) in the parse tables.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../java_cup/symbol.html#is_non_term()">is_non_term</A></B>()</CODE>
<BR>
Indicate if this is a non-terminal.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../java_cup/symbol.html#name()">name</A></B>()</CODE>
<BR>
String for the human readable name of the symbol.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../java_cup/symbol.html#note_use()">note_use</A></B>()</CODE>
<BR>
Increment the use count.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../java_cup/symbol.html#stack_type()">stack_type</A></B>()</CODE>
<BR>
String for the type of object used for the symbol on the parse stack.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../java_cup/symbol.html#toString()">toString</A></B>()</CODE>
<BR>
Convert to a string.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../java_cup/symbol.html#use_count()">use_count</A></B>()</CODE>
<BR>
Count of how many times the symbol appears in productions.</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>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<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="_name"><!-- --></A><H3>
_name</H3>
<PRE>
protected java.lang.String <B>_name</B></PRE>
<DL>
<DD>String for the human readable name of the symbol.
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="_stack_type"><!-- --></A><H3>
_stack_type</H3>
<PRE>
protected java.lang.String <B>_stack_type</B></PRE>
<DL>
<DD>String for the type of object used for the symbol on the parse stack.
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="_use_count"><!-- --></A><H3>
_use_count</H3>
<PRE>
protected int <B>_use_count</B></PRE>
<DL>
<DD>Count of how many times the symbol appears in productions.
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="_index"><!-- --></A><H3>
_index</H3>
<PRE>
protected int <B>_index</B></PRE>
<DL>
<DD>Index of this symbol (terminal or non terminal) in the parse tables.
Note: indexes are unique among terminals and unique among non terminals,
however, a terminal may have the same index as a non-terminal, etc.
<P>
<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="symbol(java.lang.String, java.lang.String)"><!-- --></A><H3>
symbol</H3>
<PRE>
public <B>symbol</B>(java.lang.String nm,
java.lang.String tp)</PRE>
<DL>
<DD>Full constructor.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>nm</CODE> - the name of the symbol.<DD><CODE>tp</CODE> - a string with the type name.</DL>
</DL>
<HR>
<A NAME="symbol(java.lang.String)"><!-- --></A><H3>
symbol</H3>
<PRE>
public <B>symbol</B>(java.lang.String nm)</PRE>
<DL>
<DD>Constructor with default type.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>nm</CODE> - the name of the symbol.</DL>
</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="name()"><!-- --></A><H3>
name</H3>
<PRE>
public java.lang.String <B>name</B>()</PRE>
<DL>
<DD>String for the human readable name of the symbol.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="stack_type()"><!-- --></A><H3>
stack_type</H3>
<PRE>
public java.lang.String <B>stack_type</B>()</PRE>
<DL>
<DD>String for the type of object used for the symbol on the parse stack.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="use_count()"><!-- --></A><H3>
use_count</H3>
<PRE>
public int <B>use_count</B>()</PRE>
<DL>
<DD>Count of how many times the symbol appears in productions.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="note_use()"><!-- --></A><H3>
note_use</H3>
<PRE>
public void <B>note_use</B>()</PRE>
<DL>
<DD>Increment the use count.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="index()"><!-- --></A><H3>
index</H3>
<PRE>
public int <B>index</B>()</PRE>
<DL>
<DD>Index of this symbol (terminal or non terminal) in the parse tables.
Note: indexes are unique among terminals and unique among non terminals,
however, a terminal may have the same index as a non-terminal, etc.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="is_non_term()"><!-- --></A><H3>
is_non_term</H3>
<PRE>
public abstract boolean <B>is_non_term</B>()</PRE>
<DL>
<DD>Indicate if this is a non-terminal. Here in the base class we
don't know, so this is abstract.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="toString()"><!-- --></A><H3>
toString</H3>
<PRE>
public java.lang.String <B>toString</B>()</PRE>
<DL>
<DD>Convert to a string.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE></DL>
</DD>
<DD><DL>
</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="class-use/symbol.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </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-files/index-1.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>
</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="../java_cup/sym.html" title="class in java_cup"><B>PREV CLASS</B></A>
<A HREF="../java_cup/symbol_part.html" title="class in java_cup"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../index.html?java_cup/symbol.html" target="_top"><B>FRAMES</B></A>
<A HREF="symbol.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>