Base class for token scanning strategies. More...
#include <stelaTokenScan.hpp>
Public Member Functions | |
| virtual nint | onScan (stelaParser &ps, ZZSTYPE *yylval, ZZLTYPE *loc, zzscan_t yyscanner, nbool &isBypass) override |
| Pure virtual method for concrete token scanning implementations. | |
| nint | onScan (stelaParser &ps, ZZSTYPE *val, ZZLTYPE *loc, zzscan_t scanner) |
| Default entry point for token scanning. | |
| virtual nint | onScan (stelaParser &ps, ZZSTYPE *yylval, ZZLTYPE *loc, zzscan_t yyscanner, nbool &isBypass)=0 |
| Pure virtual method for concrete token scanning implementations. | |
Public Member Functions inherited from by::stelaTokenScanable | |
| nint | onScan (stelaParser &ps, ZZSTYPE *val, ZZLTYPE *loc, zzscan_t scanner) |
| Default entry point for token scanning. | |
Base class for token scanning strategies.
As mentioned in stelaParser, the parser must dynamically change scan mode to precisely measure indentation. tokenScan handles one such scan mode strategy.
Among tokens exist command tokens like SCAN_AGAIN, SCAN_EXIT that give commands to the scanner or parser. See zztokenType enum in stelaParser.hpp for details.
IndentScan ignores most tokens and focuses solely on counting whitespace. However, if multiple tokens were pushed from the previous line, it operates in bypass mode internally. During this time, it skips indentation counting and simply reads and returns the stored tokens.
| nint by::stelaTokenScanable::onScan | ( | stelaParser & | ps, |
| ZZSTYPE * | val, | ||
| ZZLTYPE * | loc, | ||
| zzscan_t | scanner ) |
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 stelaParser 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 stelaParser 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::stelaTokenScanable.
Reimplemented in by::stelaNormalScan, and by::stelaIndentScan.
|
virtual |
Pure virtual method for concrete token scanning implementations.
| ps | The stelaParser 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::stelaTokenScanable.