mars.assembler
Class SourceLine

java.lang.Object
  extended by mars.assembler.SourceLine

public class SourceLine
extends java.lang.Object

Handy class to represent, for a given line of source code, the code itself, the program containing it, and its line number within that program. This is used to separately keep track of the original file/position of a given line of code. When .include is used, it will migrate to a different line and possibly different program but the migration should not be visible to the user.


Constructor Summary
SourceLine(java.lang.String source, MIPSprogram mipsProgram, int lineNumber)
          SourceLine constructor
 
Method Summary
 java.lang.String getFilename()
          Retrieve name of file containing source statement
 int getLineNumber()
          Retrieve line number of source statement
 MIPSprogram getMIPSprogram()
          Retrieve MIPSprogram object containing source statement
 java.lang.String getSource()
          Retrieve source statement itself
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceLine

public SourceLine(java.lang.String source,
                  MIPSprogram mipsProgram,
                  int lineNumber)
SourceLine constructor

Parameters:
source - The source code itself
mipsProgram - The program (object representing source file) containing that line
lineNumber - The line number within that program where source appears.
Method Detail

getSource

public java.lang.String getSource()
Retrieve source statement itself

Returns:
Source statement as String

getFilename

public java.lang.String getFilename()
Retrieve name of file containing source statement

Returns:
File name as String

getLineNumber

public int getLineNumber()
Retrieve line number of source statement

Returns:
Line number of source statement

getMIPSprogram

public MIPSprogram getMIPSprogram()
Retrieve MIPSprogram object containing source statement

Returns:
program as MIPSprogram object