Vcsn  2.5.dev
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...
 
 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...
 
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...
 
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

◆ position() [1/2]

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.

◆ position() [2/2]

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

◆ add_() [1/2]

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(), and initialize().

◆ add_() [2/2]

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.

References vcsn::rat::operator!=(), vcsn::rat::operator+(), vcsn::rat::operator+=(), vcsn::rat::operator-(), vcsn::rat::operator-=(), vcsn::rat::operator==(), and vcsn::res.

Here is the call graph for this function:

◆ columns() [1/2]

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_(), column, and filename.

Here is the call graph for this function:

◆ columns() [2/2]

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_(), column, filename, and line.

Here is the call graph for this function:

◆ initialize() [1/2]

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 add_(), column, filename, line, lines(), and vcsn::u().

Here is the call graph for this function:

◆ initialize() [2/2]

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 add_(), column, filename, line, lines(), and vcsn::u().

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

Here is the call graph for this function:

◆ lines() [1/2]

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.

◆ lines() [2/2]

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 initialize(), and vcsn::rat::location::lines().

Member Data Documentation

◆ column

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

Current column number.

Definition at line 105 of file position.hh.

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

◆ filename

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

File name to which this position refers.

Definition at line 101 of file position.hh.

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

◆ line

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

Current line number.

Definition at line 103 of file position.hh.

Referenced by columns(), and initialize().


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