torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::position Class Reference

Abstract a position. More...

#include <position.hh>

Public Member Functions

 position ()
 Construct a position. More...
 
void initialize (std::string *fn)
 Initialization. More...
 
 position ()
 Construct a position. More...
 
void initialize (std::string *fn)
 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...
 

Data Fields

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...
 

Detailed Description

Abstract a position.

Definition at line 49 of file bitstream/assembler/lut/position.hh.

Constructor & Destructor Documentation

torc::position::position ( )
inline

Construct a position.

Definition at line 54 of file bitstream/assembler/lut/position.hh.

55  : filename (0), line (1), column (0)
56  {
57  }
unsigned int line
Current line number.
std::string * filename
File name to which this position refers.
unsigned int column
Current column number.
torc::position::position ( )
inline

Construct a position.

Definition at line 54 of file physical/xdl/position.hh.

55  : filename (0), line (1), column (0)
56  {
57  }
unsigned int line
Current line number.
std::string * filename
File name to which this position refers.
unsigned int column
Current column number.

Member Function Documentation

void torc::position::columns ( int  count = 1)
inline

(column related) Advance to the COUNT next columns.

Definition at line 79 of file bitstream/assembler/lut/position.hh.

80  {
81  int leftmost = 0;
82  int current = column;
83  if (leftmost <= current + count)
84  column += count;
85  else
86  column = 0;
87  }
unsigned int column
Current column number.

+ Here is the caller graph for this function:

void torc::position::columns ( int  count = 1)
inline

(column related) Advance to the COUNT next columns.

Definition at line 79 of file physical/xdl/position.hh.

80  {
81  int leftmost = 0;
82  int current = column;
83  if (leftmost <= current + count)
84  column += count;
85  else
86  column = 0;
87  }
unsigned int column
Current column number.
void torc::position::initialize ( std::string *  fn)
inline

Initialization.

Definition at line 61 of file physical/xdl/position.hh.

62  {
63  filename = fn;
64  line = 1;
65  column = 0;
66  }
unsigned int line
Current line number.
std::string * filename
File name to which this position refers.
unsigned int column
Current column number.
void torc::position::initialize ( std::string *  fn)
inline

Initialization.

Definition at line 61 of file bitstream/assembler/lut/position.hh.

62  {
63  filename = fn;
64  line = 1;
65  column = 0;
66  }
unsigned int line
Current line number.
std::string * filename
File name to which this position refers.
unsigned int column
Current column number.

+ Here is the caller graph for this function:

void torc::position::lines ( int  count = 1)
inline

(line related) Advance to the COUNT next lines.

Definition at line 72 of file bitstream/assembler/lut/position.hh.

73  {
74  column = 0;
75  line += count;
76  }
unsigned int line
Current line number.
unsigned int column
Current column number.

+ Here is the caller graph for this function:

void torc::position::lines ( int  count = 1)
inline

(line related) Advance to the COUNT next lines.

Definition at line 72 of file physical/xdl/position.hh.

73  {
74  column = 0;
75  line += count;
76  }
unsigned int line
Current line number.
unsigned int column
Current column number.

Field Documentation

unsigned int torc::position::column

Current column number.

Definition at line 96 of file bitstream/assembler/lut/position.hh.

std::string * torc::position::filename

File name to which this position refers.

Definition at line 92 of file bitstream/assembler/lut/position.hh.

unsigned int torc::position::line

Current line number.

Definition at line 94 of file bitstream/assembler/lut/position.hh.


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