#include <scannerbase.h>
Collaboration diagram for PREFIX_FlexScannerBase:
Public Member Functions | |
ssize_t | _yy_input (char *buf, size_t max_size) |
Called by the lexer to get more input. | |
PREFIX_FlexScannerBase () | |
virtual | ~PREFIX_FlexScannerBase () |
Protected Member Functions | |
void | _pi_tok (size_t l) |
To be called after having read a token which does not contain a newline. | |
void | _pi_tab () |
To be called when "eating" a tab character. | |
void | _pi_line () |
To be called after having read a newline. | |
void | _pi_char (char c) |
To be called after having read the passed character. | |
void | _pi_str (const char *str, size_t len) |
To be called after having read the passed string which possibly contains special chars (newline, tab, return). | |
void | _pi_start () |
Make current pos the beginning of a token. Call after whitespace and comments. | |
void | _pi_eof () |
Called when EOF (on current input) is "read". | |
SCLocation | _MakeCurrLoc () const |
Get current (start) location as SCLocation. | |
SCLocation | _MakeCurrEndLoc () const |
Get current start location as SCLocation. | |
SCLocationRange | _MakeCurrLocRange () const |
Get current location range as SCLocationRange. | |
virtual ssize_t | ReadInput (char *buf, size_t max_size) |
Read more input to be fed into the lexer. | |
virtual TokenEntry * | AllocTokenEntry () |
Allocate a new TokenEntry. | |
void | _RawYYLex (TokenEntry *dest) |
Raw lexing routine as provided by flex(1). | |
void | _reset () |
PREFIX_FlexScannerBase (const PREFIX_FlexScannerBase &) | |
Do not use. | |
void | operator= (const PREFIX_FlexScannerBase &) |
Do not use. | |
Protected Attributes | |
uint32 | magic |
For simple detection of memory corruption or evil pointer mess. | |
void * | scanner |
The scanner used for scanning; only one; NULL if inactive. | |
TokenEntry * | lex_token |
int | file_depth |
Current include hierarchy depth:. | |
int | n_errors |
Accumulate number of errors. | |
XYPos | p0 |
Current token: start position; while parsing: previous position. | |
XYPos | p1 |
Current token: end position; while parsing: current position. | |
SourcePositionArchive * | pos_arch |
Used to generate source position objects; see there. | |
bool | pos_arch_allocated |
bool | loc_use_lpos |
int | tab_width |
(Config:) Tab with in number of characters for correct lpos. | |
Static Protected Attributes | |
const uint32 | MyMagic = 0xdeadbeefU |
What the magic value should be:. | |
Friends | |
int | PREFIX_lex (void *) |
In order to attach some information to the token (such as the read integer value or the YYSTYPE union in bison-based parsers, use a type derived from TokenEntry and supply a suitable AllocTokenEntry() function and implement the TokenEntry::MayBeCleared() function as well as TokenEntry::clear()!
Class is (of couse) not C++-safe.
Definition at line 117 of file scannerbase.h.
|
Do not use.
|
|
|
|
|
|
Get current start location as SCLocation.
Definition at line 241 of file scannerbase.h. References SourcePositionArchive::GetPos(), PREFIX_FlexScannerBase::XYPos::line, loc_use_lpos, PREFIX_FlexScannerBase::XYPos::lpos, p1, and pos_arch. Referenced by _MakeCurrLocRange(). |
|
Get current (start) location as SCLocation.
Definition at line 237 of file scannerbase.h. References SourcePositionArchive::GetPos(), PREFIX_FlexScannerBase::XYPos::line, loc_use_lpos, PREFIX_FlexScannerBase::XYPos::lpos, p0, and pos_arch. Referenced by _MakeCurrLocRange(). |
|
Get current location range as SCLocationRange.
Definition at line 245 of file scannerbase.h. References _MakeCurrEndLoc(), and _MakeCurrLoc(). |
|
To be called after having read the passed character.
|
|
Called when EOF (on current input) is "read".
|
|
To be called after having read a newline.
Definition at line 215 of file scannerbase.h. References PREFIX_FlexScannerBase::XYPos::line, PREFIX_FlexScannerBase::XYPos::lpos, and p1. |
|
Make current pos the beginning of a token. Call after whitespace and comments.
Definition at line 224 of file scannerbase.h. |
|
To be called after having read the passed string which possibly contains special chars (newline, tab, return).
|
|
To be called when "eating" a tab character.
Definition at line 212 of file scannerbase.h. References PREFIX_FlexScannerBase::XYPos::lpos, p1, and tab_width. |
|
To be called after having read a token which does not contain a newline.
Definition at line 209 of file scannerbase.h. References PREFIX_FlexScannerBase::XYPos::lpos, and p1. |
|
Raw lexing routine as provided by flex(1). Only some additional code is added for position handling. Token is stored in passed token entry struct. |
|
Reset scanner; like after construction but not changing config/tuning. |
|
Called by the lexer to get more input.
Definition at line 232 of file scannerbase.h. References ReadInput(), and ssize_t. |
|
Allocate a new TokenEntry. This must be overridden if you use your own derived version. |
|
Do not use.
|
|
Read more input to be fed into the lexer. See also _yy_input(). There is a suitable default implementation for the streams and normally no need to re-implement this.
Referenced by _yy_input(). |
|
|
|
Current include hierarchy depth:.
Definition at line 181 of file scannerbase.h. |
|
Exclusively used to pass current TokenEntry() to the flex-based lex() routine (yylex); may be accessed to get access to token information (e.g. put parsed integer value of integer token there). Definition at line 178 of file scannerbase.h. |
|
(Config:) Use lpos (position in line) in postition objects? (Using "no" here will decrease memory footprint.) Definition at line 200 of file scannerbase.h. Referenced by _MakeCurrEndLoc(), and _MakeCurrLoc(). |
|
For simple detection of memory corruption or evil pointer mess.
Definition at line 166 of file scannerbase.h. |
|
What the magic value should be:.
Definition at line 168 of file scannerbase.h. |
|
Accumulate number of errors.
Definition at line 184 of file scannerbase.h. |
|
Current token: start position; while parsing: previous position.
Definition at line 187 of file scannerbase.h. Referenced by _MakeCurrLoc(), and _pi_start(). |
|
Current token: end position; while parsing: current position.
Definition at line 189 of file scannerbase.h. Referenced by _MakeCurrEndLoc(), _pi_line(), _pi_start(), _pi_tab(), and _pi_tok(). |
|
Used to generate source position objects; see there.
Definition at line 192 of file scannerbase.h. Referenced by _MakeCurrEndLoc(), and _MakeCurrLoc(). |
|
If _we_ allocated the pos archive or if it was passed to us via some input setting function. Definition at line 196 of file scannerbase.h. |
|
The scanner used for scanning; only one; NULL if inactive.
Definition at line 173 of file scannerbase.h. |
|
(Config:) Tab with in number of characters for correct lpos.
Definition at line 203 of file scannerbase.h. Referenced by _pi_tab(). |