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 LUIDL_PE_EVALU_HXX 29 #define LUIDL_PE_EVALU_HXX 30 31 32 33 // USED SERVICES 34 // BASE CLASSES 35 #include <s2_luidl/parsenv2.hxx> 36 #include <s2_luidl/pestate.hxx> 37 // COMPONENTS 38 // PARAMETERS 39 40 41 namespace udm { 42 class Agent_Struct; 43 } // namespace udm 44 45 46 namespace csi 47 { 48 namespace uidl 49 { 50 51 class PE_Value : public UnoIDL_PE, 52 public ParseEnvState 53 { 54 public: 55 PE_Value( 56 String & o_rName, 57 String & o_rAssignment, 58 bool i_bIsConst ); 59 virtual void EstablishContacts( 60 UnoIDL_PE * io_pParentPE, 61 ary::Repository & 62 io_rRepository, 63 TokenProcessing_Result & 64 o_rResult ); 65 ~PE_Value(); 66 67 virtual void ProcessToken( 68 const Token & i_rToken ); 69 70 virtual void Process_Identifier( 71 const TokIdentifier & 72 i_rToken ); 73 virtual void Process_Punctuation( 74 const TokPunctuation & 75 i_rToken ); 76 virtual void Process_Assignment( 77 const TokAssignment & 78 i_rToken ); 79 private: 80 enum E_State 81 { 82 e_none = 0, 83 expect_name, 84 got_name, 85 e_STATES_MAX 86 }; 87 enum E_TokenType /// @ATTENTION Do not change existing values (except of tt_MAX) !!! Else array-indices will break. 88 { 89 tt_identifier = 0, 90 tt_punctuation = 1, 91 tt_assignment = 2, 92 tt_MAX 93 }; 94 typedef void (PE_Value::*F_TOK)(const char *); 95 96 97 void CallHandler( 98 const char * i_sTokenText, 99 E_TokenType i_eTokenType ); 100 101 void On_expect_name_Identifier(const char * i_sText); 102 void On_got_name_Punctuation(const char * i_sText); 103 void On_got_name_Assignment(const char * i_sText); 104 void On_Default(const char * ); 105 106 virtual void InitData(); 107 virtual void TransferData(); 108 virtual UnoIDL_PE & MyPE(); 109 110 bool IsConst() const { return bIsConst; } 111 112 static F_TOK aDispatcher[e_STATES_MAX][tt_MAX]; 113 114 E_State eState; 115 String * pName; 116 String * pAssignment; 117 bool bIsConst; 118 }; 119 120 121 122 } // namespace uidl 123 } // namespace csi 124 125 126 #endif 127 128