Loading...
Searching...
No Matches
tokenScan.hpp
Go to the documentation of this file.
1
2#pragma once
3
5
6typedef union YYSTYPE YYSTYPE;
7typedef struct lloc YYLTYPE;
8typedef void* yyscan_t;
9
10namespace by {
11
12 class parser;
13 class tokenDispatcher;
14
29 class _nout tokenScan: public tokenScanable, public typeProvidable, public clonable {
30 BY(ADT(tokenScan))
31
32 public:
33 using tokenScanable::onScan;
34 virtual nint onScan(parser& ps, YYSTYPE* yylval, YYLTYPE* loc, yyscan_t yyscanner,
35 nbool& isBypass) override;
36 };
37
43 class _nout normalScan: public tokenScan {
45
46 public:
47 using super::onScan;
48 nint onScan(parser& ps, YYSTYPE* yylval, YYLTYPE* loc, yyscan_t yyscanner,
49 nbool& isBypass) override;
50
51 public:
52 static normalScan instance;
53 };
54
60 class _nout indentScan: public tokenScan {
62
63 public:
64 using super::onScan;
65 nint onScan(parser& ps, YYSTYPE* yylval, YYLTYPE* loc, yyscan_t yyscanner,
66 nbool& isBypass) override;
67
68 private:
69 nint _onIndent(parser& ev, ncnt col, nint tok);
70 nint _onDedent(parser& ev, ncnt col, nint tok);
71
72 public:
73 static indentScan instance;
74 };
75} // namespace by
Indentation-aware token scanning mode.
Definition tokenScan.hpp:60
Normal token scanning mode.
Definition tokenScan.hpp:43
Parser for byeol language source code.
Definition parser.hpp:126
Definition tnarr.hpp:9
Base class for token scanning strategies.
Definition tokenScan.hpp:29
Interface for token scanning functionality.
Definition tokenScanable.hpp:19
to Top