1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef ADC_CPP_TOKINTPR_HXX 25 #define ADC_CPP_TOKINTPR_HXX 26 27 28 29 // USED SERVICES 30 // BASE CLASSES 31 #include <all_toks.hxx> 32 // COMPONENTS 33 // PARAMETERS 34 35 namespace cpp { 36 37 38 39 #define DECL_TOK_HANDLER(token) \ 40 void Hdl_##token( \ 41 const Tok_##token & i_rTok ) { Call_Handler(i_rTok); } 42 43 class TokenInterpreter 44 { 45 public: ~TokenInterpreter()46 virtual ~TokenInterpreter() {} 47 48 DECL_TOK_HANDLER(Identifier) 49 DECL_TOK_HANDLER(Operator) 50 DECL_TOK_HANDLER(operator) 51 DECL_TOK_HANDLER(class) 52 DECL_TOK_HANDLER(struct) 53 DECL_TOK_HANDLER(union) 54 DECL_TOK_HANDLER(enum) 55 DECL_TOK_HANDLER(typedef) 56 DECL_TOK_HANDLER(public) 57 DECL_TOK_HANDLER(protected) 58 DECL_TOK_HANDLER(private) 59 DECL_TOK_HANDLER(template) 60 DECL_TOK_HANDLER(virtual) 61 DECL_TOK_HANDLER(friend) 62 DECL_TOK_HANDLER(Tilde) 63 DECL_TOK_HANDLER(const) 64 DECL_TOK_HANDLER(volatile) 65 DECL_TOK_HANDLER(extern) 66 DECL_TOK_HANDLER(static) 67 DECL_TOK_HANDLER(mutable) 68 DECL_TOK_HANDLER(register) 69 DECL_TOK_HANDLER(inline) 70 DECL_TOK_HANDLER(explicit) 71 DECL_TOK_HANDLER(namespace) 72 DECL_TOK_HANDLER(using) 73 DECL_TOK_HANDLER(throw) 74 DECL_TOK_HANDLER(SwBracket_Left) 75 DECL_TOK_HANDLER(SwBracket_Right) 76 DECL_TOK_HANDLER(ArrayBracket_Left) 77 DECL_TOK_HANDLER(ArrayBracket_Right) 78 DECL_TOK_HANDLER(Bracket_Left) 79 DECL_TOK_HANDLER(Bracket_Right) 80 DECL_TOK_HANDLER(DoubleColon) 81 DECL_TOK_HANDLER(Semicolon) 82 DECL_TOK_HANDLER(Comma) 83 DECL_TOK_HANDLER(Colon) 84 DECL_TOK_HANDLER(Assign) 85 DECL_TOK_HANDLER(Less) 86 DECL_TOK_HANDLER(Greater) 87 DECL_TOK_HANDLER(Asterix) 88 DECL_TOK_HANDLER(AmpersAnd) 89 DECL_TOK_HANDLER(Ellipse) 90 DECL_TOK_HANDLER(typename) 91 DECL_TOK_HANDLER(DefineName) 92 DECL_TOK_HANDLER(MacroName) 93 DECL_TOK_HANDLER(MacroParameter) 94 DECL_TOK_HANDLER(PreProDefinition) 95 DECL_TOK_HANDLER(BuiltInType) 96 DECL_TOK_HANDLER(TypeSpecializer) 97 DECL_TOK_HANDLER(Constant) 98 99 protected: 100 virtual void Call_Handler( 101 const cpp::Token & i_rTok ) = 0; 102 }; 103 104 #undef DECL_TOK_HANDLER 105 106 107 // IMPLEMENTATION 108 109 110 } // namespace cpp 111 112 113 #endif 114