Spicy
scanner.h
1 // Copyright (c) 2020-2021 by the Zeek Project. See LICENSE for details.
2 //
3 // This borrows from https://idlebox.net/2007/flex-bison-cpp-example.
4 
5 #pragma once
6 
7 #include <string>
8 
9 #include <hilti/compiler/detail/parser/driver.h>
10 
12 #include <__parser.h>
13 
14 namespace hilti::detail::parser {
15 
17 class Scanner : public HiltiFlexLexer {
18 public:
19  Scanner(std::istream* yyin = nullptr, std::ostream* yyout = nullptr) : HiltiFlexLexer(yyin, yyout) {}
20 
21  hilti::detail::parser::Parser::token_type lex(hilti::detail::parser::Parser::semantic_type* yylval,
22  hilti::detail::parser::location* yylloc,
24 
25  void enablePatternMode();
26  void disablePatternMode();
27  void enableExpressionMode();
28  void disableExpressionMode();
29  void enableDottedIDMode();
30  void disableDottedIDMode();
31 };
32 
33 } // namespace hilti::detail::parser
Definition: scanner.h:17
Definition: driver.h:42
Definition: driver.h:48