Add thread management and stepping to runtime

This commit is contained in:
Tim Mickel 2016-04-26 16:50:49 -04:00
parent dbfb3356c6
commit 92dab97b84
5 changed files with 610 additions and 376 deletions
src/engine

View file

@ -1,9 +1,14 @@
function Thread () {
/**
* A thread is a running stack context and all the metadata needed.
* @param {?string} firstBlock First block to execute in the thread.
* @constructor
*/
function Thread (firstBlock) {
/**
* Next block that the thread will execute.
* @type {string}
*/
this.nextBlock = null;
this.nextBlock = firstBlock;
/**
* Stack for the thread. When the sequencer enters a control structure,
* the block is pushed onto the stack so we know where to exit.