org.problets.domain.model.control.iteration
Class WhileModel
java.lang.Object
org.problets.domain.model.DomainModel
org.problets.domain.model.control.ControlModel
org.problets.domain.model.control.ConditionControl
org.problets.domain.model.control.iteration.AbstractLoopModel
org.problets.domain.model.control.iteration.WhileModel
- All Implemented Interfaces:
- java.lang.Cloneable
- Direct Known Subclasses:
- IWhileModel
public class WhileModel
- extends AbstractLoopModel
Implements While Loops
- Author:
- Greg Tomalesky, 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 |
Constructor Summary |
WhileModel(ActivationRecord parent,
HeapModel heap,
java.lang.String in_template,
int in_scopeType)
public WhileModel(ActivationRecord parent, HeapModel heap,
String in_template, int in_scopeType);
The constructor for the WhileModel class |
Method Summary |
ExecutionStatus |
explainProcess(RunEnv runEnv,
Behavior behavior,
boolean stepFlag)
public void explainProcess(Vector explanation, Vector errors)
This function generates the explanation of the code for the
student. |
void |
getCode(java.util.Vector codeText,
OutputStream output)
public void getCode(Vector codeText, OutputStream output)
This function generates the code seen by the student |
java.lang.String |
getName()
Get the name of this control construct - for generation of error menus |
static boolean |
grade(java.lang.String template,
java.lang.String code)
|
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IDENTITY
public static final int IDENTITY
- See Also:
- Constant Field Values
WhileModel
public WhileModel(ActivationRecord parent,
HeapModel heap,
java.lang.String in_template,
int in_scopeType)
- public WhileModel(ActivationRecord parent, HeapModel heap,
String in_template, int in_scopeType);
The constructor for the WhileModel class
- Parameters:
parent
- - an Activation record passed from the parentheap
- - the heap object usedin_template
- - holds the while loop templatein_scopeType
- - the scope type for this scope object
getName
public java.lang.String getName()
- Get the name of this control construct - for generation of error menus
- Overrides:
getName
in class ControlModel
getCode
public void getCode(java.util.Vector codeText,
OutputStream output)
- public void getCode(Vector codeText, OutputStream output)
This function generates the code seen by the student
- Overrides:
getCode
in class ControlModel
- Parameters:
codeText
- - a vector that holds the code
explainProcess
public ExecutionStatus explainProcess(RunEnv runEnv,
Behavior behavior,
boolean stepFlag)
- public void explainProcess(Vector explanation, Vector errors)
This function generates the explanation of the code for the
student.
- Overrides:
explainProcess
in class ControlModel
- Parameters:
explanation
- - a vector holding the explanation lineserrors
- - a vector holding the error lines
- Returns:
- Status of execution
grade
public static boolean grade(java.lang.String template,
java.lang.String code)
main
public static void main(java.lang.String[] args)