diff options
| author | Nagi5Yeq <wu@x-nagi.com> | 2020-05-13 00:40:23 +0800 |
|---|---|---|
| committer | Nagi5Yeq <wu@x-nagi.com> | 2020-05-13 00:40:23 +0800 |
| commit | c7d52437db42232d98e585a52ed2fdf75eb7f1af (patch) | |
| tree | 46f6c75f49de6c53937b53266fcf153cc0f8c510 /Lexer.hh | |
| parent | 61d670dda6f95aa414b4ea4a7dcaba25890b9e6b (diff) | |
code refactoring
Diffstat (limited to 'Lexer.hh')
| -rw-r--r-- | Lexer.hh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Lexer.hh b/Lexer.hh new file mode 100644 index 0000000..1558d14 --- /dev/null +++ b/Lexer.hh @@ -0,0 +1,21 @@ +#ifndef PCC_LEXER_H +#define PCC_LEXER_H + +#include "Node.hh" +#include "Parser.hh" + +#define YY_DECL pcc::Parser::symbol_type yylex(pcc::Driver& driver) + +YY_DECL; + +namespace pcc { +namespace Lexer { +Parser::symbol_type make_STRING_LITERAL(char* s, pcc::Driver& driver, + const Parser::location_type& loc) { + return Parser::make_STRING_LITERAL( + std::make_shared<StringLiteralNode>(&driver, s), loc); +} +} // namespace Lexer +} // namespace pcc + +#endif // !PCC_LEXER_H |
