CodeSonar C++ API
[For improved navigation, enable JavaScript.]
Public Member Functions | Static Public Member Functions | Static Public Attributes | Related Functions | List of all members
cs::xr_role Class Reference

Enumeration class: describes the role that a token is playing at a particular occurrence of that token. More...

Public Member Functions

csint64 as_integer () const
 Get an integer representation of this. More...
 
std::string as_repr () const
 Get a representation of a xr_role object that includes information useful for debugging. More...
 
std::string as_string () const
 Get a simple string representation of a xr_role object. More...
 
int cmp (const xr_role &other) const
 Comparison function for xr_role, with respect to a stable overall ordering. More...
 
cs_hash_t hash () const
 Hash function for xr_role. More...
 
std::string name () const
 Get the name of a xr_role object. More...
 

Static Public Member Functions

static xr_role from_integer (csint64 _inner)
 Construct an instance from an integer representation. More...
 

Static Public Attributes

static const xr_role AGGREGATE_MEMBER
 ...as the type of a data member in an aggregate structure. More...
 
static const xr_role CALL
 ...when the function is called. More...
 
static const xr_role CAST
 ...as the target type of a cast operation. More...
 
static const xr_role CATCH_PARAM
 ...[C++ only] as the parameter type in a catch() expression. More...
 
static const xr_role CONSTANT
 ...[C++ only] as the type of a parameter or variable declared as const . More...
 
static const xr_role CONSTRUCTOR_INITIALIZATION
 ...[C++ only] in an initialization list. More...
 
static const xr_role DECLARATION
 ...when declared. More...
 
static const xr_role DEFINITION
 ...when defined. More...
 
static const xr_role EXT
 [C++ only] The role a namespace name takes at any subsequent extension of the namespace. More...
 
static const xr_role FILE_STATIC
 ...as the type of a file static variable. More...
 
static const xr_role FORMAL
 ...as the type of a formal parameter in a function definition or declaration. More...
 
static const xr_role FRIEND
 ...[C++ only] when declared as a friend. More...
 
static const xr_role GLOBAL
 ...as the type of a global variable. More...
 
static const xr_role GOTO
 ...as the operand in a goto expression. More...
 
static const xr_role INCLUDE
 ...as the subject of an #include statement. More...
 
static const xr_role INVOCATION
 ...as the subject of a macro invocation or function pointer invocation. More...
 
static const xr_role LOCAL
 ...as the type of a local variable. More...
 
static const xr_role LOCAL_STATIC
 ...as the type of a local static variable. More...
 
static const xr_role METHOD_INVOCATION
 ...[C++ only] when one of its methods is invoked (for aggregates). More...
 
static const xr_role NEW
 ...[C++ only] in the type of a new expression. More...
 
static const xr_role OCCURRENCE
 Any occurrence of an enum symbol other than its definition. More...
 
static const xr_role OTHER
 For certain token kinds, indicates an occurrence for which no other applicable role was appropriate. More...
 
static const xr_role QUALIFIER
 ...[C++ only] as the first operand in a name qualifier expression A::B. More...
 
static const xr_role READ
 ...when its value is read. More...
 
static const xr_role REDEF
 when #define'd twice or more with no intervening #undef . More...
 
static const xr_role RETURN_TYPE
 ...as the return type in a function definition or declaration. More...
 
static const xr_role SIZEOF
 ...as the argument to sizeof() . More...
 
static const xr_role SUBCLASS
 ...[C++ only] as the superclass in a subclass declaration. More...
 
static const xr_role TAG
 ...when defined using the same name as a tag. More...
 
static const xr_role TAKE_ADDRESS
 ...as the operand of an addressing expression &A. More...
 
static const xr_role TEMPL_ARG
 ...[C++ only] as an argument for template instantiation. More...
 
static const xr_role TEMPLATE_PARAMETER
 ...[C++ only] as the type of a template value parameter. More...
 
static const xr_role THROW_EXCEPTION_SPEC
 ...[C++ only] as the parameter type in a throw() expression. More...
 
static const xr_role TYPEDEF
 ...in the first operand of a typedef statement. More...
 
static const xr_role UNDEF
 ...when undefined with #undef . More...
 
static const xr_role USING
 ...[C++ only] as the operand in a using namespace expression. More...
 
static const xr_role WRITE
 ...when written to. More...
 
static const xr_role WRITE_THROUGH
 ...when dereferenced and its target written to. More...
 

Related Functions

(Note that these are not member functions.)

bool operator!= (const xr_role &a, const xr_role &b)
 Inequality operator for xr_role. More...
 
