#include <AggExpr.h>
Classes | |
class | KeyIterator |
Public Member Functions | |
~AggregateExpr () | |
AggregateExpr (Location loc) | |
bool | empty () const |
Returns true if this aggregate is empty. | |
bool | hasStaticIndices () const |
Returns true if the indices defined by this aggregate are statically known. | |
unsigned | numComponents () const |
If hasStaticIndices is true, returns the total number of components defined by this aggregate. | |
bool | isPurelyPositional () const |
Returns true if this aggregate consists of positional components exclusively. | |
bool | isPurelyKeyed () const |
Returns true if this aggregate consists of keyed components exclusively. | |
bool | hasOthers () const |
Returns true if this aggregate has a others component. | |
Location | getOthersLoc () const |
Returns the location of the others reserved word, or an invalid location if hasOthers() returns false. | |
void | addOthersExpr (Location loc, Expr *component) |
void | setOthersExpr (Expr *expr) |
Replaces an existing others expression. | |
Positional Components. | |
An AggregateExpr node contains a (possibly empty) set of positional expressions. The following methods provide access to these components. | |
bool | hasPositionalComponents () const |
Returns true if this aggregate contains any positional components. | |
unsigned | numPositionalComponents () const |
Returns the number of positional components in this aggregate. | |
void | addComponent (Expr *expr) |
Adds a positional component to this aggregate expression. | |
Keyed Components. | |
void | addComponent (ComponentKeyList *keyList) |
Adds a ComponentKeyList this KeyedAggExpr. | |
bool | hasKeyedComponents () const |
Returns true if this aggregate contains any keyed components. | |
unsigned | numKeyLists () const |
Returns the number of key lists provided by this aggregate. | |
unsigned | numKeys () const |
Returns the total number of keys provided by this aggregate. | |
Expr * | getOthersExpr () |
const Expr * | getOthersExpr () const |
Static Public Member Functions | |
static bool | classof (const AggregateExpr *node) |
Support isa and dyn_cast. | |
static bool | classof (const Ast *node) |
Positional Component Iterators. | |
| |
typedef std::vector< Expr * > ::iterator | pos_iterator |
typedef std::vector< Expr * > ::const_iterator | const_pos_iterator |
pos_iterator | pos_begin () |
pos_iterator | pos_end () |
const_pos_iterator | pos_begin () const |
const_pos_iterator | pos_end () const |
ComponentKeyList Iterators. | |
Iterators over the key lists associated with this aggregate. | |
typedef std::vector < ComponentKeyList * > ::iterator | kl_iterator |
typedef std::vector < ComponentKeyList * > ::const_iterator | const_kl_iterator |
kl_iterator | kl_begin () |
kl_iterator | kl_end () |
const_kl_iterator | kl_begin () const |
const_kl_iterator | kl_end () const |
Key Iterators. | |
Iterators over each key associated with this aggregate. These iterators traverse the set of keys in the order they were added to the aggregate node. | |
typedef KeyIterator | key_iterator |
key_iterator | key_begin () |
key_iterator | key_end () |
Definition at line 378 of file AggExpr.h.
typedef std::vector<ComponentKeyList*>::const_iterator comma::AggregateExpr::const_kl_iterator |
typedef std::vector<Expr*>::const_iterator comma::AggregateExpr::const_pos_iterator |
typedef KeyIterator comma::AggregateExpr::key_iterator |
typedef std::vector<ComponentKeyList*>::iterator comma::AggregateExpr::kl_iterator |
typedef std::vector<Expr*>::iterator comma::AggregateExpr::pos_iterator |
AggregateExpr::~AggregateExpr | ( | ) |
Definition at line 134 of file AggExpr.cpp.
comma::AggregateExpr::AggregateExpr | ( | Location | loc | ) | [inline] |
Constructs an empty AggregateExpr. Components of this aggregate are introduced via calls to addComponent().
void comma::AggregateExpr::addComponent | ( | ComponentKeyList * | keyList | ) | [inline] |
Adds a ComponentKeyList this KeyedAggExpr.
void comma::AggregateExpr::addComponent | ( | Expr * | expr | ) | [inline] |
Associates an expression with the others
component of this aggregate.
Aggregates cannot hold multiple others
components. This method will assert if called more than once.
loc | Location of the others reserved word. | |
component | The expression associated with others . |
static bool comma::AggregateExpr::classof | ( | const Ast * | node | ) | [inline, static] |
Reimplemented from comma::Expr.
static bool comma::AggregateExpr::classof | ( | const AggregateExpr * | node | ) | [inline, static] |
bool AggregateExpr::empty | ( | ) | const |
Returns true if this aggregate is empty.
An aggregate is empty if there are no components associated with the expression and there is no others clause. Aggregate expression nodes should never be empty in a well-formed Comma program.
Definition at line 146 of file AggExpr.cpp.
const Expr* comma::AggregateExpr::getOthersExpr | ( | ) | const [inline] |
Expr* comma::AggregateExpr::getOthersExpr | ( | ) | [inline] |
Location comma::AggregateExpr::getOthersLoc | ( | ) | const [inline] |
Returns the location of the others
reserved word, or an invalid location if hasOthers() returns false.
bool comma::AggregateExpr::hasKeyedComponents | ( | ) | const [inline] |
bool comma::AggregateExpr::hasOthers | ( | ) | const [inline] |
bool comma::AggregateExpr::hasPositionalComponents | ( | ) | const [inline] |
bool AggregateExpr::hasStaticIndices | ( | ) | const |
Returns true if the indices defined by this aggregate are statically known.
In particular, if this aggregate contains any keyed components, the keys must be static expressions, ranges, or discrete types. Positional components are always considered to define static indices.
Definition at line 159 of file AggExpr.cpp.
bool comma::AggregateExpr::isPurelyKeyed | ( | ) | const [inline] |
bool comma::AggregateExpr::isPurelyPositional | ( | ) | const [inline] |
key_iterator comma::AggregateExpr::key_begin | ( | ) | [inline] |
key_iterator comma::AggregateExpr::key_end | ( | ) | [inline] |
const_kl_iterator comma::AggregateExpr::kl_begin | ( | ) | const [inline] |
kl_iterator comma::AggregateExpr::kl_begin | ( | ) | [inline] |
const_kl_iterator comma::AggregateExpr::kl_end | ( | ) | const [inline] |
kl_iterator comma::AggregateExpr::kl_end | ( | ) | [inline] |
unsigned AggregateExpr::numComponents | ( | ) | const |
If hasStaticIndices is true, returns the total number of components defined by this aggregate.
Definition at line 172 of file AggExpr.cpp.
unsigned comma::AggregateExpr::numKeyLists | ( | ) | const [inline] |
unsigned AggregateExpr::numKeys | ( | ) | const |
Returns the total number of keys provided by this aggregate.
Definition at line 151 of file AggExpr.cpp.
unsigned comma::AggregateExpr::numPositionalComponents | ( | ) | const [inline] |
const_pos_iterator comma::AggregateExpr::pos_begin | ( | ) | const [inline] |
pos_iterator comma::AggregateExpr::pos_begin | ( | ) | [inline] |
const_pos_iterator comma::AggregateExpr::pos_end | ( | ) | const [inline] |
pos_iterator comma::AggregateExpr::pos_end | ( | ) | [inline] |
void comma::AggregateExpr::setOthersExpr | ( | Expr * | expr | ) | [inline] |