Class GeneratorState
- java.lang.Object
-
- io.github.applecommander.bastools.api.code.GeneratorState
-
public class GeneratorState extends java.lang.ObjectTrack current state of the code generation. This class proxies a number of objects and can be extended for those objects as required.
-
-
Constructor Summary
Constructors Constructor Description GeneratorState(int startAddress)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcurrentAddress()This is the current address as defined by the start address + number of bytes generated.booleanhasMarkMoved()Indicates if a CodeMark has moved.java.io.ByteArrayOutputStreamoutputStream()Grab theByteArrayOutputStream.voidreset()Clear current state for another pass.voidupdate(CodeMark mark)Hook for the CodeMark to be updated and to capture if a change occurred.voidwrite(byte[] b)Write entire byte array to the output stream.voidwrite(int b)Write a byte to the output stream.
-
-
-
Method Detail
-
reset
public void reset()
Clear current state for another pass. Used while the generation is "settling down".
-
hasMarkMoved
public boolean hasMarkMoved()
Indicates if a CodeMark has moved.
-
update
public void update(CodeMark mark)
Hook for the CodeMark to be updated and to capture if a change occurred.
-
outputStream
public java.io.ByteArrayOutputStream outputStream()
Grab theByteArrayOutputStream. Only valid once generation is complete.
-
currentAddress
public int currentAddress()
This is the current address as defined by the start address + number of bytes generated.
-
write
public void write(int b)
Write a byte to the output stream.
-
write
public void write(byte[] b) throws java.io.IOExceptionWrite entire byte array to the output stream.- Throws:
java.io.IOException
-
-