g2o
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Private Member Functions | List of all members
SlamParser::Parser::basic_symbol< Base > Struct Template Reference

#include <bison_parser.h>

Inheritance diagram for SlamParser::Parser::basic_symbol< Base >:
Inheritance graph
[legend]
Collaboration diagram for SlamParser::Parser::basic_symbol< Base >:
Collaboration graph
[legend]

Public Types

typedef Base super_type
 Alias to Base.
 

Public Member Functions

 basic_symbol () YY_NOEXCEPT
 Default constructor.
 
 basic_symbol (const basic_symbol &that)
 Copy constructor.
 
 basic_symbol (typename Base::kind_type t, YY_MOVE_REF(location_type) l)
 Constructor for valueless symbols.
 
 basic_symbol (typename Base::kind_type t, YY_RVREF(value_type) v, YY_RVREF(location_type) l)
 Constructor for symbols with semantic value.
 
 ~basic_symbol ()
 Destroy the symbol.
 
void clear () YY_NOEXCEPT
 Destroy contents, and record that is empty.
 
std::string name () const YY_NOEXCEPT
 The user-facing name of this symbol.
 
symbol_kind_type type_get () const YY_NOEXCEPT
 Backward compatibility (Bison 3.6).
 
bool empty () const YY_NOEXCEPT
 Whether empty.
 
void move (basic_symbol &s)
 Destructive move, s is emptied into this.
 

Public Attributes

value_type value
 The semantic value.
 
location_type location
 The location.
 

Private Member Functions

basic_symboloperator= (const basic_symbol &that)
 Assignment operator.
 

Detailed Description

template<typename Base>
struct SlamParser::Parser::basic_symbol< Base >

A complete symbol.

Expects its Base type to provide access to the symbol kind via kind ().

Provide access to semantic value and location.

Definition at line 305 of file bison_parser.h.

Member Typedef Documentation

◆ super_type

template<typename Base >
typedef Base SlamParser::Parser::basic_symbol< Base >::super_type

Alias to Base.

Definition at line 307 of file bison_parser.h.

Constructor & Destructor Documentation

◆ basic_symbol() [1/4]

template<typename Base >
SlamParser::Parser::basic_symbol< Base >::basic_symbol ( )
inline

Default constructor.

Definition at line 310 of file bison_parser.h.

310: value(), location() {}
value_type value
The semantic value.
location_type location
The location.

◆ basic_symbol() [2/4]

template<typename Base >
SlamParser::Parser::basic_symbol< Base >::basic_symbol ( const basic_symbol< Base > &  that)

Copy constructor.

Definition at line 176 of file bison_parser.cpp.

177 : Base(that), value(that.value), location(that.location) {}

◆ basic_symbol() [3/4]

template<typename Base >
SlamParser::Parser::basic_symbol< Base >::basic_symbol ( typename Base::kind_type  t,
YY_MOVE_REF(location_type l 
)

Constructor for valueless symbols.

Definition at line 181 of file bison_parser.cpp.

183 : Base(t), value(), location(l) {}

◆ basic_symbol() [4/4]

template<typename Base >
SlamParser::Parser::basic_symbol< Base >::basic_symbol ( typename Base::kind_type  t,
YY_RVREF(value_type v,
YY_RVREF(location_type l 
)

Constructor for symbols with semantic value.

Definition at line 186 of file bison_parser.cpp.

189 : Base(t), value(YY_MOVE(v)), location(YY_MOVE(l)) {}
#define YY_MOVE

◆ ~basic_symbol()

template<typename Base >
SlamParser::Parser::basic_symbol< Base >::~basic_symbol ( )
inline

Destroy the symbol.

Definition at line 330 of file bison_parser.h.

330{ clear(); }
void clear() YY_NOEXCEPT
Destroy contents, and record that is empty.

Member Function Documentation

◆ clear()

template<typename Base >
void SlamParser::Parser::basic_symbol< Base >::clear ( )
inline

Destroy contents, and record that is empty.

Definition at line 333 of file bison_parser.h.

333{ Base::clear(); }

Referenced by SlamParser::Parser::parse().

◆ empty()

template<typename Base >
bool SlamParser::Parser::basic_symbol< Base >::empty ( ) const

◆ move()

template<typename Base >
void SlamParser::Parser::basic_symbol< Base >::move ( basic_symbol< Base > &  s)

Destructive move, s is emptied into this.

Definition at line 203 of file bison_parser.cpp.

203 {
204 super_type::move(s);
205 value = YY_MOVE(s.value);
206 location = YY_MOVE(s.location);
207}

References SlamParser::Parser::basic_symbol< Base >::location, SlamParser::Parser::basic_symbol< Base >::value, and YY_MOVE.

◆ name()

template<typename Base >
std::string SlamParser::Parser::basic_symbol< Base >::name ( ) const
inline

The user-facing name of this symbol.

Definition at line 336 of file bison_parser.h.

336 {
337 return Parser::symbol_name(this->kind());
338 }
static std::string symbol_name(symbol_kind_type yysymbol)

◆ operator=()

template<typename Base >
basic_symbol & SlamParser::Parser::basic_symbol< Base >::operator= ( const basic_symbol< Base > &  that)
private

Assignment operator.

◆ type_get()

template<typename Base >
Parser::symbol_kind_type SlamParser::Parser::basic_symbol< Base >::type_get ( ) const

Backward compatibility (Bison 3.6).

Definition at line 192 of file bison_parser.cpp.

193 {
194 return this->kind();
195}

Member Data Documentation

◆ location

template<typename Base >
location_type SlamParser::Parser::basic_symbol< Base >::location

◆ value

template<typename Base >
value_type SlamParser::Parser::basic_symbol< Base >::value

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