Debian Codegraph @

yo/concrete/lexer/scanner/scanner.h

raw
1 // Generated by Flexc++ V0.94.00 on Thu, 23 Feb 2012 16:23:09 +0100
2
3 #ifndef Scanner_H_INCLUDED_
4 #define Scanner_H_INCLUDED_
5
6 // $insert baseclass_h
7 #include "scannerbase.h"
8
9 // $insert classHead
10 class Scanner: public ScannerBase
11 {
12 std::string d_nextSource;
13
14 public:
15 explicit Scanner(std::istream &in = std::cin,
16 std::ostream &out = std::cout);
17
18 Scanner(std::string const &infile, std::string const &outfile);
19
20 // $insert lexFunctionDecl
21 int lex();
22
23 private:
24 int lex__();
25 int executeAction__(size_t ruleNr);
26
27 void print();
28 void preCode(); // re-implement this function for code that must
29 // be exec'ed before the patternmatching starts
30
31 void switchSource();
32 };
33
34 // $insert scannerConstructors
35 inline Scanner::Scanner(std::istream &in, std::ostream &out)
36 :
37 ScannerBase(in, out)
38 {}
39
40 inline Scanner::Scanner(std::string const &infile, std::string const &outfile)
41 :
42 ScannerBase(infile, outfile)
43 {}
44
45 // $insert inlineLexFunction
46 inline int Scanner::lex()
47 {
48 return lex__();
49 }
50
51 inline void Scanner::preCode()
52 {
53 // optionally replace by your own code
54 }
55
56 inline void Scanner::print()
57 {
58 print__();
59 }
60
61 #endif // Scanner_H_INCLUDED_