edu.ksu.cis.projects.bogor.ast
Class System

java.lang.Object
  extended by edu.ksu.cis.projects.bogor.ast.Node
      extended by edu.ksu.cis.projects.bogor.ast.System
All Implemented Interfaces:
Disposable, Serializable, Cloneable

public final class System
extends Node

The compilation unit for a BIR document. Multiple keywords can be used to set off the unit. The choice of which keyword affects interpretation:

Version:
CVS $Revision: 1.9 $ $Date: 2005/06/09 00:22:00 $
Author:
Robby
See Also:
Serialized Form

Nested Class Summary
static class System.DeclarationKeyword
           
 
Field Summary
 
Fields inherited from class edu.ksu.cis.projects.bogor.ast.Node
ILLEGAL_LOCAL_ID_CHAR
 
Constructor Summary
System(String id, List<? extends SystemMember> systemMembers)
           Default constructors.
System(System.DeclarationKeyword keyword, String id, List<? extends SystemMember> systemMembers)
          Default constructors.
 
Method Summary
 System clone()
          Clones this object (deep clone); including location info.
 void dispose()
          Removes reference to id, and disposes systemMembers.
 System.DeclarationKeyword getDeclarationKeyword()
           
 String getId()
          Gets the system id.
 SystemMember getSystemMember(int index)
          Gets a system member at a specified index.
 int getSystemMemberCount()
          Gets the number of system members.
 void setDeclarationKeyword(System.DeclarationKeyword newKeyword)
           
 void setId(String newId)
          Sets the system id.
 void setSystemMembers(List<? extends SystemMember> newSystemMembers)
          Sets the system members.
 String toString()
          Returns the string representation of this object.
 void visit(ASTVisitor visitor)
           
 
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
 

Constructor Detail

System

public System(System.DeclarationKeyword keyword,
              String id,
              List<? extends SystemMember> systemMembers)
Default constructors. Sets this object as each definition's, each global's parent, and each fsm's parent.

Parameters:
keyword - The keyword which was used to denote this compilation unit.
id - The system id. Must be non-null.
systemMembers - The system members. Must be non-null. Each element must be instance of SystemMember.

System

public System(String id,
              List<? extends SystemMember> systemMembers)

Default constructors. Sets this object as each definition's, each global's parent, and each fsm's parent. It's assumed that the keyword used to denote this compilation unit was system, thus this constructor is equivalent to

new System(System.DeclarationKeyword.SYSTEM, id, systemMembers)

Parameters:
id - The system id. Must be non-null.
systemMembers - The system members. Must be non-null. Each element must be instance of SystemMember.
Method Detail

getDeclarationKeyword

public System.DeclarationKeyword getDeclarationKeyword()

setDeclarationKeyword

public void setDeclarationKeyword(System.DeclarationKeyword newKeyword)

setId

public void setId(String newId)
Sets the system id.

Parameters:
newId - The new system id. Must be non-null.

getId

public String getId()
Gets the system id.

Returns:
The system id. Non-null.

getSystemMember

public SystemMember getSystemMember(int index)
Gets a system member at a specified index.

Parameters:
index - The index of the system member. Must be between 0 and getSystemMemberCount() - 1, inclusive.
Returns:
The system member at the specified index. Non-null.

getSystemMemberCount

public int getSystemMemberCount()
Gets the number of system members.

Returns:
The number of system members. Greater than or equal to zero.

setSystemMembers

public void setSystemMembers(List<? extends SystemMember> newSystemMembers)
Sets the system members. Sets this object as each system member's parent.

Parameters:
newSystemMembers - The new system members. Must be non-null. Each element must be instance of SystemMember.

clone

public System clone()
Clones this object (deep clone); including location info.

Specified by:
clone in class Node
Returns:
The clone of this object. Non-null.

dispose

public void dispose()
Removes reference to id, and disposes systemMembers. Once called, avoid using this object.

Specified by:
dispose in interface Disposable
Overrides:
dispose in class Node

toString

public String toString()
Returns the string representation of this object.

Specified by:
toString in class Node
Returns:
 "system id\n" + "{\n" + "    { definition\n | global | function }\n" + "}\n"
 

visit

public void visit(ASTVisitor visitor)
Specified by:
visit in class Node