Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

_InternalFlexScannerBase::LexerInput Struct Reference

This is interally used instead of FILE* to feed the lexer. More...

#include <scannerbase.h>

Collaboration diagram for _InternalFlexScannerBase::LexerInput:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LexerInput (LexerInput *down)
 Construct lexer input and pass "down" pointer...

 ~LexerInput ()
int OpenFile (const TLString &path, SError &error)
 Open file for input.

ssize_t read (char *buf, size_t len)
 Perform read operation:.


Public Attributes

LexerInputdown
 The LexerInput one level below:.

FILE * fp
 This is where we actually read from:.

TLString fp_path
XYPos saved
bool must_pop_state
bool must_pop_pos_arch
 Tell pos_arch (using EndFile()) when reading file done?

bool read_eof
 Did we read EOF?

int special_next_tok
LinkedList< TokenEntrynext_toks
 next tokens (read ahead)

LinkedList< TokenEntryprev_toks
 already returned tokens


Private Member Functions

 LexerInput (const LexerInput &)
 Do not use.

void operator= (const LexerInput &)
 Do not use.


Detailed Description

This is interally used instead of FILE* to feed the lexer.

Definition at line 180 of file scannerbase.h.


Constructor & Destructor Documentation

_InternalFlexScannerBase::LexerInput::LexerInput const LexerInput  )  [private]
 

Do not use.

_InternalFlexScannerBase::LexerInput::LexerInput LexerInput down  ) 
 

Construct lexer input and pass "down" pointer...

Definition at line 131 of file iscannerbase.cc.

_InternalFlexScannerBase::LexerInput::~LexerInput  ) 
 

Definition at line 146 of file iscannerbase.cc.

References _InternalFlexScannerBase::TokenEntry::clear(), Error(), LinkedList< TokenEntry >::first(), fp, LinkedList< TokenEntry >::IsEmpty(), next_toks, LinkedList< TokenEntry >::PopFirst(), prev_toks, and _InternalFlexScannerBase::TokenEntry::token.


Member Function Documentation

int _InternalFlexScannerBase::LexerInput::OpenFile const TLString path,
SError error
 

Open file for input.

File opening errors will be returned in passed SError and indicated via return value -2.

Returns:
0 -> OK
1 -> input already set (oops?)
-2 -> opening file failed; see error

Definition at line 106 of file iscannerbase.cc.

References fp, fp_path, and TLString::str().

Referenced by _InternalFlexScannerBase::SetInput().

void _InternalFlexScannerBase::LexerInput::operator= const LexerInput  )  [private]
 

Do not use.

ssize_t _InternalFlexScannerBase::LexerInput::read char *  buf,
size_t  len
 

Perform read operation:.

Returns:
read bytes, 0 on EOF, <0 on error.

Definition at line 75 of file iscannerbase.cc.

References fp, fp_path, ssize_t, and TLString::str().


Member Data Documentation

LexerInput* _InternalFlexScannerBase::LexerInput::down
 

The LexerInput one level below:.

Definition at line 183 of file scannerbase.h.

Referenced by _InternalFlexScannerBase::SetInput().

FILE* _InternalFlexScannerBase::LexerInput::fp
 

This is where we actually read from:.

Definition at line 186 of file scannerbase.h.

Referenced by OpenFile(), read(), and ~LexerInput().

TLString _InternalFlexScannerBase::LexerInput::fp_path
 

Definition at line 187 of file scannerbase.h.

Referenced by OpenFile(), and read().

bool _InternalFlexScannerBase::LexerInput::must_pop_pos_arch
 

Tell pos_arch (using EndFile()) when reading file done?

Definition at line 199 of file scannerbase.h.

bool _InternalFlexScannerBase::LexerInput::must_pop_state
 

This can be set e.g. when #including from the preprocessor because we then have to push initial state upon inclusion which needs to get popped after reading the included file to be in preprocessor state again.

Definition at line 197 of file scannerbase.h.

LinkedList<TokenEntry> _InternalFlexScannerBase::LexerInput::next_toks
 

next tokens (read ahead)

There is a little token buffer for each input: NEW toks get added at the END of next_toks. OLDEST toks are at the beginning of prev_toks.

Definition at line 212 of file scannerbase.h.

Referenced by _InternalFlexScannerBase::LexNextToken(), and ~LexerInput().

LinkedList<TokenEntry> _InternalFlexScannerBase::LexerInput::prev_toks
 

already returned tokens

Definition at line 213 of file scannerbase.h.

Referenced by _InternalFlexScannerBase::LexNextToken(), and ~LexerInput().

bool _InternalFlexScannerBase::LexerInput::read_eof
 

Did we read EOF?

Definition at line 202 of file scannerbase.h.

Referenced by _InternalFlexScannerBase::_pi_eof(), _InternalFlexScannerBase::_RawYYLex(), and _InternalFlexScannerBase::LexNextToken().

XYPos _InternalFlexScannerBase::LexerInput::saved
 

Stored position when some other LexerInput is being read from (this is not on top of the stack).

Definition at line 191 of file scannerbase.h.

int _InternalFlexScannerBase::LexerInput::special_next_tok
 

Special next token to be returned by next call to lexer function (or -1). (Can be used to bring parser into special state.)

Definition at line 207 of file scannerbase.h.

Referenced by _InternalFlexScannerBase::_RawYYLex(), and _InternalFlexScannerBase::SetInput().


The documentation for this struct was generated from the following files:
Generated on Sat Feb 19 22:35:16 2005 for Ray by doxygen 1.3.5