1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: pe_vari.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef ADC_CPP_PE_VARI_HXX
32 #define ADC_CPP_PE_VARI_HXX
40 #include <semantic/callf.hxx>
41 #include <semantic/sub_peu.hxx>
42 #include <ary/cpp/c_types4cpp.hxx>
43 #include <ary/cpp/c_vfflag.hxx>
52 class PE_Variable
: public Cpp_PE
59 expectFinish
, // after InitExpression
67 Bit 0x0001 != 0, if there is a size and
68 bit 0x0002 != 0, if there is an initialisation.
70 UINT16
Result_Pattern() const;
71 const String
& Result_SizeExpression() const;
72 const String
& Result_InitExpression() const;
74 virtual void Call_Handler(
75 const cpp::Token
& i_rTok
);
78 typedef SubPe
< PE_Variable
, PE_Expression
> SP_Expression
;
79 typedef SubPeUse
< PE_Variable
, PE_Expression
> SPU_Expression
;
81 void Setup_StatusFunctions();
82 virtual void InitData();
83 virtual void TransferData();
84 void Hdl_SyntaxError(const char *);
86 void SpReturn_ArraySizeExpression();
87 void SpReturn_InitExpression();
89 void On_afterName_ArrayBracket_Left(const char * i_sText
);
90 void On_afterName_Semicolon(const char * i_sText
);
91 void On_afterName_Comma(const char * i_sText
);
92 void On_afterName_Assign(const char * i_sText
);
94 void On_afterSize_ArrayBracket_Right(const char * i_sText
);
96 void On_expectFinish_Semicolon(const char * i_sText
);
97 void On_expectFinish_Comma(const char * i_sText
);
98 void On_expectFinish_Bracket_Right(const char * i_sText
);
101 Dyn
< PeStatusArray
<PE_Variable
> >
104 Dyn
<SP_Expression
> pSpExpression
;
105 Dyn
<SPU_Expression
> pSpuArraySizeExpression
;
106 Dyn
<SPU_Expression
> pSpuInitExpression
;
108 String sResultSizeExpression
;
109 String sResultInitExpression
;
118 PE_Variable::Result_Pattern() const
119 { return ( sResultSizeExpression
.length() > 0 ? 1 : 0 )
120 + ( sResultInitExpression
.length() > 0 ? 2 : 0 ); }
121 inline const String
&
122 PE_Variable::Result_SizeExpression() const
123 { return sResultSizeExpression
; }
124 inline const String
&
125 PE_Variable::Result_InitExpression() const
126 { return sResultInitExpression
; }