g2o
Loading...
Searching...
No Matches
Classes | Enumerations | Functions
SlamParser Namespace Reference

Classes

class  AbstractSlamInterface
 interface for communicating with the SLAM algorithm More...
 
class  AddEdge
 
class  AddNode
 
class  CommandNode
 
class  Driver
 
class  FixNode
 
class  location
 Two points in a source file. More...
 
class  Parser
 A Bison parser. More...
 
class  ParserInterface
 top-level interface to the parser More...
 
class  position
 A point in a source file. More...
 
class  QueryState
 
class  Scanner
 
class  SlamContext
 
class  SlamContextInterface
 
class  SolveSate
 

Enumerations

enum  CommandType {
  CT_ADD_NODE , CT_ADD_EDGE , CT_SOLVE_STATE , CT_QUERY_STATE ,
  CT_FIX
}
 

Functions

positionoperator+= (position &res, position::counter_type width)
 Add width columns, in place.
 
position operator+ (position res, position::counter_type width)
 Add width columns.
 
positionoperator-= (position &res, position::counter_type width)
 Subtract width columns, in place.
 
position operator- (position res, position::counter_type width)
 Subtract width columns.
 
template<typename YYChar >
std::basic_ostream< YYChar > & operator<< (std::basic_ostream< YYChar > &ostr, const position &pos)
 Intercept output stream redirection.
 
locationoperator+= (location &res, const location &end)
 Join two locations, in place.
 
location operator+ (location res, const location &end)
 Join two locations.
 
locationoperator+= (location &res, location::counter_type width)
 Add width columns to the end position, in place.
 
location operator+ (location res, location::counter_type width)
 Add width columns to the end position.
 
locationoperator-= (location &res, location::counter_type width)
 Subtract width columns to the end position, in place.
 
location operator- (location res, location::counter_type width)
 Subtract width columns to the end position.
 
template<typename YYChar >
std::basic_ostream< YYChar > & operator<< (std::basic_ostream< YYChar > &ostr, const location &loc)
 Intercept output stream redirection.
 

Enumeration Type Documentation

◆ CommandType

Enumerator
CT_ADD_NODE 
CT_ADD_EDGE 
CT_SOLVE_STATE 
CT_QUERY_STATE 
CT_FIX 

Definition at line 35 of file commands.h.

35 {
40 CT_FIX,
41};
@ CT_ADD_EDGE
Definition commands.h:37
@ CT_ADD_NODE
Definition commands.h:36
@ CT_QUERY_STATE
Definition commands.h:39
@ CT_SOLVE_STATE
Definition commands.h:38

Function Documentation

◆ operator+() [1/3]

location SlamParser::operator+ ( location  res,
const location end 
)
inline

Join two locations.

Definition at line 193 of file location.hh.

193 {
194 return res += end;
195}

◆ operator+() [2/3]

location SlamParser::operator+ ( location  res,
location::counter_type  width 
)
inline

Add width columns to the end position.

Definition at line 204 of file location.hh.

204 {
205 return res += width;
206}

◆ operator+() [3/3]

position SlamParser::operator+ ( position  res,
position::counter_type  width 
)
inline

Add width columns.

Definition at line 116 of file location.hh.

116 {
117 return res += width;
118}

◆ operator+=() [1/3]

location & SlamParser::operator+= ( location res,
const location end 
)
inline

Join two locations, in place.

Definition at line 187 of file location.hh.

187 {
188 res.end = end.end;
189 return res;
190}
position end
End of the located region.
Definition location.hh:183

References SlamParser::location::end.

◆ operator+=() [2/3]

location & SlamParser::operator+= ( location res,
location::counter_type  width 
)
inline

Add width columns to the end position, in place.

Definition at line 198 of file location.hh.

198 {
199 res.columns(width);
200 return res;
201}
void columns(counter_type count=1)
Extend the current location to the COUNT next columns.
Definition location.hh:173

References SlamParser::location::columns().

◆ operator+=() [3/3]

position & SlamParser::operator+= ( position res,
position::counter_type  width 
)
inline

Add width columns, in place.

Definition at line 110 of file location.hh.

110 {
111 res.columns(width);
112 return res;
113}
void columns(counter_type count=1)
(column related) Advance to the COUNT next columns.
Definition location.hh:91

References SlamParser::position::columns().

◆ operator-() [1/2]

location SlamParser::operator- ( location  res,
location::counter_type  width 
)
inline

Subtract width columns to the end position.

Definition at line 214 of file location.hh.

214 {
215 return res -= width;
216}

◆ operator-() [2/2]

position SlamParser::operator- ( position  res,
position::counter_type  width 
)
inline

Subtract width columns.

Definition at line 126 of file location.hh.

126 {
127 return res -= width;
128}

◆ operator-=() [1/2]

location & SlamParser::operator-= ( location res,
location::counter_type  width 
)
inline

Subtract width columns to the end position, in place.

Definition at line 209 of file location.hh.

209 {
210 return res += -width;
211}

◆ operator-=() [2/2]

position & SlamParser::operator-= ( position res,
position::counter_type  width 
)
inline

Subtract width columns, in place.

Definition at line 121 of file location.hh.

121 {
122 return res += -width;
123}

◆ operator<<() [1/2]

template<typename YYChar >
std::basic_ostream< YYChar > & SlamParser::operator<< ( std::basic_ostream< YYChar > &  ostr,
const location loc 
)

Intercept output stream redirection.

Parameters
ostrthe destination output stream
loca reference to the location to redirect

Avoid duplicate information.

Definition at line 214 of file location.hh.

226 {
227 location::counter_type end_col = 0 < loc.end.column ? loc.end.column - 1 : 0;
228 ostr << loc.begin;
229 if (loc.end.filename &&
230 (!loc.begin.filename || *loc.begin.filename != *loc.end.filename))
231 ostr << '-' << loc.end.filename << ':' << loc.end.line << '.' << end_col;
232 else if (loc.begin.line < loc.end.line)
233 ostr << '-' << loc.end.line << '.' << end_col;
234 else if (loc.begin.column < end_col)
235 ostr << '-' << end_col;
236 return ostr;
237}
position::counter_type counter_type
Type for line and column numbers.
Definition location.hh:147
position begin
Beginning of the located region.
Definition location.hh:181
filename_type * filename
File name to which this position refers.
Definition location.hh:95
counter_type column
Current column number.
Definition location.hh:99
counter_type line
Current line number.
Definition location.hh:97

◆ operator<<() [2/2]

template<typename YYChar >
std::basic_ostream< YYChar > & SlamParser::operator<< ( std::basic_ostream< YYChar > &  ostr,
const position pos 
)

Intercept output stream redirection.

Parameters
ostrthe destination output stream
posa reference to the position to redirect

Definition at line 126 of file location.hh.

136 {
137 if (pos.filename) ostr << *pos.filename << ':';
138 return ostr << pos.line << '.' << pos.column;
139}