g2o
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
SlamParser::location Class Reference

Two points in a source file. More...

#include <location.hh>

Collaboration diagram for SlamParser::location:
Collaboration graph
[legend]

Public Types

typedef position::filename_type filename_type
 Type for file name.
 
typedef position::counter_type counter_type
 Type for line and column numbers.
 

Public Member Functions

 location (const position &b, const position &e)
 Construct a location from b to e.
 
 location (const position &p=position())
 Construct a 0-width location in p.
 
 location (filename_type *f, counter_type l=1, counter_type c=1)
 Construct a 0-width location in f, l, c.
 
void initialize (filename_type *f=YY_NULLPTR, counter_type l=1, counter_type c=1)
 Initialization.
 
Line and Column related manipulators
void step ()
 Reset initial location to final location.
 
void columns (counter_type count=1)
 Extend the current location to the COUNT next columns.
 
void lines (counter_type count=1)
 Extend the current location to the COUNT next lines.
 

Public Attributes

position begin
 Beginning of the located region.
 
position end
 End of the located region.
 

Detailed Description

Two points in a source file.

Definition at line 142 of file location.hh.

Member Typedef Documentation

◆ counter_type

Type for line and column numbers.

Definition at line 147 of file location.hh.

◆ filename_type

Type for file name.

Definition at line 145 of file location.hh.

Constructor & Destructor Documentation

◆ location() [1/3]

SlamParser::location::location ( const position b,
const position e 
)
inline

Construct a location from b to e.

Definition at line 150 of file location.hh.

150: begin(b), end(e) {}
position end
End of the located region.
Definition location.hh:183
position begin
Beginning of the located region.
Definition location.hh:181

Referenced by SlamParser::Parser::context::location().

◆ location() [2/3]

SlamParser::location::location ( const position p = position())
inlineexplicit

Construct a 0-width location in p.

Definition at line 153 of file location.hh.

153: begin(p), end(p) {}

◆ location() [3/3]

SlamParser::location::location ( filename_type f,
counter_type  l = 1,
counter_type  c = 1 
)
inlineexplicit

Construct a 0-width location in f, l, c.

Definition at line 156 of file location.hh.

157 : begin(f, l, c), end(f, l, c) {}

Member Function Documentation

◆ columns()

void SlamParser::location::columns ( counter_type  count = 1)
inline

Extend the current location to the COUNT next columns.

Definition at line 173 of file location.hh.

173{ end += count; }

References end.

Referenced by SlamParser::operator+=().

◆ initialize()

void SlamParser::location::initialize ( filename_type f = YY_NULLPTR,
counter_type  l = 1,
counter_type  c = 1 
)
inline

Initialization.

Definition at line 160 of file location.hh.

161 {
162 begin.initialize(f, l, c);
163 end = begin;
164 }
void initialize(filename_type *fn=YY_NULLPTR, counter_type l=1, counter_type c=1)
Initialization.
Definition location.hh:73

References begin, end, and SlamParser::position::initialize().

◆ lines()

void SlamParser::location::lines ( counter_type  count = 1)
inline

Extend the current location to the COUNT next lines.

Definition at line 176 of file location.hh.

176{ end.lines(count); }
void lines(counter_type count=1)
(line related) Advance to the COUNT next lines.
Definition location.hh:83

References end, and SlamParser::position::lines().

◆ step()

void SlamParser::location::step ( )
inline

Reset initial location to final location.

Definition at line 170 of file location.hh.

170{ begin = end; }

References begin, and end.

Member Data Documentation

◆ begin

position SlamParser::location::begin

Beginning of the located region.

Definition at line 181 of file location.hh.

Referenced by initialize(), SlamParser::Parser::parse(), and step().

◆ end

position SlamParser::location::end

End of the located region.

Definition at line 183 of file location.hh.

Referenced by columns(), initialize(), lines(), SlamParser::operator+=(), SlamParser::Parser::parse(), and step().


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