|
miSim | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--misim.editor.Line | +--misim.asm.AsmLine
The AsmLine class extends the editor line class to store and retrieve information generated during assembly of files.
Field Summary | |
static int |
ASM_ITERATOR
|
Fields inherited from class misim.editor.Line |
tokenIndex, tokens |
Constructor Summary | |
AsmLine()
|
|
AsmLine(java.util.Vector tokens)
|
Method Summary | |
void |
addChildLine(Line childLine)
Add the given line as a child of this. |
void |
addData(int value)
Add a word of data to this line. |
void |
addError(EditorException editorException)
Add an error to this line, that can be displayed by the editor |
EditorException |
addError(Token aToken,
int errNo)
Add an error to this line, that can be displayed by the editor |
void |
addInstruction(Instruction instruction)
Add an instruction to this line |
void |
addWarning(Token aToken,
int errNo)
Add an warning to this line, that can be displayed by the editor |
int |
dataSize()
Return the number of words of data on this line |
void |
draw(java.awt.Graphics g,
int x,
int y,
int lineHeight,
int lineWidth,
int leftMargin,
boolean showErrors)
Draw this line |
int |
getAddress()
Get the address for the data or instructions that occur on this line |
Token |
getAssignment()
If this line assigns a new value to a label, return the token for the label, otherwise return null. |
int |
getAssignmentValue()
Returns the value assigned to a label on this line (if any) |
boolean |
getBreakpoint()
Indicate if this line has a breakpoint set |
int |
getData(int index)
Return the specified data word generated on this line |
Instruction |
getInstruction(int index)
Return the given instruction defined on this line |
Token |
getLastToken()
Return the last token before this one, or null if at the start of the line. |
int |
getLineIndex()
Return the current line index being read in this file |
int |
getLineNumber()
|
boolean |
getList()
Return the list flag for this line |
Line |
getNextLine()
Return the next line, and advance the index to the next line in the file. |
Token |
getNextToken()
Return this token, and advance the pointer to the next token. |
boolean |
getSkip()
Return the skip flag for this line. |
Line |
getSourceLine()
|
int |
getType()
Return the type of this iterator |
boolean |
hasChildren()
Indicate whether this line contains child lines |
void |
insertLine(Line aLine)
Insert a new line at the current line index. |
int |
instructionCount()
Return the number of instructions defined by this line |
Context |
newContext()
If there is a new context assigned to this line, return it, otherwise return null. |
void |
previousToken()
move to the previous token. |
void |
resetLineIndex()
Reset the current line index to the beginning of the source |
void |
setAddress(int address)
Set the address for the data or instructions that occur on this line |
void |
setAssignment(Token labelToken,
int newValue)
Set an assignment for this line. |
void |
setBreakpoint(boolean breakpoint)
Set whether this line has a breakpoint or not |
void |
setContext(Context context)
Set a new context for this and subsequent lines |
void |
setLineNumber(int lineNumber)
|
void |
setList(boolean list)
Set the list flag for this line. |
void |
setPreprocessed(java.util.Vector preprocessed)
Setting a preprocessed vector of tokens replaces this line's token iterator list with the new preprocessed version. |
void |
setSkip(boolean skip)
Set the skip flag for this line. |
void |
setSourceLine(Line sourceLine)
|
Methods inherited from class misim.editor.Line |
clearErrors, countTokens, delete, errorCount, getColumn, getError, getLength, getPixelPos, getToken, getTokenVector, getValue, getWarning, getWidth, insert, insert, redo, resetTokenIndex, undo, warningCount |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ASM_ITERATOR
Constructor Detail |
public AsmLine()
public AsmLine(java.util.Vector tokens)
Method Detail |
public void draw(java.awt.Graphics g, int x, int y, int lineHeight, int lineWidth, int leftMargin, boolean showErrors)
draw
in class Line
g
- The graphics context to draw tox
- The x co-ordinate of the liney
- The y co-ordinate of the linelineHeight
- The height of a displayed linelineWidth
- The width of a displayed lineleftMargin
- The left margin for the lineshowErrors
- If true, indicate errors for this linepublic void setContext(Context context)
context
- The new context to usepublic Context newContext()
public void setAssignment(Token labelToken, int newValue) throws EditorException
labelToken
- The token for the label that is being assignedint
- The value of the labelpublic Token getAssignment()
public int getAssignmentValue()
public void addChildLine(Line childLine)
childLine
- The line to add as a child of thispublic boolean hasChildren()
public void resetLineIndex()
resetLineIndex
in interface LineIterator
public Line getNextLine()
getNextLine
in interface LineIterator
public int getLineIndex()
getLineIndex
in interface LineIterator
public void insertLine(Line aLine)
insertLine
in interface LineIterator
aLine
- The line to insertpublic int getType()
getType
in interface LineIterator
public void setSourceLine(Line sourceLine)
public Line getSourceLine()
public void setLineNumber(int lineNumber)
public int getLineNumber()
public void setAddress(int address)
address
- The address for this linepublic int getAddress()
public void addInstruction(Instruction instruction)
instruction
- The instruction to addpublic int instructionCount()
public Instruction getInstruction(int index)
index
- The index of the required instructionpublic int dataSize()
public int getData(int index)
index
- The index of the required wordpublic void addData(int value)
value
- The value of the data to addpublic void setBreakpoint(boolean breakpoint)
break
- If true, then thisline has a breakpointpublic boolean getBreakpoint()
public void setList(boolean list)
list
- True if this line should be listedpublic boolean getList()
public void setSkip(boolean skip)
skip
- True if the assembler should skip this linepublic boolean getSkip()
setSkip( boolean skip )
public EditorException addError(Token aToken, int errNo)
addError
in class Line
aToken
- The token that caused the error, or nullerrNo
- The message error identifierpublic void addError(EditorException editorException)
addError
in class Line
editorException
- The exception that caused the errorerrNo
- The message error identifierpublic void addWarning(Token aToken, int errNo)
addWarning
in class Line
aToken
- The token that caused the error, or nullerrNo
- The message error identifierpublic void setPreprocessed(java.util.Vector preprocessed)
public Token getNextToken()
getNextToken
in class Line
public Token getLastToken()
getLastToken
in class Line
public void previousToken() throws EditorException
previousToken
in class Line
|
miSim | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |