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_PE_ENVAL_HXX 25 #define ADC_CPP_PE_ENVAL_HXX 26 27 28 29 // USED SERVICES 30 // BASE CLASSES 31 #include "cpp_pe.hxx" 32 // COMPONENTS 33 #include <semantic/callf.hxx> 34 #include <semantic/sub_peu.hxx> 35 // PARAMETERS 36 37 38 namespace cpp { 39 40 class PE_Expression; 41 42 43 class PE_EnumValue : public Cpp_PE 44 { 45 public: 46 enum E_State 47 { 48 start, // before name 49 afterName, 50 expectFinish, // after init-expression 51 size_of_states 52 }; 53 PE_EnumValue( 54 Cpp_PE * i_pParent ); 55 ~PE_EnumValue(); 56 57 virtual void Call_Handler( 58 const cpp::Token & i_rTok ); 59 60 private: 61 typedef SubPe< PE_EnumValue, PE_Expression > SP_Expression; 62 typedef SubPeUse< PE_EnumValue, PE_Expression> SPU_Expression; 63 64 void Setup_StatusFunctions(); 65 virtual void InitData(); 66 virtual void TransferData(); 67 void Hdl_SyntaxError(const char *); 68 69 void SpReturn_InitExpression(); 70 71 void On_start_Identifier(const char * ); 72 73 void On_afterName_SwBracket_Right(const char * ); 74 void On_afterName_Comma(const char * ); 75 void On_afterName_Assign(const char * ); 76 77 void On_expectFinish_SwBracket_Right(const char * ); 78 void On_expectFinish_Comma(const char * ); 79 80 // DATA 81 Dyn< PeStatusArray<PE_EnumValue> > 82 pStati; 83 Dyn<SP_Expression> pSpExpression; 84 Dyn<SPU_Expression> pSpuInitExpression; 85 86 String sName; 87 String sInitExpression; 88 }; 89 90 91 92 93 } // namespace cpp 94 #endif 95 96