public abstract class Primitive
extends java.lang.Object
Primitive
class implements base functionality of addressing modes
and operations.Constructor and Description |
---|
Primitive() |
Modifier and Type | Method and Description |
---|---|
Location |
access(PEState peState)
Returns the location the primitive object points to (when initialized with specific
parameters).
|
protected void |
action(PEState peState)
Runs the action associated with the primitive.
|
void |
execute(PEState peState)
Runs execution of the current primitive's action.
|
protected static Primitive |
getArgument(java.lang.String name,
java.util.Map<java.lang.String,Primitive> args)
Extracts an argument from a 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(PEState peState)
Returns binary representation of the specified primitive.
|
java.lang.String |
syntax(PEState peState)
Returns assembly format of the specified primitive.
|
public static java.lang.String getCurrentOperation()
public final java.lang.String getName()
public java.lang.String syntax(PEState peState)
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(PEState peState)
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(PEState peState)
protected void action(PEState peState)
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(PEState peState)
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 static Primitive getArgument(java.lang.String name, java.util.Map<java.lang.String,Primitive> args)
name
- Argument name.args
- Table of arguments.java.lang.IllegalArgumentException
- if there is no such argument in the table.