gov.llnl.babel.symbols

Class Struct

Implemented Interfaces:
Comparable, Attributes, Comparable, IMetadata

public class Struct
extends Symbol

The Struct contains a list of named types.

Nested Class Summary

static class
Struct.Item

Field Summary

Fields inherited from class gov.llnl.babel.symbols.Symbol

CLASS, ENUM, INTERFACE, PACKAGE, SCOPE, STRUCT, d_context, s_type

Fields inherited from class gov.llnl.babel.symbols.SymbolID

SCOPE

Fields inherited from class gov.llnl.babel.symbols.ASTNode

d_frozen

Constructor Summary

Struct(SymbolID id, Comment comment, Context context)
Struct(SymbolID id, Comment comment, Metadata metadata, Context context)

Method Summary

int
addItem(String name, Type type)
Insert a new type and name into the struct
int
addItem(Struct.Item i)
void
freeze()
Set
getAllSymbolReferences()
Set
getBasicArrayRefs()
List
getItems()
Set
getSymbolReferences()
boolean
hasArrayReference()
boolean
hasType(int type)
boolean
hasTypeEmbedded(int type)

Methods inherited from class gov.llnl.babel.symbols.Symbol

addMetadata, freeze, getAllSymbolReferences, getAttribute, getAttributes, getBasicArrayRefs, getComment, getDepth, getMetadata, getSymbolID, getSymbolReferences, getSymbolType, getSymbolTypeString, getUserSpecified, hasAttribute, isClass, isInterface, isPackage, isStruct, minimumDepth, removeAttribute, setAttribute, setAttribute, setComment, setUserSpecified

Methods inherited from class gov.llnl.babel.symbols.SymbolID

compareTo, equals, fromXML, getFullName, getShortName, getShortName, getSymbolName, getVersion, hashCode, setFromXML

Methods inherited from class gov.llnl.babel.symbols.ASTNode

checkFrozen, clone, freeze, protectCollection, protectList, protectMap, protectSet

Constructor Details

Struct

public Struct(SymbolID id,
              Comment comment,
              Context context)

Struct

public Struct(SymbolID id,
              Comment comment,
              Metadata metadata,
              Context context)

Method Details

addItem

public int addItem(String name,
                   Type type)
Insert a new type and name into the struct
Returns:
new number of items in the struct

addItem

public int addItem(Struct.Item i)

freeze

public void freeze()
Overrides:
freeze in interface Symbol

getAllSymbolReferences

public Set getAllSymbolReferences()
Overrides:
getAllSymbolReferences in interface Symbol

getBasicArrayRefs

public Set getBasicArrayRefs()
Overrides:
getBasicArrayRefs in interface Symbol

getItems

public List getItems()

getSymbolReferences

public Set getSymbolReferences()
Overrides:
getSymbolReferences in interface Symbol

hasArrayReference

public boolean hasArrayReference()

hasType

public boolean hasType(int type)

hasTypeEmbedded

public boolean hasTypeEmbedded(int type)