Class Directive
- java.lang.Object
-
- ru.ispras.microtesk.test.template.directive.Directive
-
- Direct Known Subclasses:
DirectiveAlign
,DirectiveDataConst
,DirectiveDataValue
,DirectiveLabel
,DirectiveOption
,DirectiveOrigin
,DirectiveOriginRelative
,DirectiveSpace
,DirectiveString
,DirectiveText
public abstract class Directive extends java.lang.Object
Directive
represents an assembly directive.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Directive.Kind
Directive kind.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.math.BigInteger
apply(java.math.BigInteger currentAddress, MemoryAllocator allocator)
Applies the directive to the current address and the memory allocator.Directive
copy()
Copies the directive.static java.util.List<Directive>
copyAll(java.util.List<Directive> directives)
abstract Directive.Kind
getKind()
Returns the directive kind.abstract java.lang.String
getText()
Returns the string representation of the directive.boolean
needsIndent()
Checks whether an indentation is required when printing the directive.java.lang.String
toString()
-
-
-
Field Detail
-
options
protected final Options options
-
-
Method Detail
-
getKind
public abstract Directive.Kind getKind()
Returns the directive kind.- Returns:
- the directive kind.
-
getText
public abstract java.lang.String getText()
Returns the string representation of the directive.- Returns:
- the directive text.
-
needsIndent
public boolean needsIndent()
Checks whether an indentation is required when printing the directive.- Returns:
true
iff an indentation is required.
-
apply
public java.math.BigInteger apply(java.math.BigInteger currentAddress, MemoryAllocator allocator)
Applies the directive to the current address and the memory allocator.- Parameters:
currentAddress
- the current address.allocator
- the memory allocator.- Returns:
- the current address.
-
copy
public Directive copy()
Copies the directive.- Returns:
- a copy of the directive.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-