Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## mars.assembler
Class SourceLine

    java.lang.Object
      mars.assembler.SourceLine

    public class SourceLine

extends 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(String source, MIPSprogram mipsProgram, int lineNumber)` SourceLine constructor

Method Summary
`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
`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(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 String getSource()

  Retrieve source statement itself

  Returns:
    Source statement as String

### getFilename

    public 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

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD