Base class for token scanning strategies. More...
#include <tokenScan.hpp>
Public Member Functions | |
| virtual nint | onScan (parser &ps, YYSTYPE *yylval, YYLTYPE *loc, yyscan_t yyscanner, nbool &isBypass) override |
| Pure virtual method for concrete token scanning implementations. | |
| nint | onScan (parser &ps, YYSTYPE *val, YYLTYPE *loc, yyscan_t scanner) |
| Default entry point for token scanning. | |
| virtual nint | onScan (parser &ps, YYSTYPE *yylval, YYLTYPE *loc, yyscan_t yyscanner, nbool &isBypass)=0 |
| Pure virtual method for concrete token scanning implementations. | |
Public Member Functions inherited from by::tokenScanable | |
| nint | onScan (parser &ps, YYSTYPE *val, YYLTYPE *loc, yyscan_t scanner) |
| Default entry point for token scanning. | |
Public Member Functions inherited from by::typeProvidable | |
| nbool | operator== (const me &rhs) const |
| nbool | operator!= (const me &rhs) const |
| virtual const type & | getType () const =0 |
| nbool | isSub (const type &it) const |
| nbool | isSub (const type *it) const BY_SIDE_FUNC(isSub) |
| nbool | isSub (const me &it) const |
| nbool | isSub (const me *it) const BY_SIDE_FUNC(isSub) |
| nbool | isSuper (const type &it) const |
| nbool | isSuper (const type *it) const BY_SIDE_FUNC(isSuper) |
| nbool | isSuper (const me &it) const |
| nbool | isSuper (const me *it) const BY_SIDE_FUNC(isSuper) |
| template<typename T > | |
| nint | isSub () const |
| template<typename T > | |
| nint | isSuper () const |
| template<typename T > | |
| T * | cast () |
| template<typename T > | |
| const T * | cast () const BY_CONST_FUNC(cast< T >()) virtual void *cast(const type &to) |
| Safe cast to target type using type hierarchy information. | |
| const void * | cast (const type &to) const BY_CONST_FUNC(cast(to)) void *cast(const type *it) BY_SIDE_FUNC(cast) |
Public Member Functions inherited from by::clonable | |
| virtual me * | clone () const =0 |
| virtual me * | cloneDeep () const |
| virtual void | onCloneDeep (const me &from) |
Base class for token scanning strategies.
parser dynamically switches scan modes to precisely measure indentation as mentioned in its documentation. tokenScan represents one such scan mode strategy.
Among tokens, there are command tokens like SCAN_AGAIN and SCAN_EXIT that give commands to the scanner or parser. See the // mode: section in the middle of lowparser.y for details.
In the case of IndentScan, most tokens are ignored and it focuses only on counting how many spaces there are. However, if multiple tokens were pushed from the previous line, it operates in bypass mode internally. In this case, it skips the indentation counting operation and reads and returns the stored tokens as is.
Default entry point for token scanning.
This non-virtual method acts as a wrapper that internally dispatches to the pure virtual onScan method, which must be implemented by concrete scanner strategies.
| ps | The parser instance. |
| val | The YYSTYPE value pointer for the token. |
| loc | The YYLTYPE location pointer for the token. |
| scanner | The Flex scanner instance. |
|
overridevirtual |
Pure virtual method for concrete token scanning implementations.
| ps | The parser instance. |
| yylval | The YYSTYPE value pointer for the token. |
| loc | The YYLTYPE location pointer for the token. |
| yyscanner | The Flex scanner instance. |
| isBypass | Flag indicating if indentation bypass is active. |
Implements by::tokenScanable.
Reimplemented in by::normalScan, and by::indentScan.
|
virtual |
Pure virtual method for concrete token scanning implementations.
| ps | The parser instance. |
| yylval | The YYSTYPE value pointer for the token. |
| loc | The YYLTYPE location pointer for the token. |
| yyscanner | The Flex scanner instance. |
| isBypass | Flag indicating if indentation bypass is active. |
Implements by::tokenScanable.