|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.ksu.cis.projects.bogor.ast.Node
edu.ksu.cis.projects.bogor.ast.SystemMember
edu.ksu.cis.projects.bogor.ast.FSM
public final class FSM
FSM AST.
| Nested Class Summary | |
|---|---|
static class |
FSM.DeclarationKeyword
|
| Field Summary | |
|---|---|
static int |
DEFAULT_ACTIVE_FSM_MULTIPLICITY
|
protected ASTType |
returnType
Holds the optional return type. |
| Fields inherited from class edu.ksu.cis.projects.bogor.ast.Node |
|---|
ILLEGAL_LOCAL_ID_CHAR |
| Constructor Summary | |
|---|---|
FSM(FSM.DeclarationKeyword keyword,
boolean active,
Exp optionalNumActiveExp,
boolean main,
String id,
ArrayList<Param> params,
ASTType optionalReturnType,
List<Local> locals,
List<Location> locations,
List<Catch> catches,
Statement statement)
Internal constructor. |
|
| Method Summary | |
|---|---|
FSM |
clone()
Clones this object (deep clone); including location info. |
void |
dispose()
Disposes params, locals, locations, and catches. |
boolean |
getActive()
Query whether this thread type is automatically started in the initial state. |
Catch |
getCatch(int index)
Gets a catch at a specified index. |
int |
getCatchCount()
Gets the number of catches. |
FSM.DeclarationKeyword |
getDeclarationKeyword()
|
String |
getId()
Gets the id. |
Local |
getLocal(int index)
Gets the local at a specified index. |
int |
getLocalCount()
Gets the number of locals. |
Location |
getLocation(int index)
Gets the location at a specified index. |
int |
getLocationCount()
Gets the number of locations. |
boolean |
getMain()
Gets the main. |
Exp |
getOptionalActiveMultiplicityExp()
Retrieve expression giving multiplicity of an active thread type. |
ASTType |
getOptionalReturnType()
Gets the return type. |
Param |
getParam(int index)
Gets the param at a specified index. |
int |
getParamCount()
Gets the number of params. |
Statement |
getStatement()
Gets the statement of this FSM. |
void |
setActive(boolean newActive)
Sets whether this thread type is automatically started in the initial state. |
void |
setCatches(List<Catch> newCatches)
Sets the catches. |
void |
setDeclarationKeyword(FSM.DeclarationKeyword newKeyword)
|
void |
setId(String newId)
Sets the function id. |
void |
setLocals(List<Local> newLocals)
Sets the locals. |
void |
setLocations(List<Location> newLocations)
Sets the location. |
void |
setMain(boolean newMain)
Sets the main. |
void |
setOptionalActiveMultiplicityExp(Exp num)
Install syntax tree for expression giving number of replicated versions of this thread (only applicable for active thread types). |
void |
setParams(ArrayList<Param> newParams)
Sets the params. |
void |
setReturnType(ASTType newReturnType)
Sets the return type. |
void |
setStatement(Statement stmt)
Sets the statement of this FSM. |
String |
toString()
Returns the string representation of this object. |
void |
visit(ASTVisitor visitor)
|
| Methods inherited from class edu.ksu.cis.projects.bogor.ast.SystemMember |
|---|
getParent, setParent |
| Methods inherited from class edu.ksu.cis.projects.bogor.ast.Node |
|---|
getLocationInfo, getProperty, putProperty, setLocationInfo |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_ACTIVE_FSM_MULTIPLICITY
protected ASTType returnType
| Constructor Detail |
|---|
public FSM(FSM.DeclarationKeyword keyword,
boolean active,
Exp optionalNumActiveExp,
boolean main,
String id,
ArrayList<Param> params,
ASTType optionalReturnType,
List<Local> locals,
List<Location> locations,
List<Catch> catches,
Statement statement)
keyword - Token indicating which keyword was used to declare this FSM.active - Flag indicating whether thread type should auto-start in
initial state.optionalNumActiveExp - Number of copies of an active thread to start. May be null
(indicates either nonactive thread type or exactly one active
thread).main - The main.id - The id.params - The params. Must be non-null. Each element must be instance of
Param.optionalReturnType - The return type. Must be non-null.locals - The locals. Must be non-null. Each element must be instance of
Local.locations - The locations. Must be non-null. Each element must be instance
of Location. The number of elements must be greater than zero.catches - The catches. Must be non-null. Each element must be instance
of Catch.| Method Detail |
|---|
public Catch getCatch(int index)
index - The index of the catch. Must be between 0 and getCatchCount() -
1, inclusive.
public int getCatchCount()
public void setCatches(List<Catch> newCatches)
newCatches - The new catches. Must be non-null. Each element must be
instance of Catch.public FSM.DeclarationKeyword getDeclarationKeyword()
public void setDeclarationKeyword(FSM.DeclarationKeyword newKeyword)
public void setId(String newId)
newId - The new function id. Must be non-null.public String getId()
public Local getLocal(int index)
index - The index of the local. Must be between 0 and getLocalCount() -
1, inclusive.
public int getLocalCount()
public void setLocals(List<Local> newLocals)
newLocals - The new locals. Must be non-null. Each element must be
instance of Local.public Location getLocation(int index)
index - The index of the location. Must be between 0 and
getLocationCount() - 1, inclusive.
public int getLocationCount()
public void setLocations(List<Location> newLocations)
newLocations - The new locations. Must be non-null. Each element must be
instance of Location. The number of elements must be greater
than zero.public Param getParam(int index)
index - The index of the param. Must be between 0 and getParamCount() -
1, inclusive.
public int getParamCount()
public Exp getOptionalActiveMultiplicityExp()
public void setOptionalActiveMultiplicityExp(Exp num)
num - The new main.public boolean getActive()
true if this thread type should be created in the
initial state, false otherwisepublic void setActive(boolean newActive)
public void setParams(ArrayList<Param> newParams)
newParams - The new params. Must be non-null. Each element must be
instance ofTypedId.public boolean getMain()
public void setMain(boolean newMain)
newMain - The new main.public void setReturnType(ASTType newReturnType)
newReturnType - The new return type. Must be non-null.public ASTType getOptionalReturnType()
public Statement getStatement()
public void setStatement(Statement stmt)
stmt - The stmt to set. Must be non-null.public void dispose()
dispose in interface Disposabledispose in class SystemMemberpublic String toString()
toString in class Node
" function id( ( params , )* ) [ returns returnType ]\n"
+ " {"
+ " ( locals )*\n"
+ "( locations )+"
+ "( catches )*"
+ " }".
public FSM clone()
clone in class SystemMemberpublic void visit(ASTVisitor visitor)
visit in class Node
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||