-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscanner.hh
43 lines (33 loc) · 871 Bytes
/
scanner.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*If FlexLexer.h has not been included before */
#if !defined(yyFlexLexerOnce)
#include <FlexLexer.h>
#endif
// parser.tab.hh defines
// struct token
// {
// enum yytokentype
// {
// MNEMONIC = 258,
// SYMBOL = 259,
// ...
#include "parser.tab.hh"
#include "location.hh"
namespace IPL
{
class Scanner : public yyFlexLexer
{
public:
Scanner(std::istream& in) : yyFlexLexer(in, std::cout)
{
loc = new IPL::Parser::location_type();
};
virtual int yylex(IPL::Parser::semantic_type *const lval,
IPL::Parser::location_type *location);
private:
/* yyval ptr */
IPL::Parser::semantic_type *yylval = NULL;
/* location ptr */
IPL::Parser::location_type *loc = NULL;
};
} /* end namespace IPL */
//#endif /* END __IPLSCANNER_HPP__ */