public abstract class Primitive
extends java.lang.Object
Primitive
class implements base functionality of addressing modes
and operations.Modifier and Type | Class and Description |
---|---|
static interface |
Primitive.Factory<T extends Primitive>
The
Primitive.Factory interface is a base interface for factories
that create instances addressing modes and operations and initialize them
with the provided arguments. |
Constructor and Description |
---|
Primitive() |
Modifier and Type | Method and Description |
---|---|
Location |
access()
Returns the location the primitive object points to (when initialized with specific
parameters).
|
protected void |
action()
Runs the action associated with the primitive.
|
void |
execute()
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()
Returns binary representation of the specified primitive.
|
java.lang.String |
syntax()
Returns assembly format of the specified primitive.
|
public static java.lang.String getCurrentOperation()
public final java.lang.String getName()
public java.lang.String syntax()
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()
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()
protected void action()
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()
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.