|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmars.assembler.Macro
public class Macro
Stores information of a macro definition.
Constructor Summary | |
---|---|
Macro()
|
Method Summary | |
---|---|
void |
addArg(String value)
|
void |
addLabel(String value)
|
boolean |
equals(Object obj)
|
ArrayList<String> |
getArgs()
|
int |
getFromLine()
|
String |
getName()
|
int |
getOriginalFromLine()
|
int |
getOriginalToLine()
|
MIPSprogram |
getProgram()
|
String |
getSubstitutedLine(int line,
TokenList args,
long counter,
ErrorList errors)
Substitutes macro arguments in a line of source code inside macro definition to be parsed after macro expansion. |
int |
getToLine()
|
void |
readyForCommit()
Operations to be done on this macro before it is committed in macro pool. |
void |
setArgs(ArrayList<String> args)
|
void |
setFromLine(int fromLine)
|
void |
setName(String name)
|
void |
setOriginalFromLine(int origFromLine)
|
void |
setOriginalToLine(int origToLine)
|
void |
setProgram(MIPSprogram program)
|
void |
setToLine(int toLine)
|
static boolean |
tokenIsMacroParameter(String tokenValue,
boolean acceptSpimStyleParameters)
returns whether tokenValue is macro parameter or not |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Macro()
Method Detail |
---|
public String getName()
public void setName(String name)
public MIPSprogram getProgram()
public void setProgram(MIPSprogram program)
public int getFromLine()
public int getOriginalFromLine()
public void setFromLine(int fromLine)
public void setOriginalFromLine(int origFromLine)
public int getToLine()
public int getOriginalToLine()
public void setToLine(int toLine)
public void setOriginalToLine(int origToLine)
public ArrayList<String> getArgs()
public void setArgs(ArrayList<String> args)
public boolean equals(Object obj)
equals
in class Object
obj
- Macro
object to check if their name and count of
arguments are samepublic void addArg(String value)
public String getSubstitutedLine(int line, TokenList args, long counter, ErrorList errors)
counter
line
- source line number in macro definition to be substitutedargs
- counter
- unique macro expansion iderrors
-
line
-th line of source code, with substituted
argumentspublic static boolean tokenIsMacroParameter(String tokenValue, boolean acceptSpimStyleParameters)
tokenValue
is macro parameter or not
tokenValue
- acceptSpimStyleParameters
- accepts SPIM-style parameters which begin with '$' if true
public void addLabel(String value)
public void readyForCommit()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |