Vcsn  2.3
Be Rational
vcsn::rat::position Class Reference

Abstract a position. More...

#include <position.hh>

Collaboration diagram for vcsn::rat::position:

Public Member Functions

 position (std::string *f=0, unsigned int l=1u, unsigned int c=1u)
 Construct a position. More...
 
void initialize (std::string *fn=0, unsigned int l=1u, unsigned int c=1u)
 Initialization. More...
 
Line and Column related manipulators
void lines (int count=1)
 (line related) Advance to the COUNT next lines. More...
 
void columns (int count=1)
 (column related) Advance to the COUNT next columns. More...
 

Public Attributes

std::string * filename
 File name to which this position refers. More...
 
unsigned int line
 Current line number. More...
 
unsigned int column
 Current column number. More...
 

Static Private Member Functions

static unsigned int add_ (unsigned int lhs, int rhs, unsigned int min)
 Compute max(min, lhs+rhs) (provided min <= lhs). More...
 

Detailed Description

Abstract a position.

Definition at line 57 of file position.hh.

Constructor & Destructor Documentation

vcsn::rat::position::position ( std::string *  f = 0,
unsigned int  l = 1u,
unsigned int  c = 1u 
)
inlineexplicit

Construct a position.

Definition at line 61 of file position.hh.

Member Function Documentation

static unsigned int vcsn::rat::position::add_ ( unsigned int  lhs,
int  rhs,
unsigned int  min 
)
inlinestaticprivate

Compute max(min, lhs+rhs) (provided min <= lhs).

Definition at line 109 of file position.hh.

Referenced by columns().

void vcsn::rat::position::columns ( int  count = 1)
inline

(column related) Advance to the COUNT next columns.

Definition at line 94 of file position.hh.

References add_(), and column.

Here is the call graph for this function:

void vcsn::rat::position::initialize ( std::string *  fn = 0,
unsigned int  l = 1u,
unsigned int  c = 1u 
)
inline

Initialization.

Definition at line 72 of file position.hh.

References column, filename, and line.

Referenced by vcsn::rat::location::initialize().

void vcsn::rat::position::lines ( int  count = 1)
inline

(line related) Advance to the COUNT next lines.

Definition at line 84 of file position.hh.

Referenced by vcsn::rat::location::lines().

Member Data Documentation

unsigned int vcsn::rat::position::column

Current column number.

Definition at line 105 of file position.hh.

Referenced by columns(), initialize(), and vcsn::rat::operator<<().

std::string* vcsn::rat::position::filename

File name to which this position refers.

Definition at line 101 of file position.hh.

Referenced by initialize(), and vcsn::rat::operator<<().

unsigned int vcsn::rat::position::line

Current line number.

Definition at line 103 of file position.hh.

Referenced by initialize().


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