IDL compiler front-end library
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
AST::ScopedName Struct Reference

A scoped name: sequence of identifiers. More...

#include <ScopedName.h>

Inheritance diagram for AST::ScopedName:
AST::Location

Public Member Functions

std::string stringize () const
 
 ScopedName ()
 Create empty name.
 
 ScopedName (const Location &loc)
 Create empty name with location.
 
 ScopedName (const Location &loc, bool root, const Identifier &name)
 Create single-element name.
 
 ScopedName (const Location &loc, bool root, Identifier &&name) noexcept
 Create single-element name.
 
 ScopedName (const Location &loc, bool root, std::initializer_list< const char * > names)
 Create multi-element name.
 
 ScopedName (const ScopedName &)=default
 Copy constructor.
 
 ScopedName (ScopedName &&)=default
 Move constructor.
 
ScopedNameoperator= (const ScopedName &)=default
 Assignment.
 
ScopedNameoperator= (ScopedName &&)=default
 Assignment.
 
bool operator== (const ScopedName &rhs) const noexcept
 Test for equality.
 
- Public Member Functions inherited from AST::Location
const std::filesystem::path & file () const noexcept
 
unsigned line () const noexcept
 

Public Attributes

bool from_root
 true if it is a root-scoped name, i.e. started from "::".
 

Detailed Description

A scoped name: sequence of identifiers.

Definition at line 39 of file ScopedName.h.

Constructor & Destructor Documentation

◆ ScopedName() [1/4]

AST::ScopedName::ScopedName ( const Location loc)
inline

Create empty name with location.

Parameters
locLocation.

Definition at line 57 of file ScopedName.h.

◆ ScopedName() [2/4]

AST::ScopedName::ScopedName ( const Location loc,
bool  root,
const Identifier name 
)

Create single-element name.

Parameters
locLocation.
roottrue if it is a root-scoped name, i.e. started from "::".
nameThe name.

◆ ScopedName() [3/4]

AST::ScopedName::ScopedName ( const Location loc,
bool  root,
Identifier &&  name 
)
noexcept

Create single-element name.

Parameters
locLocation.
roottrue if it is a root-scoped name, i.e. started from "::".
nameThe name.

◆ ScopedName() [4/4]

AST::ScopedName::ScopedName ( const Location loc,
bool  root,
std::initializer_list< const char * >  names 
)
inline

Create multi-element name.

Parameters
locLocation.
roottrue if it is a root-scoped name, i.e. started from "::".
namesName components.

Definition at line 81 of file ScopedName.h.

Member Function Documentation

◆ stringize()

std::string AST::ScopedName::stringize ( ) const
Returns
The name converted to string.

◆ operator==()

bool AST::ScopedName::operator== ( const ScopedName rhs) const
inlinenoexcept

Test for equality.

Parameters
rhsOther ScopedName.
Returns
true if the names are equal.

Definition at line 107 of file ScopedName.h.


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