Source-highlight Library
langelemsprinter.hpp
1 //
2 // C++ Interface: langelemsprinter
3 //
4 // Description:
5 //
6 //
7 // Author: Lorenzo Bettini <http://www.lorenzobettini.it>, (C) 2006
8 //
9 // Copyright: See COPYING file that comes with this distribution
10 //
11 //
12 #ifndef LANGELEMSPRINTER_H
13 #define LANGELEMSPRINTER_H
14 
15 #include <set>
16 #include <string>
17 #include <ostream>
18 
19 namespace srchilite {
20 
26 // doublecpp: forward declarations, DO NOT MODIFY
27 class LangElem; // file: langelem.h
28 class LangElems; // file: langelems.h
29 class NamedSubExpsLangElem; // file: namedsubexpslangelem.h
30 class StateLangElem; // file: statelangelem.h
31 // doublecpp: end, DO NOT MODIFY
32 
33 #line 26 "langelemsprinter.h"
34 class LangElemsPrinter
35 {
36  typedef std::set<std::string> SetOfElements;
37  SetOfElements setOfElements;
38 
39 public:
40  LangElemsPrinter();
41 
42  virtual ~LangElemsPrinter();
43 
50  void print(const LangElems *elems, std::ostream &os);
51 
52 protected:
53 // doublecpp: method branches, DO NOT MODIFY
54 #line 46 "langelemsprinter.h"
55 virtual void collect(const StateLangElem * elem);
56 #line 47 "langelemsprinter.h"
57 virtual void collect(const LangElem * elem);
58 #line 48 "langelemsprinter.h"
59 virtual void collect(const LangElems * elem);
60 #line 49 "langelemsprinter.h"
61 virtual void collect(const NamedSubExpsLangElem * elem);
62 public:
63 void _forward_collect(const LangElem * elem)
64 {
65  collect(elem);
66 };
67 
68 void _forward_collect(const LangElems * elem)
69 {
70  collect(elem);
71 };
72 
73 void _forward_collect(const NamedSubExpsLangElem * elem)
74 {
75  collect(elem);
76 };
77 
78 void _forward_collect(const StateLangElem * elem)
79 {
80  collect(elem);
81 };
82 
83 protected:
84 virtual void collect_DB(const LangElem * elem);
85 virtual void collect_DB(const LangElems * elem);
86 #line 49 "langelemsprinter.h"
87 // doublecpp: end, DO NOT MODIFY
88 
89 };
90 
91 }
92 
93 #endif
C++ class: doctemplate.h.
Definition: bufferedoutput.cpp:13
void print(const LangElems *elems, std::ostream &os)
Prints all the elements contained in the passed LangElems to the specified ostream.
Definition: langelemsprinter.cpp:37