bool operator< (const xr_role &a, const xr_role &b)
 Less-than operator for xr_role. More...
 
std::ostream & operator<< (std::ostream &out, const xr_role &a)
 Print a representation of a xr_role object to the specified stream. More...
 
bool operator<= (const xr_role &a, const xr_role &b)
 Less-than-or-equal operator for xr_role. More...
 
bool operator== (const xr_role &a, const xr_role &b)
 Equality operator for xr_role. More...
 
bool operator> (const xr_role &a, const xr_role &b)
 Greater-than operator for xr_role. More...
 
bool operator>= (const xr_role &a, const xr_role &b)
 Greater-than-or-equal operator for xr_role. More...
 

Detailed Description

Enumeration class: describes the role that a token is playing at a particular occurrence of that token.

Member Function Documentation

◆ as_integer()

csint64 cs::xr_role::as_integer ( ) const
inline

Get an integer representation of this.

Returns
An integer suitable for use with from_integer(). Invariant: For xr_role x, xr_role.from_integer(x.as_integer()) == x

◆ as_repr()

std::string cs::xr_role::as_repr ( ) const
inline

Get a representation of a xr_role object that includes information useful for debugging.

Returns
The string representation.

◆ as_string()

std::string cs::xr_role::as_string ( ) const
inline

Get a simple string representation of a xr_role object.

Returns
The string representation.

◆ cmp()

int cs::xr_role::cmp ( const xr_role other) const
inline

Comparison function for xr_role, with respect to a stable overall ordering.

Parameters
otherThe xr_role object to compare against.
Returns
An integer N such that:
  • N==0 if the two objects compare equal
  • N<0 if this < other
  • N>0 if this > other

◆ from_integer()

static xr_role cs::xr_role::from_integer ( csint64  _inner)
inlinestatic

Construct an instance from an integer representation.

Parameters
[in]_innerThe integer representation, as returned by as_integer(). Invariant: For xr_role x, xr_role.from_integer(x.as_integer()) == x
Exceptions
cs::result::ERROR_INVALID_ARGUMENTif _inner is not a valid integer representation for a xr_role instance.

◆ hash()

cs_hash_t cs::xr_role::hash ( ) const
inline

Hash function for xr_role.

◆ name()

std::string cs::xr_role::name ( ) const
inline

Get the name of a xr_role object.

Returns
The name.

Friends And Related Function Documentation

◆ operator!=()

bool operator!= ( const xr_role a,
const xr_role b 
)
related

Inequality operator for xr_role.

Parameters
[in]aThe xr_role object to compare.
[in]bThe xr_role object to compare against.
Returns
false if a and b are equal according to xr_role::cmp(), true otherwise.

◆ operator<()

bool operator< ( const xr_role a,
const xr_role b 
)
related

Less-than operator for xr_role.

Parameters
[in]aThe xr_role object to compare.
[in]bThe xr_role object to compare against.
Returns
true if a < b according to xr_role::cmp() , false otherwise.

◆ operator<<()

std::ostream & operator<< ( std::ostream &  out,
const xr_role a 
)
related

Print a representation of a xr_role object to the specified stream.

Parameters
[in]outThe stream to print to.
[in]aThe xr_role object to print.
Returns
void

◆ operator<=()

bool operator<= ( const xr_role a,
const xr_role b 
)
related

Less-than-or-equal operator for xr_role.

Parameters
[in]aThe xr_role object to compare.
[in]bThe xr_role object to compare against.
Returns
true if a <= b according to xr_role::cmp() , false otherwise.

◆ operator==()

bool operator== ( const xr_role a,
const xr_role b 
)
related

Equality operator for xr_role.

Parameters
[in]aThe xr_role object to compare.
[in]bThe xr_role object to compare against.
Returns
true if a and b are equal according to xr_role::cmp(), false otherwise.

◆ operator>()

bool operator> ( const xr_role a,
const xr_role b 
)
related

Greater-than operator for xr_role.

Parameters
[in]aThe xr_role object to compare.
[in]bThe xr_role object to compare against.
Returns
true if a > b according to xr_role::cmp() , false otherwise.

◆ operator>=()

bool operator>= ( const xr_role a,
const xr_role b 
)
related

Greater-than-or-equal operator for xr_role.

Parameters
[in]aThe xr_role object to compare.
[in]bThe xr_role object to compare against.
Returns
true if a >= b according to xr_role::cmp() , false otherwise.

Member Data Documentation

◆ AGGREGATE_MEMBER

const xr_role cs::xr_role::AGGREGATE_MEMBER
static

...as the type of a data member in an aggregate structure.

◆ CALL

const xr_role cs::xr_role::CALL
static

