org.problets.domain.model.control.abstraction
Class Program
java.lang.Object
org.problets.domain.model.DomainModel
org.problets.domain.model.control.ControlModel
org.problets.domain.model.control.abstraction.Scope
org.problets.domain.model.control.abstraction.StatementSequence
org.problets.domain.model.control.abstraction.Block
org.problets.domain.model.control.abstraction.Function
org.problets.domain.model.control.abstraction.Program
- All Implemented Interfaces:
- java.lang.Cloneable
- Direct Known Subclasses:
- CPPProgram, CProgram, CSProgram, JProgram, VBProgram
public class Program
- extends Function
Processes a program consisting of one or more functions,
and accounts for partial referencing environments of global variables.
- Author:
- Amruth Kumar
Fields inherited from class org.problets.domain.model.DomainModel |
BOOLEAN, BREAKPOINT, CHARACTER, DOUBLE_PRECISION_REAL, ERROR_TYPE, EVAL_STATUS, expACTION, expASSIGNMENT, expAUTO_DEALLOCATION, expCALL, expCONDITION, expDECLARATION, expDEREFERENCING, expDYNAMIC_ALLOCATION, expDYNAMIC_ALLOCATION_INITIALIZATION, expDYNAMIC_DEALLOCATION, expELSE_CLAUSE, expERROR, expEXECUTION, expIF_CLAUSE, expINITIALIZATION, expINPUT, expPARAMETER_PASSING, expPRINT, expQUESTIONABLE, expREFERENCING, expRETURN, expRUNTIME_ERROR, expSEMANTIC_ERROR, expSYNTAX_ERROR, expUPDATE, MAX_OBJECT_IDENTITY, MIN_OBJECT_IDENTITY, QUADRUPLE_PRECISION_REAL, RUNTIME_ERROR, SEMANTIC_ERROR, SIGNED_INTEGER, SIGNED_LONG, SIGNED_SHORT, SINGLE_PRECISION_REAL, SYNTAX_ERROR, UNDEFINED_TYPE, UNSIGNED_INTEGER, UNSIGNED_LONG, UNSIGNED_SHORT, WARNING |
Method Summary |
void |
commitPartialRefEnvironment(StackModel stack)
Commits the partial referencing environment for the program
by setting all the variables in this environment as declared. |
ExecutionStatus |
explainProcess(RunEnv runEnv,
Behavior behavior,
boolean stepFlag)
Get super classes to explain execution of all the statements. |
java.util.Vector |
getFunctions()
Returns a vector of functions in this program - for visualization purposes |
java.lang.String[] |
getPossibleErrors()
Method to return errors for variables
May want to post-process based on Student Model |
static void |
main(java.lang.String[] args)
|
Methods inherited from class org.problets.domain.model.control.abstraction.Block |
grade |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PROGRAM_NAME
public static final java.lang.String PROGRAM_NAME
- Name used for this scope
- See Also:
- Constant Field Values
IDENTITY
public static final int IDENTITY
- See Also:
- Constant Field Values
MAIN_NOT_DEFINED
public static final java.lang.String MAIN_NOT_DEFINED
- See Also:
- Constant Field Values
Program
public Program(ActivationRecord parentActivationRecord,
HeapModel heap,
java.lang.String inTemplate)
getPossibleErrors
public java.lang.String[] getPossibleErrors()
- Method to return errors for variables
May want to post-process based on Student Model
- Overrides:
getPossibleErrors
in class Function
getFunctions
public java.util.Vector getFunctions()
- Returns a vector of functions in this program - for visualization purposes
explainProcess
public ExecutionStatus explainProcess(RunEnv runEnv,
Behavior behavior,
boolean stepFlag)
- Get super classes to explain execution of all the statements.
Handle run time exception, infinite loops and aborted executions here
- Overrides:
explainProcess
in class Block
- Returns:
- status of execution, as designated by constants in DomainModel
commitPartialRefEnvironment
public void commitPartialRefEnvironment(StackModel stack)
- Commits the partial referencing environment for the program
by setting all the variables in this environment as declared.
- Overrides:
commitPartialRefEnvironment
in class Function
main
public static void main(java.lang.String[] args)