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::point_syntax_element Class Reference

Enumeration class: the element of source code statement from which a point was generated. 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 point_syntax_element object that includes information useful for debugging. More...
 
std::string as_string () const
 Get a simple string representation of a point_syntax_element object. More...
 
int cmp (const point_syntax_element &other) const
 Comparison function for point_syntax_element, with respect to a stable overall ordering. More...
 
cs_hash_t hash () const
 Hash function for point_syntax_element. More...
 
std::string name () const
 Get the name of a point_syntax_element object. More...
 

Static Public Member Functions

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

Static Public Attributes

static const point_syntax_element COND
 A condition: for loop termination condition (kind point_syntax_kind::FOR), if condition (kind point_syntax_kind::IF), controlling expression of a while or do-while statement (kind point_syntax_kind::WHILE, point_syntax_kind::DO, respectively). More...
 
static const point_syntax_element EXPR
  return expression (kind point_syntax_kind::RETURN), controlling expression of a switch statement (kind point_syntax_kind::SWITCH), case label (kind point_syntax_kind::CASE), throw expression (kind point_syntax_kind::THROW). More...
 
static const point_syntax_element INCR
  for loop step clause (kind point_syntax_kind::FOR). More...
 
static const point_syntax_element INIT
 A for loop initialization clause (kind point_syntax_kind::FOR) or catch clause formal parameter (kind point_syntax_kind::CATCH). More...
 
static const point_syntax_element NONE
 All other program points. More...
 

Related Functions

(Note that these are not member functions.)

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

Detailed Description

Enumeration class: the element of source code statement from which a point was generated.

Get a point's syntax kind with point::get_syntax_kind().

See class point_syntax_kind for a short example.

Member Function Documentation

◆ as_integer()

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

Get an integer representation of this.

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

◆ as_repr()

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

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

Returns
The string representation.

◆ as_string()

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

Get a simple string representation of a point_syntax_element object.

Returns
The string representation.

◆ cmp()

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

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

Parameters
otherThe point_syntax_element 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 point_syntax_element cs::point_syntax_element::from_integer ( csint64  _inner)
inlinestatic

Construct an instance from an integer representation.

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

◆ hash()

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

Hash function for point_syntax_element.

◆ name()

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

Get the name of a point_syntax_element object.

Returns
The name.

Friends And Related Function Documentation

◆ operator!=()

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

Inequality operator for point_syntax_element.

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

◆ operator<()

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

Less-than operator for point_syntax_element.

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

◆ operator<<()

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

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

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

◆ operator<=()

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

Less-than-or-equal operator for point_syntax_element.

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

◆ operator==()

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

Equality operator for point_syntax_element.

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

◆ operator>()

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

Greater-than operator for point_syntax_element.

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

◆ operator>=()

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

Greater-than-or-equal operator for point_syntax_element.

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

Member Data Documentation

◆ COND

const point_syntax_element cs::point_syntax_element::COND
static

A condition: for loop termination condition (kind point_syntax_kind::FOR), if condition (kind point_syntax_kind::IF), controlling expression of a while or do-while statement (kind point_syntax_kind::WHILE, point_syntax_kind::DO, respectively).

◆ EXPR

const point_syntax_element cs::point_syntax_element::EXPR
static

return expression (kind point_syntax_kind::RETURN), controlling expression of a switch statement (kind point_syntax_kind::SWITCH), case label (kind point_syntax_kind::CASE), throw expression (kind point_syntax_kind::THROW).

◆ INCR

const point_syntax_element cs::point_syntax_element::INCR
static

for loop step clause (kind point_syntax_kind::FOR).

◆ INIT

const point_syntax_element cs::point_syntax_element::INIT
static

A for loop initialization clause (kind point_syntax_kind::FOR) or catch clause formal parameter (kind point_syntax_kind::CATCH).

◆ NONE

const point_syntax_element cs::point_syntax_element::NONE
static

All other program points.


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