...when the function is called.

◆ CAST

const xr_role cs::xr_role::CAST
static

...as the target type of a cast operation.

◆ CATCH_PARAM

const xr_role cs::xr_role::CATCH_PARAM
static

...[C++ only] as the parameter type in a catch() expression.

◆ CONSTANT

const xr_role cs::xr_role::CONSTANT
static

...[C++ only] as the type of a parameter or variable declared as const .

◆ CONSTRUCTOR_INITIALIZATION

const xr_role cs::xr_role::CONSTRUCTOR_INITIALIZATION
static

...[C++ only] in an initialization list.

◆ DECLARATION

const xr_role cs::xr_role::DECLARATION
static

...when declared.

◆ DEFINITION

const xr_role cs::xr_role::DEFINITION
static

...when defined.

◆ EXT

const xr_role cs::xr_role::EXT
static

[C++ only] The role a namespace name takes at any subsequent extension of the namespace.

◆ FILE_STATIC

const xr_role cs::xr_role::FILE_STATIC
static

...as the type of a file static variable.

◆ FORMAL

const xr_role cs::xr_role::FORMAL
static

...as the type of a formal parameter in a function definition or declaration.

◆ FRIEND

const xr_role cs::xr_role::FRIEND
static

...[C++ only] when declared as a friend.

◆ GLOBAL

const xr_role cs::xr_role::GLOBAL
static

...as the type of a global variable.

◆ GOTO

const xr_role cs::xr_role::GOTO
static

...as the operand in a goto expression.

◆ INCLUDE

const xr_role cs::xr_role::INCLUDE
static

...as the subject of an #include statement.

◆ INVOCATION

const xr_role cs::xr_role::INVOCATION
static

...as the subject of a macro invocation or function pointer invocation.

◆ LOCAL

const xr_role cs::xr_role::LOCAL
static

...as the type of a local variable.

◆ LOCAL_STATIC

const xr_role cs::xr_role::LOCAL_STATIC
static

...as the type of a local static variable.

◆ METHOD_INVOCATION

const xr_role cs::xr_role::METHOD_INVOCATION
static

...[C++ only] when one of its methods is invoked (for aggregates).

◆ NEW

const xr_role cs::xr_role::NEW
static

...[C++ only] in the type of a new expression.

◆ OCCURRENCE

const xr_role cs::xr_role::OCCURRENCE
static

Any occurrence of an enum symbol other than its definition.

◆ OTHER

const xr_role cs::xr_role::OTHER
static

For certain token kinds, indicates an occurrence for which no other applicable role was appropriate.

◆ QUALIFIER

const xr_role cs::xr_role::QUALIFIER
static

...[C++ only] as the first operand in a name qualifier expression A::B.

◆ READ

const xr_role cs::xr_role::READ
static

...when its value is read.

◆ REDEF

const xr_role cs::xr_role::REDEF
static

when #define'd twice or more with no intervening #undef .

◆ RETURN_TYPE

const xr_role cs::xr_role::RETURN_TYPE
static

...as the return type in a function definition or declaration.

◆ SIZEOF

const xr_role cs::xr_role::SIZEOF
static

...as the argument to sizeof() .

◆ SUBCLASS

const xr_role cs::xr_role::SUBCLASS
static

...[C++ only] as the superclass in a subclass declaration.

◆ TAG

const xr_role cs::xr_role::TAG
static

...when defined using the same name as a tag.

◆ TAKE_ADDRESS

const xr_role cs::xr_role::TAKE_ADDRESS
static

...as the operand of an addressing expression &A.

◆ TEMPL_ARG

const xr_role cs::xr_role::TEMPL_ARG
static

...[C++ only] as an argument for template instantiation.

◆ TEMPLATE_PARAMETER

const xr_role cs::xr_role::TEMPLATE_PARAMETER
static

...[C++ only] as the type of a template value parameter.

◆ THROW_EXCEPTION_SPEC

const xr_role cs::xr_role::THROW_EXCEPTION_SPEC
static

...[C++ only] as the parameter type in a throw() expression.

◆ TYPEDEF

const xr_role cs::xr_role::TYPEDEF
static

...in the first operand of a typedef statement.

◆ UNDEF

const xr_role cs::xr_role::UNDEF
static

...when undefined with #undef .

◆ USING

const xr_role cs::xr_role::USING
static

...[C++ only] as the operand in a using namespace expression.

◆ WRITE

const xr_role cs::xr_role::WRITE
static

...when written to.

◆ WRITE_THROUGH

const xr_role cs::xr_role::WRITE_THROUGH
static

...when dereferenced and its target written to.


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