]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/io/server/src/cfg_scanner.h
update
[l4.git] / l4 / pkg / io / server / src / cfg_scanner.h
1 /*
2  * (c) 2010 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
3  *          Alexander Warg <warg@os.inf.tu-dresden.de>
4  *     economic rights: Technische Universität Dresden (Germany)
5  *
6  * This file is part of TUD:OS and distributed under the terms of the
7  * GNU General Public License 2.
8  * Please see the COPYING-GPL-2 file for details.
9  */
10 #pragma once
11
12 #include "cfg_parser.tab.hh"
13
14 namespace cfg {
15
16 class Scanner
17 {
18 public:
19   typedef cfg::Parser::token Token;
20   typedef cfg::Parser::token::yytokentype Token_type;
21
22   Token_type lex(cfg::Parser::semantic_type*, cfg::location*);
23
24   explicit Scanner(char const *zts);
25   explicit Scanner(char const *s, char const *e, const char *filename);
26   ~Scanner();
27
28 private:
29   void init();
30
31   int cs, act;
32   char const *ts, *te;
33   char const *p, *pe;
34
35   char const *s, *e;
36   char const *_filename;
37 };
38
39 }
40
41 #define YY_EXTRA_TYPE cfg::Scanner *