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