xref: /AOO41X/main/autodoc/source/parser_i/inc/s2_luidl/pe_tydf2.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
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_TYDF2_HXX
29 #define LUIDL_PE_TYDF2_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 
42 
43 namespace csi
44 {
45 namespace uidl
46 {
47 
48 class PE_Type;
49 
50 
51 class PE_Typedef : public UnoIDL_PE,
52 				   public ParseEnvState
53 {
54   public:
55 						PE_Typedef();
56 	virtual void	 	EstablishContacts(
57 							UnoIDL_PE *			io_pParentPE,
58 							ary::Repository &	io_rRepository,
59 							TokenProcessing_Result &
60 												o_rResult );
61 						~PE_Typedef();
62 
63 	virtual void	  	ProcessToken(
64 							const Token &		i_rToken );
65 
66 	virtual void		Process_Identifier(
67 							const TokIdentifier &
68 												i_rToken );
69 	virtual void		Process_Punctuation(
70 							const TokPunctuation &
71 												i_rToken );
72 	virtual void		Process_Default();
73 
74   private:
75 	enum E_State
76 	{
77 		e_none = 0,
78 		expect_description,
79 		expect_name,
80 		got_name,
81 		e_STATES_MAX
82 	};
83 	enum E_TokenType	/// @ATTENTION  Do not change existing values (except of tt_MAX) !!! Else array-indices will break.
84 	{
85 		tt_any = 0,
86 		tt_identifier,
87 		tt_punctuation,
88 		tt_MAX
89 	};
90 	typedef void (PE_Typedef::*F_TOK)(const char *);
91 
92 
93 	void				CallHandler(
94 							const char *		i_sTokenText,
95 							E_TokenType			i_eTokenType );
96 
97 	void				On_expect_description_Any(const char * i_sText);
98 	void				On_expect_name_Identifier(const char * i_sText);
99 	void				On_got_name_Punctuation(const char * i_sText);
100 	void				On_Default(const char * );
101 
102 	virtual void		InitData();
103 	virtual void		ReceiveData();
104 	virtual void		TransferData();
105 	virtual UnoIDL_PE &	MyPE();
106 
107     // DATA
108 	static F_TOK		aDispatcher[e_STATES_MAX][tt_MAX];
109 
110 	E_State             eState;
111 	Dyn<PE_Type>		pPE_Type;
112 	ary::idl::Type_id	nType;
113 	String   			sName;
114 };
115 
116 
117 
118 }   // namespace uidl
119 }   // namespace csi
120 
121 
122 
123 #endif
124 
125