coins.ast
Class Aggregate

java.lang.Object
  extended bycoins.ast.ASTree
      extended bycoins.ast.Aggregate
All Implemented Interfaces:
java.io.Serializable, Stmnt
Direct Known Subclasses:
Struct, Union

public abstract class Aggregate
extends ASTree
implements Stmnt

Declaration of a struct/union type. If the declaration appears in a type name, the type name is decomposed into the declaration and a reference to the declared structure/union.

For example, a variable declaration:

is decomposed into three declarations.

The struct declaration never appears as part of a type name.

See Also:
Serialized Form

Field Summary
protected  DeclaratorList members
           
protected  java.lang.String name
           
protected  long size
           
static int WORD_SIZE
          This variable used for computing word alignment.
 
Constructor Summary
Aggregate(java.lang.String aname, DeclaratorList mem, java.lang.String fname, int line)
           
 
Method Summary
 java.lang.String fileName()
          Returns the file name including the statement.
 ASTree getLeft()
          Returns members.
 Declarator getMember(java.lang.String name)
          Returns the member of the given name.
 DeclaratorList getMembers()
          Returns the members of the struct/union data type.
 ASTree getRight()
          Returns null.
 long getSize()
          Returns the size (in byte) of the struct/union data type.
 int lineNumber()
          Returns the line number of the statement.
 java.lang.String name()
          Returns the tag name.
 void setLeft(ASTree _left)
           
 void setRight(ASTree _right)
           
protected  void setSize(long s)
           
 
Methods inherited from class coins.ast.ASTree
accept, getTag, putSeparator, rightToString, toString, toString1
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

members

protected DeclaratorList members

size

protected long size

WORD_SIZE

public static int WORD_SIZE
This variable used for computing word alignment.

Constructor Detail

Aggregate

public Aggregate(java.lang.String aname,
                 DeclaratorList mem,
                 java.lang.String fname,
                 int line)
Method Detail

setSize

protected void setSize(long s)

fileName

public java.lang.String fileName()
Description copied from interface: Stmnt
Returns the file name including the statement.

Specified by:
fileName in interface Stmnt

lineNumber

public int lineNumber()
Description copied from interface: Stmnt
Returns the line number of the statement.

Specified by:
lineNumber in interface Stmnt

name

public java.lang.String name()
Returns the tag name. If the tag name is not explicitly specified, an arbitrary chosen unique name is given by the parser.


getLeft

public ASTree getLeft()
Returns members.

Specified by:
getLeft in class ASTree

getRight

public ASTree getRight()
Returns null.

Specified by:
getRight in class ASTree

setLeft

public void setLeft(ASTree _left)
Specified by:
setLeft in class ASTree

setRight

public void setRight(ASTree _right)
Specified by:
setRight in class ASTree

getSize

public long getSize()
Returns the size (in byte) of the struct/union data type.


getMembers

public DeclaratorList getMembers()
Returns the members of the struct/union data type.


getMember

public Declarator getMember(java.lang.String name)
Returns the member of the given name.