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_DSAPI_DOCU_PE2_HXX
25 #define ADC_DSAPI_DOCU_PE2_HXX
26 
27 
28 
29 // USED SERVICES
30 	// BASE CLASSES
31 #include <s2_dsapi/tokintpr.hxx>
32 	// COMPONENTS
33 	// PARAMETERS
34 
35 class ParserInfo;
36 
37 namespace ary
38 {
39 namespace doc
40 {
41     class OldIdlDocu;
42 }
43 
44 namespace inf
45 {
46     class DocuToken;
47 }   // namespace info
48 }   // namespace ary
49 
50 
51 
52 namespace csi
53 {
54 namespace dsapi
55 {
56 
57 
58 class Token;
59 class DT_AtTag;
60 
61 class SapiDocu_PE : public TokenInterpreter
62 {
63   public:
64 						SapiDocu_PE(
65 						    ParserInfo &        io_rPositionInfo );
66 						~SapiDocu_PE();
67 
68 	void				ProcessToken(
69 							DYN csi::dsapi::Token &
70 												let_drToken );
71 
72 	virtual void		Process_AtTag(
73 							const Tok_AtTag &	i_rToken );
74 	virtual void		Process_HtmlTag(
75 							const Tok_HtmlTag &	i_rToken );
76 	virtual void		Process_XmlConst(
77 							const Tok_XmlConst &
78 												i_rToken );
79 	virtual void		Process_XmlLink_BeginTag(
80 							const Tok_XmlLink_BeginTag &
81 												i_rToken );
82 	virtual void		Process_XmlLink_EndTag(
83 							const Tok_XmlLink_EndTag &
84 												i_rToken );
85 	virtual void		Process_XmlFormat_BeginTag(
86 							const Tok_XmlFormat_BeginTag &
87 												i_rToken );
88 	virtual void		Process_XmlFormat_EndTag(
89 							const Tok_XmlFormat_EndTag &
90 												i_rToken );
91 	virtual void		Process_Word(
92 							const Tok_Word &	i_rToken );
93 	virtual void		Process_Comma();
94 	virtual void		Process_DocuEnd();
95 	virtual void		Process_EOL();
96 	virtual void		Process_White();
97 
98 
99 	DYN ary::doc::OldIdlDocu *
100 							ReleaseJustParsedDocu();
101 
102 	bool				IsComplete() const;
103 
104   private:
105 	enum E_State
106 	{
107 		e_none = 0,
108 		st_short,
109 		st_description,
110 		st_attags,
111 		st_complete
112 	};
113 
114 	typedef void ( SapiDocu_PE::*F_TokenAdder )( DYN ary::inf::DocuToken & let_drNewToken );
115 
116 	void				AddDocuToken2Void(
117 							DYN ary::inf::DocuToken &
118 												let_drNewToken );
119 	void				AddDocuToken2Short(
120 							DYN ary::inf::DocuToken &
121 												let_drNewToken );
122 	void				AddDocuToken2Description(
123 							DYN ary::inf::DocuToken &
124 												let_drNewToken );
125 	void				AddDocuToken2Deprecated(
126 							DYN ary::inf::DocuToken &
127 												let_drNewToken );
128 	void				AddDocuToken2CurAtTag(
129 							DYN ary::inf::DocuToken &
130 												let_drNewToken );
131 	void				SetCurParameterAtTagName(
132 							DYN ary::inf::DocuToken &
133 												let_drNewToken );
134 	void				SetCurSeeAlsoAtTagLinkText(
135 							DYN ary::inf::DocuToken &
136 												let_drNewToken );
137 	void				SetCurSeeAlsoAtTagLinkText_2(
138 							DYN ary::inf::DocuToken &
139 												let_drNewToken );
140 	void				SetCurSeeAlsoAtTagLinkText_3(
141 							DYN ary::inf::DocuToken &
142 												let_drNewToken );
143 	void				SetCurSinceAtTagVersion_OOo(
144 							DYN ary::inf::DocuToken &
145 												let_drNewToken );
146     void                SetCurSinceAtTagVersion_AOO(
147                             DYN ary::inf::DocuToken &
148                                                 let_drNewToken );
149 	void				SetCurSinceAtTagVersion_Number(
150 							DYN ary::inf::DocuToken &
151 												let_drNewToken );
152 	void				AddDocuToken2SinceAtTag(
153 							DYN ary::inf::DocuToken &
154 												let_drNewToken );
155 
156 	bool				CheckVersionSyntax_OOo(
157                             const String &      i_versionPart1 );
158 	bool				CheckVersionSyntax_Number(
159                             const String &      i_versionPart2 );
160 	// DATA
161 	Dyn<ary::doc::OldIdlDocu>
162 						pDocu;
163 	E_State				eState;
164 	ParserInfo *        pPositionInfo;
165 	F_TokenAdder		fCurTokenAddFunction;
166 
167 	Dyn<DT_AtTag>	    pCurAtTag;
168     String              sCurDimAttribute;
169     StreamStr           sCurAtSeeType_byXML;
170 };
171 
172 }   // namespace dsapi
173 }   // namespace csi
174 
175 
176 // IMPLEMENTATION
177 
178 
179 #endif
180 
181