org.problets.domain.model.control.abstraction
Class Function
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
- All Implemented Interfaces:
- java.lang.Cloneable
- Direct Known Subclasses:
- Program
public class Function
- extends Block
Processes a function, which is a "callable" block.
- 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 this function
by setting the variables in this environment as declared,
and the rest as not declared |
java.util.Vector |
getFormalParameters()
Returns a reference to the formal parameter list vector |
java.lang.String |
getName()
Get the name of this scope model: returns "block" if this is a block |
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)
|
void |
setPartialRefEnvironment(ActivationRecord inPartialRefEnv)
Sets the partial referencing environment of this function. |
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
INCORRECT_PARAMETERS
public static final java.lang.String INCORRECT_PARAMETERS
- The errors of interest for this class
- See Also:
- Constant Field Values
MISMATCHED_PARAMETERS
public static final java.lang.String MISMATCHED_PARAMETERS
- See Also:
- Constant Field Values
CALL_BEFORE_DEFINED
public static final java.lang.String CALL_BEFORE_DEFINED
- See Also:
- Constant Field Values
Function
public Function(ActivationRecord parentActivationRecord,
HeapModel heap,
java.lang.String inTemplate)
getName
public java.lang.String getName()
- Get the name of this scope model: returns "block" if this is a block
- Overrides:
getName
in class ControlModel
getFormalParameters
public java.util.Vector getFormalParameters()
- Returns a reference to the formal parameter list vector
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 Scope
setPartialRefEnvironment
public void setPartialRefEnvironment(ActivationRecord inPartialRefEnv)
- Sets the partial referencing environment of this function.
This is later used to determine which variables in the parent
are accessible by this function, viz-a-viz global variables
commitPartialRefEnvironment
public void commitPartialRefEnvironment(StackModel stack)
- Commits the partial referencing environment for this function
by setting the variables in this environment as declared,
and the rest as not declared
main
public static void main(java.lang.String[] args)