ARTS
1.0.222
|
A smart class to hold the text for parsing. More...
#include <parser.h>
Public Member Functions | |
SourceText () | |
Default constructor. More... | |
void | AppendFile (const String &name) |
Appends contents of file to the source text. More... | |
char | Current () |
Return the current character. More... | |
void | AdvanceChar () |
Advance position pointer by one character. More... | |
void | AdvanceLine () |
Advances position pointer by one line. More... | |
const String & | File () |
Return the filename associated with the current position. More... | |
Index | Line () |
Return the line number, but for the file that is associated with the current position. More... | |
Index | Column () |
Return the current column. More... | |
void | Init () |
This sets the pointer to the first existing character in the text. More... | |
bool & | LineBreak () |
Read the line break flag. More... | |
bool | LineBreak () const |
Const version of LineBreak. More... | |
Private Attributes | |
ArrayOfString | mText |
The text. More... | |
Index | mLine |
Line position in the text. More... | |
Index | mColumn |
Column position in the text. More... | |
ArrayOfIndex | mSfLine |
Remember where which source file starts. More... | |
ArrayOfString | mSfName |
Names associated with. More... | |
bool | mLineBreak |
Is set to true if the last operation caused a line break. More... | |
Friends | |
ostream & | operator<< (ostream &os, const SourceText &text) |
Output operator for SourceText. More... | |
A smart class to hold the text for parsing.
A variable of this class can hold not only the text of the ARTS Control file, but also a position in the text. This is handy for parsing. There is also a function to return the current character and functions to advance the position. (AdvanceChar advances the position to the next character, doing a line break if necessary; AdvanceLine goes to the next line.)
mLine and mColumn are 0 based, but Line and Column are 1 based.
void SourceText::AdvanceChar | ( | ) |
void SourceText::AdvanceLine | ( | ) |
void SourceText::AppendFile | ( | const String & | name | ) |
Appends contents of file to the source text.
|
inline |
|
inline |
const String & SourceText::File | ( | ) |
void SourceText::Init | ( | ) |
Index SourceText::Line | ( | ) |
|
inline |
|
inline |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |