1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef ADC_CPP_TOKINTPR_HXX
29 #define ADC_CPP_TOKINTPR_HXX
30 
31 
32 
33 // USED SERVICES
34 	// BASE CLASSES
35 #include <all_toks.hxx>
36 	// COMPONENTS
37 	// PARAMETERS
38 
39 namespace cpp {
40 
41 
42 
43 #define DECL_TOK_HANDLER(token) \
44 	void				Hdl_##token( \
45 							const Tok_##token & i_rTok ) { Call_Handler(i_rTok); }
46 
47 class TokenInterpreter
48 {
49   public:
50 	virtual				~TokenInterpreter() {}
51 
52 						DECL_TOK_HANDLER(Identifier)
53 						DECL_TOK_HANDLER(Operator)
54 						DECL_TOK_HANDLER(operator)
55 						DECL_TOK_HANDLER(class)
56 						DECL_TOK_HANDLER(struct)
57 						DECL_TOK_HANDLER(union)
58 						DECL_TOK_HANDLER(enum)
59 						DECL_TOK_HANDLER(typedef)
60 						DECL_TOK_HANDLER(public)
61 						DECL_TOK_HANDLER(protected)
62 						DECL_TOK_HANDLER(private)
63 						DECL_TOK_HANDLER(template)
64 						DECL_TOK_HANDLER(virtual)
65 						DECL_TOK_HANDLER(friend)
66 						DECL_TOK_HANDLER(Tilde)
67 						DECL_TOK_HANDLER(const)
68 						DECL_TOK_HANDLER(volatile)
69 						DECL_TOK_HANDLER(extern)
70 						DECL_TOK_HANDLER(static)
71 						DECL_TOK_HANDLER(mutable)
72 						DECL_TOK_HANDLER(register)
73 						DECL_TOK_HANDLER(inline)
74 						DECL_TOK_HANDLER(explicit)
75 						DECL_TOK_HANDLER(namespace)
76 						DECL_TOK_HANDLER(using)
77 						DECL_TOK_HANDLER(throw)
78 						DECL_TOK_HANDLER(SwBracket_Left)
79 						DECL_TOK_HANDLER(SwBracket_Right)
80 						DECL_TOK_HANDLER(ArrayBracket_Left)
81 						DECL_TOK_HANDLER(ArrayBracket_Right)
82 						DECL_TOK_HANDLER(Bracket_Left)
83 						DECL_TOK_HANDLER(Bracket_Right)
84 						DECL_TOK_HANDLER(DoubleColon)
85 						DECL_TOK_HANDLER(Semicolon)
86 						DECL_TOK_HANDLER(Comma)
87 						DECL_TOK_HANDLER(Colon)
88 						DECL_TOK_HANDLER(Assign)
89 						DECL_TOK_HANDLER(Less)
90 						DECL_TOK_HANDLER(Greater)
91 						DECL_TOK_HANDLER(Asterix)
92 						DECL_TOK_HANDLER(AmpersAnd)
93 						DECL_TOK_HANDLER(Ellipse)
94 						DECL_TOK_HANDLER(typename)
95 						DECL_TOK_HANDLER(DefineName)
96 						DECL_TOK_HANDLER(MacroName)
97 						DECL_TOK_HANDLER(MacroParameter)
98 						DECL_TOK_HANDLER(PreProDefinition)
99 						DECL_TOK_HANDLER(BuiltInType)
100 						DECL_TOK_HANDLER(TypeSpecializer)
101 						DECL_TOK_HANDLER(Constant)
102 
103   protected:
104 	virtual void		Call_Handler(
105 							const cpp::Token &	i_rTok ) = 0;
106 };
107 
108 #undef DECL_TOK_HANDLER
109 
110 
111 // IMPLEMENTATION
112 
113 
114 }   // namespace cpp
115 
116 
117 #endif
118