Class MetaAddressingMode
- java.lang.Object
-
- ru.ispras.microtesk.model.metadata.MetaAddressingMode
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
MetaAddressingMode(java.lang.String name, Type dataType, boolean label, boolean exception, boolean memoryReference, boolean load, boolean store, int blockSize)
MetaAddressingMode(java.lang.String name, Type dataType, java.util.Map<java.lang.String,MetaArgument> args, boolean label, boolean exception, boolean memoryReference, boolean load, boolean store, int blockSize)
Constructs a metadata object for an addressing mode.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addArgument(MetaArgument argument)
boolean
canThrowException()
Checks whether the addressing mode (its attributes) can throw an exception.MetaArgument
getArgument(java.lang.String name)
Return an argument of the given addressing mode that has the specified name.java.util.Collection<java.lang.String>
getArgumentNames()
Returns the list of addressing mode argument.java.util.Collection<MetaArgument>
getArguments()
Returns a collection of addressing mode arguments.int
getBlockSize()
Returns the size of block read or written to memory.Type
getDataType()
Returns the type of data accessed via the addressing mode.java.lang.String
getName()
Returns the name of the addressing mode.boolean
isArgumentDefined(java.lang.String name)
Checks whether the addressing mode has an argument with the specified name.boolean
isLabel()
Checks whether the addressing mode computes an immediate value from a label.boolean
isLoad()
Checks whether the addressing performs a memory load action in its attributes.boolean
isMemoryReference()
Checks whether the addressing mode provides refers to memory (provides an access to memory via its return expression).boolean
isStore()
Checks whether the addressing mode performs a memory store action.java.lang.String
toString()
-
-
-
Constructor Detail
-
MetaAddressingMode
public MetaAddressingMode(java.lang.String name, Type dataType, java.util.Map<java.lang.String,MetaArgument> args, boolean label, boolean exception, boolean memoryReference, boolean load, boolean store, int blockSize)
Constructs a metadata object for an addressing mode.- Parameters:
name
- Addressing mode name.dataType
- the type of data accessed via the addressing mode.args
- Table of addressing mode arguments.label
-true
if the addressing mode computes an immediate value from a label orfalse
otherwise.exception
-true
if the addressing mode can throw an exception orfalse
otherwise.memoryReference
-true
if the addressing mode provides access to memory orfalse
otherwise.load
-true
if the addressing mode performs a memory load action orfalse
otherwise.store
-true
if the addressing mode performs a memory store action orfalse
otherwise.blockSize
- Size of loaded/stored memory block in bits.- Throws:
java.lang.IllegalArgumentException
- if any of the parameters isnull
.
-
MetaAddressingMode
protected MetaAddressingMode(java.lang.String name, Type dataType, boolean label, boolean exception, boolean memoryReference, boolean load, boolean store, int blockSize)
-
-
Method Detail
-
addArgument
protected final void addArgument(MetaArgument argument)
-
getName
public final java.lang.String getName()
Returns the name of the addressing mode.
-
getDataType
public final Type getDataType()
Returns the type of data accessed via the addressing mode.- Specified by:
getDataType
in interfaceMetaData
- Returns:
- Data type.
-
getArguments
public final java.util.Collection<MetaArgument> getArguments()
Returns a collection of addressing mode arguments.- Returns:
- Collection of addressing mode arguments.
-
getArgument
public final MetaArgument getArgument(java.lang.String name)
Return an argument of the given addressing mode that has the specified name.- Parameters:
name
- Argument name.- Returns:
- Argument with the specified name or
null
if no such argument is defined.
-
getArgumentNames
public final java.util.Collection<java.lang.String> getArgumentNames()
Returns the list of addressing mode argument.- Returns:
- Collection of argument names.
-
isArgumentDefined
public final boolean isArgumentDefined(java.lang.String name)
Checks whether the addressing mode has an argument with the specified name.- Parameters:
name
- Argument name.- Returns:
true
if the argument is defined offalse
otherwise.
-
isLabel
public final boolean isLabel()
Checks whether the addressing mode computes an immediate value from a label.- Returns:
true
if the addressing mode computes an immediate value from a label orfalse
otherwise.
-
canThrowException
public final boolean canThrowException()
Checks whether the addressing mode (its attributes) can throw an exception.- Returns:
true
if the addressing mode can throw an exception orfalse
otherwise.
-
isMemoryReference
public final boolean isMemoryReference()
Checks whether the addressing mode provides refers to memory (provides an access to memory via its return expression).- Returns:
true
if the addressing mode provides an reference to memory orfalse
otherwise.
-
isLoad
public final boolean isLoad()
Checks whether the addressing performs a memory load action in its attributes. This does not apply to the return expression, for which theisMemoryReference
must be used.- Returns:
true
if the addressing mode performs a memory load action orfalse
otherwise.
-
isStore
public final boolean isStore()
Checks whether the addressing mode performs a memory store action. This does not apply to the return expression, for which theisMemoryReference
must be used.- Returns:
true
if the addressing mode performs a memory store action orfalse
otherwise.
-
getBlockSize
public final int getBlockSize()
Returns the size of block read or written to memory. Applicable for load or store operations.- Returns:
- Size of memory block in bits.
-
toString
public final java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-