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
19 class _nout tokenScan: public tokenScanable, public typeProvidable, public clonable {
20 BY(ADT(tokenScan))
21
22 public:
23 using tokenScanable::onScan;
24 virtual nint onScan(parser& ps, YYSTYPE* yylval, YYLTYPE* loc, yyscan_t yyscanner,
25 nbool& isBypass) override;
26
27 private:
28 nbool _useSmartDedent;
29 };
30
35 class _nout normalScan: public tokenScan {
36 BY(CLASS(normalScan, tokenScan))
37 friend class parser;
38
39 public:
40 using super::onScan;
41 nint onScan(parser& ps, YYSTYPE* yylval, YYLTYPE* loc, yyscan_t yyscanner,
42 nbool& isBypass) override;
43
44 private:
45 static normalScan* _instance;
46 };
47
52 class _nout indentScan: public tokenScan {
53 BY(CLASS(indentScan, tokenScan))
54 friend class parser;
55
56 public:
57 using super::onScan;
58 nint onScan(parser& ps, YYSTYPE* yylval, YYLTYPE* loc, yyscan_t yyscanner,
59 nbool& isBypass) override;
60
61 private:
62 nint _onIndent(parser& ev, ncnt col, nint tok);
63 nint _onDedent(parser& ev, ncnt col, nint tok);
64
65 private:
66 static indentScan* _instance;
67 };
68} // namespace by
Interface for objects that can be cloned.
Definition: clonable.hpp:12
Indentation-aware token scanning mode.
Definition: tokenScan.hpp:52
Normal token scanning mode.
Definition: tokenScan.hpp:35
Parser for byeol language source code.
Definition: parser.hpp:43
Base class for token scanning strategies.
Definition: tokenScan.hpp:19
Interface for token scanning functionality.
Definition: tokenScanable.hpp:18
Interface for objects that can provide their type information.
Definition: typeProvidable.hpp:12