java.lang.Object
com.wyu4.snowberryjam.compiler.data.BodyStack
- All Implemented Interfaces:
ExecutableTask
The stack that stores Snowberry Jam instructions
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final AtomicBooleanprivate final SourceIdprivate static final org.slf4j.Loggerprivate final List<ExecutableTask> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTask(ExecutableTask element) Add an instruction into the stackGet a deep copy of the stackvoidexecute()Run the taskfeedback()Get some feedback from the task.voidflush()Flush the contents of the stackgetId()Get the ID of the taskstatic voidsetDebuggingEnabled(boolean state)
-
Field Details
-
logger
private static final org.slf4j.Logger logger -
DEBUGGING_ENABLED
-
id
-
stack
-
-
Constructor Details
-
BodyStack
Create a new Stack object- Parameters:
id- The ID of the stack (doesn't affect how the stack executes its tasks.)
-
-
Method Details
-
setDebuggingEnabled
public static void setDebuggingEnabled(boolean state) -
addTask
Add an instruction into the stack- Parameters:
element- Element containing an instruction
-
copyStack
Get a deep copy of the stack- Returns:
- An array of
ExecutableTask - See Also:
-
flush
public void flush()Flush the contents of the stack -
execute
public void execute()Description copied from interface:ExecutableTaskRun the task- Specified by:
executein interfaceExecutableTask
-
feedback
Description copied from interface:ExecutableTaskGet some feedback from the task. Can be anything, depending on the task.- Specified by:
feedbackin interfaceExecutableTask- Returns:
- Data parsed as
Object
-
getId
Description copied from interface:ExecutableTaskGet the ID of the task- Specified by:
getIdin interfaceExecutableTask- Returns:
- Corresponding
SourceId
-