public abstract class IsaPrimitive
extends java.lang.Object
IsaPrimitive
class implements base functionality of addressing modes
and operations.Constructor and Description |
---|
IsaPrimitive()
Constructs a primitive.
|
IsaPrimitive(java.util.Map<java.lang.String,IsaPrimitive> arguments)
Constructs a primitive and saves the table of its arguments.
|
Modifier and Type | Method and Description |
---|---|
Location |
access(ProcessingElement processingElement,
TemporaryVariables temporaryVariables)
Returns the location the primitive object points to (when initialized with specific
parameters).
|
protected void |
action(ProcessingElement processingElement,
TemporaryVariables temporaryVariables)
Runs the action associated with the primitive.
|
protected void |
addArgument(java.lang.String name,
IsaPrimitive value)
Registers an argument in the argument table.
|
protected Location |
annotate(Location location,
TemporaryVariables tempVars) |
void |
execute(ProcessingElement processingElement,
TemporaryVariables temporaryVariables)
Runs execution of the current primitive's action.
|
java.util.Map<java.lang.String,IsaPrimitive> |
getArguments()
Returns the primitive argument table.
|
static java.lang.String |
getCurrentOperation()
Returns the name of the currently executed primitive or an empty
string if no primitive is being executed.
|
java.lang.String |
getName()
Returns the primitive name.
|
java.lang.String |
image(TemporaryVariables temporaryVariables)
Returns binary representation of the specified primitive.
|
void |
init(TemporaryVariables tempVars)
Perform initialization of temporary variables that can be used in other attributes
(action, syntax, image).
|
java.lang.String |
syntax(TemporaryVariables temporaryVariables)
Returns assembly format of the specified primitive.
|
public IsaPrimitive(java.util.Map<java.lang.String,IsaPrimitive> arguments)
arguments
- Primitive arguments.java.lang.IllegalArgumentException
- if the parameter is null
.public IsaPrimitive()
public static java.lang.String getCurrentOperation()
public final java.lang.String getName()
public final java.util.Map<java.lang.String,IsaPrimitive> getArguments()
protected final void addArgument(java.lang.String name, IsaPrimitive value)
name
- Argument name.value
- Argument.java.lang.IllegalArgumentException
- if any of the parameters is null
.public void init(TemporaryVariables tempVars)
public java.lang.String syntax(TemporaryVariables temporaryVariables)
Default implementation is provided to allow using primitives that have no explicitly specified syntax attribute. This method does not do any useful work and should never be called. It is needed only to let inherited classes compile.
public java.lang.String image(TemporaryVariables temporaryVariables)
Default implementation is provided to allow using primitives that have no explicitly specified image attribute. This method does not do any useful work and should never be called. It is needed only to let inherited classes compile.
public final void execute(ProcessingElement processingElement, TemporaryVariables temporaryVariables)
protected void action(ProcessingElement processingElement, TemporaryVariables temporaryVariables)
Default implementation is provided to allow using primitives that have no explicitly specified action attribute. This method does not do any useful work and should never be called. It is needed only to let inherited classes compile.
public Location access(ProcessingElement processingElement, TemporaryVariables temporaryVariables)
Default implementation is provided to allow using primitives that do not have a return expression. This method does not do any useful work and should never be called. It is needed only to let inherited classes compile.
protected final Location annotate(Location location, TemporaryVariables tempVars)