Files
EMARS/docs/mars/assembler/Tokenizer.html
T
adolphenom 0da1c5dcca Source code of MARS Assembler
First commit of the 4.5 version (latest version available)
2014-12-21 12:49:28 +01:00

461 lines
24 KiB
HTML

<!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.6.0_33) on Tue Aug 20 12:20:54 EDT 2013 -->
<TITLE>
Tokenizer
</TITLE>
<META NAME="date" CONTENT="2013-08-20">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Tokenizer";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= 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>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../mars/assembler/Token.html" title="class in mars.assembler"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../mars/assembler/TokenList.html" title="class in mars.assembler"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html?mars/assembler/Tokenizer.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="Tokenizer.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<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">
mars.assembler</FONT>
<BR>
Class Tokenizer</H2>
<PRE>
<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
<IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>mars.assembler.Tokenizer</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>Tokenizer</B><DT>extends <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
</PRE>
<P>
A tokenizer is capable of tokenizing a complete MIPS program, or a given line from
a MIPS program. Since MIPS is line-oriented, each line defines a complete statement.
Tokenizing is the process of analyzing the input MIPS program for the purpose of
recognizing each MIPS language element. The types of language elements are known as "tokens".
MIPS tokens are defined in the TokenTypes class.<br><br>
Example: <br>
The MIPS statement <tt>here: lw $t3, 8($t4) #load third member of array</tt><br>
generates the following token list<br>
IDENTIFIER, COLON, OPERATOR, REGISTER_NAME, COMMA, INTEGER_5, LEFT_PAREN,
REGISTER_NAME, RIGHT_PAREN, COMMENT<br>
<P>
<P>
<DL>
<DT><B>Author:</B></DT>
<DD>Pete Sanderson</DD>
</DL>
<HR>
<P>
<!-- ======== 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="../../mars/assembler/Tokenizer.html#Tokenizer()">Tokenizer</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Simple constructor.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../mars/assembler/Tokenizer.html#Tokenizer(mars.MIPSprogram)">Tokenizer</A></B>(<A HREF="../../mars/MIPSprogram.html" title="class in mars">MIPSprogram</A>&nbsp;program)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructor for use with existing MIPSprogram.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== 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>&nbsp;<A HREF="../../mars/ErrorList.html" title="class in mars">ErrorList</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../mars/assembler/Tokenizer.html#getErrors()">getErrors</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fetch this Tokenizer's error list.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../mars/assembler/Tokenizer.html#tokenize(mars.MIPSprogram)">tokenize</A></B>(<A HREF="../../mars/MIPSprogram.html" title="class in mars">MIPSprogram</A>&nbsp;p)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Will tokenize a complete MIPS program.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../mars/assembler/TokenList.html" title="class in mars.assembler">TokenList</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../mars/assembler/Tokenizer.html#tokenizeExampleInstruction(java.lang.String)">tokenizeExampleInstruction</A></B>(<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;example)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Used only to create a token list for the example provided with each instruction
specification.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../mars/assembler/TokenList.html" title="class in mars.assembler">TokenList</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../mars/assembler/Tokenizer.html#tokenizeLine(int, java.lang.String)">tokenizeLine</A></B>(int&nbsp;lineNum,
<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;theLine)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Will tokenize one line of source code.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../mars/assembler/TokenList.html" title="class in mars.assembler">TokenList</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../mars/assembler/Tokenizer.html#tokenizeLine(int, java.lang.String, mars.ErrorList)">tokenizeLine</A></B>(int&nbsp;lineNum,
<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;theLine,
<A HREF="../../mars/ErrorList.html" title="class in mars">ErrorList</A>&nbsp;callerErrorList)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Will tokenize one line of source code.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../mars/assembler/TokenList.html" title="class in mars.assembler">TokenList</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../mars/assembler/Tokenizer.html#tokenizeLine(int, java.lang.String, mars.ErrorList, boolean)">tokenizeLine</A></B>(int&nbsp;lineNum,
<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;theLine,
<A HREF="../../mars/ErrorList.html" title="class in mars">ErrorList</A>&nbsp;callerErrorList,
boolean&nbsp;doEqvSubstitutes)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Will tokenize one line of source code.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../mars/assembler/TokenList.html" title="class in mars.assembler">TokenList</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../mars/assembler/Tokenizer.html#tokenizeLine(mars.MIPSprogram, int, java.lang.String, boolean)">tokenizeLine</A></B>(<A HREF="../../mars/MIPSprogram.html" title="class in mars">MIPSprogram</A>&nbsp;program,
int&nbsp;lineNum,
<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;theLine,
boolean&nbsp;doEqvSubstitutes)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Will tokenize one line of source code.</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.<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ========= 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="Tokenizer()"><!-- --></A><H3>
Tokenizer</H3>
<PRE>
public <B>Tokenizer</B>()</PRE>
<DL>
<DD>Simple constructor. Initializes empty error list.
<P>
</DL>
<HR>
<A NAME="Tokenizer(mars.MIPSprogram)"><!-- --></A><H3>
Tokenizer</H3>
<PRE>
public <B>Tokenizer</B>(<A HREF="../../mars/MIPSprogram.html" title="class in mars">MIPSprogram</A>&nbsp;program)</PRE>
<DL>
<DD>Constructor for use with existing MIPSprogram. Designed to be used with Macro feature.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>program</CODE> - A previously-existing MIPSprogram object or null if none.</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="tokenize(mars.MIPSprogram)"><!-- --></A><H3>
tokenize</H3>
<PRE>
public <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</A> <B>tokenize</B>(<A HREF="../../mars/MIPSprogram.html" title="class in mars">MIPSprogram</A>&nbsp;p)
throws <A HREF="../../mars/ProcessingException.html" title="class in mars">ProcessingException</A></PRE>
<DL>
<DD>Will tokenize a complete MIPS program. MIPS is line oriented (not free format),
so we will be line-oriented too.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>p</CODE> - The MIPSprogram to be tokenized.
<DT><B>Returns:</B><DD>An ArrayList representing the tokenized program. Each list member is a TokenList
that represents a tokenized source statement from the MIPS program.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../mars/ProcessingException.html" title="class in mars">ProcessingException</A></CODE></DL>
</DD>
</DL>
<HR>
<A NAME="tokenizeExampleInstruction(java.lang.String)"><!-- --></A><H3>
tokenizeExampleInstruction</H3>
<PRE>
public <A HREF="../../mars/assembler/TokenList.html" title="class in mars.assembler">TokenList</A> <B>tokenizeExampleInstruction</B>(<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;example)
throws <A HREF="../../mars/ProcessingException.html" title="class in mars">ProcessingException</A></PRE>
<DL>
<DD>Used only to create a token list for the example provided with each instruction
specification.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>example</CODE> - The example MIPS instruction to be tokenized.
<DT><B>Returns:</B><DD>An TokenList representing the tokenized instruction. Each list member is a Token
that represents one language element.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../mars/ProcessingException.html" title="class in mars">ProcessingException</A></CODE> - This occurs only if the instruction specification itself
contains one or more lexical (i.e. token) errors.</DL>
</DD>
</DL>
<HR>
<A NAME="tokenizeLine(int, java.lang.String)"><!-- --></A><H3>
tokenizeLine</H3>
<PRE>
public <A HREF="../../mars/assembler/TokenList.html" title="class in mars.assembler">TokenList</A> <B>tokenizeLine</B>(int&nbsp;lineNum,
<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;theLine)</PRE>
<DL>
<DD>Will tokenize one line of source code. If lexical errors are discovered,
they are noted in an ErrorMessage object which is added to the ErrorList.
Will NOT throw an exception yet because we want to persevere beyond first error.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>lineNum</CODE> - line number from source code (used in error message)<DD><CODE>theLine</CODE> - String containing source code
<DT><B>Returns:</B><DD>the generated token list for that line</DL>
</DD>
</DL>
<HR>
<A NAME="tokenizeLine(int, java.lang.String, mars.ErrorList)"><!-- --></A><H3>
tokenizeLine</H3>
<PRE>
public <A HREF="../../mars/assembler/TokenList.html" title="class in mars.assembler">TokenList</A> <B>tokenizeLine</B>(int&nbsp;lineNum,
<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;theLine,
<A HREF="../../mars/ErrorList.html" title="class in mars">ErrorList</A>&nbsp;callerErrorList)</PRE>
<DL>
<DD>Will tokenize one line of source code. If lexical errors are discovered,
they are noted in an ErrorMessage object which is added to the provided ErrorList
instead of the Tokenizer's error list. Will NOT throw an exception.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>lineNum</CODE> - line number from source code (used in error message)<DD><CODE>theLine</CODE> - String containing source code<DD><CODE>callerErrorList</CODE> - errors will go into this list instead of tokenizer's list.
<DT><B>Returns:</B><DD>the generated token list for that line</DL>
</DD>
</DL>
<HR>
<A NAME="tokenizeLine(int, java.lang.String, mars.ErrorList, boolean)"><!-- --></A><H3>
tokenizeLine</H3>
<PRE>
public <A HREF="../../mars/assembler/TokenList.html" title="class in mars.assembler">TokenList</A> <B>tokenizeLine</B>(int&nbsp;lineNum,
<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;theLine,
<A HREF="../../mars/ErrorList.html" title="class in mars">ErrorList</A>&nbsp;callerErrorList,
boolean&nbsp;doEqvSubstitutes)</PRE>
<DL>
<DD>Will tokenize one line of source code. If lexical errors are discovered,
they are noted in an ErrorMessage object which is added to the provided ErrorList
instead of the Tokenizer's error list. Will NOT throw an exception.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>lineNum</CODE> - line number from source code (used in error message)<DD><CODE>theLine</CODE> - String containing source code<DD><CODE>callerErrorList</CODE> - errors will go into this list instead of tokenizer's list.<DD><CODE>doEqvSubstitutse</CODE> - boolean param set true to perform .eqv substitutions, else false
<DT><B>Returns:</B><DD>the generated token list for that line</DL>
</DD>
</DL>
<HR>
<A NAME="tokenizeLine(mars.MIPSprogram, int, java.lang.String, boolean)"><!-- --></A><H3>
tokenizeLine</H3>
<PRE>
public <A HREF="../../mars/assembler/TokenList.html" title="class in mars.assembler">TokenList</A> <B>tokenizeLine</B>(<A HREF="../../mars/MIPSprogram.html" title="class in mars">MIPSprogram</A>&nbsp;program,
int&nbsp;lineNum,
<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;theLine,
boolean&nbsp;doEqvSubstitutes)</PRE>
<DL>
<DD>Will tokenize one line of source code. If lexical errors are discovered,
they are noted in an ErrorMessage object which is added to the provided ErrorList
instead of the Tokenizer's error list. Will NOT throw an exception.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>program</CODE> - MIPSprogram containing this line of source<DD><CODE>lineNum</CODE> - line number from source code (used in error message)<DD><CODE>theLine</CODE> - String containing source code<DD><CODE>doEqvSubstitutes</CODE> - boolean param set true to perform .eqv substitutions, else false
<DT><B>Returns:</B><DD>the generated token list for that line</DL>
</DD>
</DL>
<HR>
<A NAME="getErrors()"><!-- --></A><H3>
getErrors</H3>
<PRE>
public <A HREF="../../mars/ErrorList.html" title="class in mars">ErrorList</A> <B>getErrors</B>()</PRE>
<DL>
<DD>Fetch this Tokenizer's error list.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the error list</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>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../mars/assembler/Token.html" title="class in mars.assembler"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../mars/assembler/TokenList.html" title="class in mars.assembler"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html?mars/assembler/Tokenizer.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="Tokenizer.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>