cp/guest: clean up guest_create's console handling
[hvf.git] / build / re2c / parser.h
blobd2c2e1e5e6f9ab0859b73db61e5c49e77aadd35b
1 /* $Id: parser.h 854 2008-03-24 16:41:12Z helly $ */
2 #ifndef _parser_h
3 #define _parser_h
5 #include "scanner.h"
6 #include "re.h"
7 #include <iosfwd>
9 namespace re2c
12 class Symbol
14 public:
16 RegExp* re;
18 static Symbol *find(const SubStr&);
19 static void ClearTable();
21 typedef std::map<std::string, Symbol*> SymbolTable;
23 const Str& GetName() const
25 return name;
28 protected:
30 Symbol(const SubStr& str)
31 : re(NULL)
32 , name(str)
36 private:
38 static SymbolTable symbol_table;
40 Str name;
42 #if PEDANTIC
43 Symbol(const Symbol& oth)
44 : re(oth.re)
45 , name(oth.name)
48 Symbol& operator = (const Symbol& oth)
50 new(this) Symbol(oth);
51 return *this;
53 #endif
56 extern void parse(Scanner&, std::ostream&, std::ostream*);
57 extern void parse_cleanup();
59 } // end namespace re2c
61 #endif