#include <simple_location.hh>
Inheritance diagram for lestes::lang::cplus::lex::simple_location:

Public Member Functions | |
| ulint | line_get (void) const |
| Returns line in file. | |
| ulint | column_get (void) const |
| Returns column on line. | |
| bool | equals (const ptr< simple_location > &rhs) const |
| Tests equality. | |
Static Public Member Functions | |
| static ptr< simple_location > | create (ulint a_line, ulint a_column) |
| Returns new object, initializes with position. | |
Protected Member Functions | |
| simple_location (ulint a_line, ulint a_column) | |
| Creates new object, initializes with postion. | |
Private Member Functions | |
| simple_location (const simple_location &) | |
| Hides copy constructor. | |
| simple_location & | operator= (const simple_location &) |
| Hides assigment operator. | |
Private Attributes | |
| ulint | line |
| Line in file. | |
| ulint | column |
| Column inside the line. | |
Contains line number and column number. The object is inmutable to help keeping invariants.
Definition at line 49 of file simple_location.hh.
| lestes::lang::cplus::lex::simple_location::simple_location | ( | ulint | a_line, | |
| ulint | a_column | |||
| ) | [protected] |
Creates new object, initializes with postion.
Creates new object, initializes with file information and position.
| a_line | The line number. | |
| a_column | The column on the line. |
Definition at line 50 of file simple_location.cc.
Referenced by create().
| lestes::lang::cplus::lex::simple_location::simple_location | ( | const simple_location & | ) | [private] |
Hides copy constructor.
| ulint lestes::lang::cplus::lex::simple_location::line_get | ( | void | ) | const |
Returns line in file.
Returns position in the file.
Definition at line 60 of file simple_location.cc.
References line.
00061 { 00062 return line; 00063 }
| ulint lestes::lang::cplus::lex::simple_location::column_get | ( | void | ) | const |
Returns column on line.
Returns position on the line.
Definition at line 69 of file simple_location.cc.
References column.
00070 { 00071 return column; 00072 }
| bool lestes::lang::cplus::lex::simple_location::equals | ( | const ptr< simple_location > & | rhs | ) | const |
Tests equality.
Tests equality to other simple_location.
| rhs | The location to compare to. |
Definition at line 78 of file simple_location.cc.
References column, lestes::is_equal(), and line.
00079 { 00080 return rhs && 00081 is_equal(line,rhs->line_get()) && 00082 is_equal(column,rhs->column_get()); 00083 }
| ptr< simple_location > lestes::lang::cplus::lex::simple_location::create | ( | ulint | a_line, | |
| ulint | a_column | |||
| ) | [static] |
Returns new object, initializes with position.
Returns new instance, initializes with position.
| a_line | The line number. | |
| a_column | The column on the line. |
Definition at line 90 of file simple_location.cc.
References simple_location().
Referenced by lestes::lang::cplus::lex::line_numbers::read().
00091 { 00092 return new simple_location(a_line,a_column); 00093 }
| simple_location& lestes::lang::cplus::lex::simple_location::operator= | ( | const simple_location & | ) | [private] |
Hides assigment operator.
ulint lestes::lang::cplus::lex::simple_location::line [private] |
Line in file.
Definition at line 64 of file simple_location.hh.
Referenced by equals(), and line_get().
ulint lestes::lang::cplus::lex::simple_location::column [private] |
Column inside the line.
Definition at line 66 of file simple_location.hh.
Referenced by column_get(), and equals().
1.5.1-20070107