psengines
Class ExecutionEngine

java.lang.Object
  extended bypsengines.ExecutionEngine

public class ExecutionEngine
extends java.lang.Object

It describes the Execution Engine component of PS-View.

Execution engine is responsible for taking a PSObject and depending on what it is it puts in the the stack or it execute it(if it is command).


Constructor Summary
ExecutionEngine(PSPath gStack)
          Creates an instance of the Execution Engine.
 
Method Summary
static void decLoopsCnt()
          Decreases the loopsCnt field.
static void destroyLastArray()
          Erases the last record of the executable array being processed.
static PSObject execExecutableArray(PSExecArray execArray)
          Retrieves a PSobject from the executable array.
static boolean getExitNear()
          Returns the status of the exitNear field.
static int getLoopsCnt()
          Returns the number of nested loops found until now.
static void incLoopsCnt()
          Increases the loopsCnt field.
static void processPSObject(PSObject psobject)
          Retrieves a PSobject from program loader and if it is a command it executes it.
static void setExitNear(boolean b)
          Sets the exitNear field with the value being given.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExecutionEngine

public ExecutionEngine(PSPath gStack)
Creates an instance of the Execution Engine.

Precondition : -.
Postcondition : A new execution engine will be created.

Method Detail

processPSObject

public static void processPSObject(PSObject psobject)
                            throws java.lang.Throwable
Retrieves a PSobject from program loader and if it is a command it executes it.

Precondition : A valid instance of PSObject.
Postcondition : The command will be executed.

Parameters:
psobject - The PSObject retrieved by program loader.
Throws:
java.lang.Throwable

execExecutableArray

public static PSObject execExecutableArray(PSExecArray execArray)
Retrieves a PSobject from the executable array.

Precondition : A valid instance of a stack and an executable array.
Postcondition : Continious calls to this method will give elements from the execArray.

Parameters:
execArray - The executable array that was retrieved.
Returns:
A PSObject from the executable array.

destroyLastArray

public static void destroyLastArray()
Erases the last record of the executable array being processed.

Precondition : A valid instance of the execution engine.
Postcondition : The last record is erased


getExitNear

public static boolean getExitNear()
Returns the status of the exitNear field.

Precondition : -.
Postcondition : Returns the status of the exitNear field.

Returns:
The status of the field.

getLoopsCnt

public static int getLoopsCnt()
Returns the number of nested loops found until now.

Precondition : -.
Postcondition : Returns the number of nested loops .

Returns:
The status of the field.

setExitNear

public static void setExitNear(boolean b)
Sets the exitNear field with the value being given.

Precondition : -.
Postcondition : Changes the value of exitNear field.

Parameters:
b - The new value.

incLoopsCnt

public static void incLoopsCnt()
Increases the loopsCnt field.

Precondition : -.
Postcondition : Increases the loopsCnt field.


decLoopsCnt

public static void decLoopsCnt()
Decreases the loopsCnt field.

Precondition : -.
Postcondition : Decreases the loopsCnt field.