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 29 #ifndef ADC_CPP_PE_EXPR_HXX 30 #define ADC_CPP_PE_EXPR_HXX 31 32 33 34 // USED SERVICES 35 // BASE CLASSES 36 #include "cpp_pe.hxx" 37 // COMPONENTS 38 #include <semantic/callf.hxx> 39 #include <semantic/sub_peu.hxx> 40 // PARAMETERS 41 42 43 namespace cpp { 44 45 46 class PE_Expression : public Cpp_PE 47 { 48 public: 49 enum E_State 50 { 51 std, 52 size_of_states 53 }; 54 PE_Expression( 55 Cpp_PE * i_pParent ); 56 ~PE_Expression(); 57 58 const char * Result_Text() const; 59 60 virtual void Call_Handler( 61 const cpp::Token & i_rTok ); 62 63 private: 64 void Setup_StatusFunctions(); 65 virtual void InitData(); 66 virtual void TransferData(); 67 void On_std_Default( const char *); 68 69 void On_std_SwBracket_Left( const char *); 70 void On_std_SwBracket_Right( const char *); 71 void On_std_ArrayBracket_Left( const char *); 72 void On_std_ArrayBracket_Right( const char *); 73 void On_std_Bracket_Left( const char *); 74 void On_std_Bracket_Right( const char *); 75 void On_std_Semicolon( const char *); 76 void On_std_Comma( const char *); 77 78 // DATA 79 Dyn< PeStatusArray<PE_Expression> > 80 pStati; 81 82 csv::StreamStr aResult_Text; 83 84 intt nBracketCounter; 85 }; 86 87 88 89 // IMPLEMENTATION 90 91 inline const char * 92 PE_Expression::Result_Text() const 93 { 94 return aResult_Text.c_str(); 95 } 96 97 98 } // namespace cpp 99 100 101 102 103 #endif 104 105 106