CodeSonar C++ API
Public Member Functions | Static Public Member Functions | Static Public Attributes | Related Symbols | List of all members
cs::ast_family Class Reference

Enumeration class for AST family. More...

Public Member Functions

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

Static Public Member Functions

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

Static Public Attributes

static const ast_family C_NORMALIZED
 Normalized C/C++ AST.
 
static const ast_family C_UNNORMALIZED
 Unnormalized C/C++ AST.
 
static const ast_family DEFAULT
 Represents the first AST family, whatever it might be.
 

Related Symbols

(Note that these are not member symbols.)

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

Detailed Description

Enumeration class for AST family.

Each language dependent AST module will define its own AST families.

Member Function Documentation

◆ as_integer()

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

Get an integer representation of this.

Returns
An integer suitable for use with from_integer().

Invariant: For ast_family x, ast_family.from_integer(x.as_integer()) == x

◆ as_repr()

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

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

Returns
The string representation.

◆ as_string()

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

Get a simple string representation of a ast_family object.

Returns
The string representation.

◆ cmp()

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

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

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

Construct an instance from an integer representation.

Parameters
[in]_innerThe integer representation, as returned by as_integer().

Invariant: For ast_family x, ast_family.from_integer(x.as_integer()) == x

Exceptions
cs::result::ERROR_INVALID_ARGUMENTif _inner is not a valid integer representation for a ast_family instance.

◆ hash()

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

Hash function for ast_family.


◆ name()

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

Get the name of a ast_family object.

Returns
The name.

Friends And Related Symbol Documentation

◆ operator!=()

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

Inequality operator for ast_family.

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

◆ operator<()

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

Less-than operator for ast_family.

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

◆ operator<<()

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

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

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

◆ operator<=()

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

Less-than-or-equal operator for ast_family.

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

◆ operator==()

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

Equality operator for ast_family.

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

◆ operator>()

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

Greater-than operator for ast_family.

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

◆ operator>=()

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

Greater-than-or-equal operator for ast_family.

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

Member Data Documentation

◆ C_NORMALIZED

const ast_family ast_family::C_NORMALIZED
static

Normalized C/C++ AST.

◆ C_UNNORMALIZED

const ast_family ast_family::C_UNNORMALIZED
static

Unnormalized C/C++ AST.

◆ DEFAULT

const ast_family ast_family::DEFAULT
static

Represents the first AST family, whatever it might be.

Used as a default in the API if the user does not specify a particular family.


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