miSim

misim.asm
Class MacroDefinition

java.lang.Object
  |
  +--misim.asm.MacroDefinition
All Implemented Interfaces:
LineIterator

public class MacroDefinition
extends java.lang.Object
implements LineIterator


Field Summary
static int MACRO_ITERATOR
          The type of this line iterator
 
Constructor Summary
MacroDefinition(java.util.Vector parameters, java.util.Vector macroLines)
           
 
Method Summary
 int getLineIndex()
          Return the current line index being read in this file
 Line getNextLine()
          Return the next line, and advance the index to the next line in the file.
 int getType()
          Return the type of this iterator, as an integer.
 void insertLine(Line aLine)
          Insert a new line at the current line index.
 MacroDefinition parseMacro(AsmLine aLine, Context context)
          Parse a reference to this macro, reading the parameters into the paramList.
 void resetLineIndex()
          Reset the current line index to the beginning of the source
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MACRO_ITERATOR

public static final int MACRO_ITERATOR
The type of this line iterator
Constructor Detail

MacroDefinition

public MacroDefinition(java.util.Vector parameters,
                       java.util.Vector macroLines)
Method Detail

parseMacro

public MacroDefinition parseMacro(AsmLine aLine,
                                  Context context)
                           throws EditorException
Parse a reference to this macro, reading the parameters into the paramList. If parsing completes sucessfully, the macroDefinition can then act as a line iterator, returning the lines of the expanded macro. If the expanded macro requires a new Context (ie. it contains local labels) it is returned by this method.

resetLineIndex

public void resetLineIndex()
Reset the current line index to the beginning of the source
Specified by:
resetLineIndex in interface LineIterator

getNextLine

public Line getNextLine()
Return the next line, and advance the index to the next line in the file.
Specified by:
getNextLine in interface LineIterator
Returns:
The next line in the file, or null if there are no more

getLineIndex

public int getLineIndex()
Return the current line index being read in this file
Specified by:
getLineIndex in interface LineIterator
Returns:
The current line index

insertLine

public void insertLine(Line aLine)
                throws EditorException
Insert a new line at the current line index. Note that the next call to getNextLine will return the line just inserted.
Specified by:
insertLine in interface LineIterator
Parameters:
aLine - The line to insert

getType

public int getType()
Return the type of this iterator, as an integer.
Specified by:
getType in interface LineIterator
Returns:
This iterator type

miSim