comma::StringLiteral Class Reference

#include <Expr.h>

Inheritance diagram for comma::StringLiteral:
Inheritance graph
[legend]
Collaboration diagram for comma::StringLiteral:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 StringLiteral (const char *string, unsigned len, Location loc)
 StringLiteral (const char *start, const char *end, Location loc)
 Constructs a string literal using a pair of iterators.
ArrayTypegetType () const
 Returns the type of this string literal once resolved.
llvm::StringRef getString () const
 Returns the underlying representation of this string literal.
unsigned length () const
 Returns the length in characters of this string literal.
bool addComponentType (EnumerationDecl *decl)
template<class I >
void addComponentTypes (I start, I end)
 Adds a set of interpretations for the component type of this string.
bool removeComponentType (EnumerationDecl *decl)
unsigned numComponentTypes () const
 Returns the number of component interpretations.
bool zeroComponentTypes () const
 Returns true if the set of component types is empty.
const EnumerationDeclgetComponentType () const
 If there is a unique component type, return it, else null.

Static Public Member Functions

static bool classof (const StringLiteral *node)
 Support isa and dyn_cast.
static bool classof (const Ast *node)



typedef InterpSet::iterator component_iterator
 Iterators over the set of component types.
typedef InterpSet::const_iterator const_component_iterator
 Iterators over the set of component types.
bool containsComponentType (EnumerationDecl *decl) const
bool containsComponentType (EnumerationType *type) const
 Iterators over the set of component types.
bool resolveComponentType (EnumerationType *type)
component_iterator begin_component_types ()
 Iterators over the set of component types.
component_iterator end_component_types ()
 Iterators over the set of component types.
const_component_iterator begin_component_types () const
 Iterators over the set of component types.
const_component_iterator end_component_types () const
 Iterators over the set of component types.

Detailed Description

Definition at line 496 of file Expr.h.


Member Typedef Documentation

typedef InterpSet::iterator comma::StringLiteral::component_iterator

Iterators over the set of component types.

Definition at line 590 of file Expr.h.

typedef InterpSet::const_iterator comma::StringLiteral::const_component_iterator

Iterators over the set of component types.

Definition at line 594 of file Expr.h.


Constructor & Destructor Documentation

comma::StringLiteral::StringLiteral ( const char *  string,
unsigned  len,
Location  loc 
) [inline]

Constructs a string literal over the given raw character data. The data is copied by the constructor (it is safe for the data to live in a shared memory region).

Definition at line 504 of file Expr.h.

comma::StringLiteral::StringLiteral ( const char *  start,
const char *  end,
Location  loc 
) [inline]

Constructs a string literal using a pair of iterators.

Definition at line 510 of file Expr.h.


Member Function Documentation

bool comma::StringLiteral::addComponentType ( EnumerationDecl decl  )  [inline]

Adds an interpretation for the component type of this string.

Parameters:
decl The enumeration decl defining a possible component type.
Returns:
True if the given declaration was a new interpretation and false if it was already present.

Definition at line 532 of file Expr.h.

template<class I >
void comma::StringLiteral::addComponentTypes ( start,
end 
) [inline]

Adds a set of interpretations for the component type of this string.

Definition at line 538 of file Expr.h.

const_component_iterator comma::StringLiteral::begin_component_types (  )  const [inline]

Iterators over the set of component types.

Definition at line 595 of file Expr.h.

component_iterator comma::StringLiteral::begin_component_types (  )  [inline]

Iterators over the set of component types.

Definition at line 591 of file Expr.h.

static bool comma::StringLiteral::classof ( const Ast node  )  [inline, static]

Reimplemented from comma::Expr.

Definition at line 605 of file Expr.h.

static bool comma::StringLiteral::classof ( const StringLiteral node  )  [inline, static]

Support isa and dyn_cast.

Reimplemented from comma::Expr.

Definition at line 604 of file Expr.h.

bool comma::StringLiteral::containsComponentType ( EnumerationType type  )  const [inline]

Iterators over the set of component types.

Definition at line 561 of file Expr.h.

bool comma::StringLiteral::containsComponentType ( EnumerationDecl decl  )  const [inline]

Tests if the given enumeration type or declaration is in the set of component types.

Parameters:
decl The enumeration decl or type to test.
Returns:
True if the given declaration is registered as a component type and false otherwise.

Definition at line 558 of file Expr.h.

const_component_iterator comma::StringLiteral::end_component_types (  )  const [inline]

Iterators over the set of component types.

Definition at line 598 of file Expr.h.

component_iterator comma::StringLiteral::end_component_types (  )  [inline]

Iterators over the set of component types.

Definition at line 592 of file Expr.h.

const EnumerationDecl* comma::StringLiteral::getComponentType (  )  const [inline]

If there is a unique component type, return it, else null.

Definition at line 581 of file Expr.h.

llvm::StringRef comma::StringLiteral::getString (  )  const [inline]

Returns the underlying representation of this string literal.

Definition at line 521 of file Expr.h.

ArrayType* comma::StringLiteral::getType (  )  const [inline]

Returns the type of this string literal once resolved.

Reimplemented from comma::Expr.

Definition at line 516 of file Expr.h.

unsigned comma::StringLiteral::length (  )  const [inline]

Returns the length in characters of this string literal.

Definition at line 524 of file Expr.h.

unsigned comma::StringLiteral::numComponentTypes (  )  const [inline]

Returns the number of component interpretations.

Definition at line 575 of file Expr.h.

bool comma::StringLiteral::removeComponentType ( EnumerationDecl decl  )  [inline]

Removes an interpretation for the component type of this string.

Parameters:
decl The enumeration decl to remove.
Returns:
True if the given enumeration was removed from the set of interpretations, and false if it did not exist.

Definition at line 546 of file Expr.h.

bool StringLiteral::resolveComponentType ( EnumerationType type  ) 

Sets the component type of this literal to the given type, dropping all other interpretations, and returns true. If the given type does not describe an interpretation of this literal nothing is done and false is returned.

Definition at line 268 of file Expr.cpp.

bool comma::StringLiteral::zeroComponentTypes (  )  const [inline]

Returns true if the set of component types is empty.

Definition at line 578 of file Expr.h.


The documentation for this class was generated from the following files:

Generated on 1 Feb 2010 for Comma by  doxygen 1.6.1