public class BFScript
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
BFScript.MemoryChunk
Memory Chunks cannot be split.
|
Constructor and Description |
---|
BFScript(int size,
java.io.InputStream is)
Create a BFScript
|
Modifier and Type | Method and Description |
---|---|
BFScript.MemoryChunk |
allocateMemory(java.lang.String name,
int size)
Allocate Memory in BFVM?
|
void |
deallocateMemory(BFScript.MemoryChunk c)
Slower version of
deallocateMemory(String) |
void |
deallocateMemory(java.lang.String s)
Retrieve and dispose the MemoryChunk using this key.
|
void |
end()
End the program.
|
java.lang.String |
getBF()
Get the BF representation of this program
|
BFScript.MemoryChunk |
getDifference(BFScript.MemoryChunk a,
BFScript.MemoryChunk b)
Returns chunk with value
|
void |
ifAGTBdoThis(BFScript.MemoryChunk aLocation,
BFScript.MemoryChunk bLocation,
FutureCommands cmds)
Deprecated.
|
void |
ifTrueDoThis(int ifLocation,
BFCommand[] cmds)
Deprecated.
|
void |
print(BFScript.MemoryChunk... c)
Print out numerous chunks.
|
void |
print(BFScript.MemoryChunk c)
Print out the values wrapped by the chunk.
|
void |
printDebug()
Print the current memory state and pointer position
|
void |
setSilentMode(boolean b)
Set silent mode.
|
void |
toggleSilent()
Toggle silent mode
|
public BFScript(int size, java.io.InputStream is)
size
- Memory size in bytesis
- InputStream used to read.public void printDebug()
public void end()
public void setSilentMode(boolean b)
b
- True or Falsepublic void toggleSilent()
public BFScript.MemoryChunk allocateMemory(java.lang.String name, int size)
size
- Memory Allocation Sizename
- Name of key for this chunkBFScript.MemoryChunk
public void deallocateMemory(BFScript.MemoryChunk c)
deallocateMemory(String)
c
- Chunk to deallocateBFScript.MemoryChunk
public void deallocateMemory(java.lang.String s)
s
- The keyBFScript.MemoryChunk
public void print(BFScript.MemoryChunk c)
c
- The chunk to print outpublic void print(BFScript.MemoryChunk... c)
c
- Chunks to printprint(MemoryChunk)
@Deprecated public void ifTrueDoThis(int ifLocation, BFCommand[] cmds)
ifLocation
- Pointer location in the event the statement is truecmds
- The commands to runpublic BFScript.MemoryChunk getDifference(BFScript.MemoryChunk a, BFScript.MemoryChunk b)
a
- Chunk ab
- Chunk b@Deprecated public void ifAGTBdoThis(BFScript.MemoryChunk aLocation, BFScript.MemoryChunk bLocation, FutureCommands cmds)
aLocation
- a value (using 0 value)bLocation
- b value (using 0 value);cmds
- commands to or to not executepublic java.lang.String getBF()