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_DOCU_PE_HXX
25 #define ADC_DOCU_PE_HXX
26 
27 
28 
29 // USED SERVICES
30 	// BASE CLASSES
31 #include <adoc/tokintpr.hxx>
32 	// COMPONENTS
33 	// PARAMETERS
34 
35 namespace ary
36 {
37 namespace doc
38 {
39     class OldCppDocu;
40 }
41 namespace info
42 {
43     class AtTag;
44 }
45 }
46 
47 
48 
49 namespace adoc
50 {
51 
52 
53 class Adoc_PE : public TokenInterpreter
54 {
55   public:
56 						Adoc_PE();
57 						~Adoc_PE();
58 
59 	virtual void		Hdl_at_std(
60 							const Tok_at_std &	i_rTok );
61 	virtual void		Hdl_at_base(
62 							const Tok_at_base &	i_rTok );
63 	virtual void		Hdl_at_exception(
64 							const Tok_at_exception &
65 												i_rTok );
66 	virtual void		Hdl_at_impl(
67 							const Tok_at_impl &	i_rTok );
68 	virtual void		Hdl_at_key(
69 							const Tok_at_key &	i_rTok );
70 	virtual void		Hdl_at_param(
71 							const Tok_at_param &
72 												i_rTok );
73 	virtual void		Hdl_at_see(
74 							const Tok_at_see &	i_rTok );
75 	virtual void		Hdl_at_template(
76 							const Tok_at_template &
77 												i_rTok );
78 	virtual void		Hdl_at_interface(
79 							const Tok_at_interface &
80 												i_rTok );
81 	virtual void		Hdl_at_internal(
82 							const Tok_at_internal &
83 												i_rTok );
84 	virtual void		Hdl_at_obsolete(
85 							const Tok_at_obsolete &
86 												i_rTok );
87 	virtual void		Hdl_at_module(
88 							const Tok_at_module &
89 												i_rTok );
90 	virtual void		Hdl_at_file(
91 							const Tok_at_file &	i_rTok );
92 	virtual void		Hdl_at_gloss(
93 							const Tok_at_gloss &
94 												i_rTok );
95 	virtual void		Hdl_at_global(
96 							const Tok_at_global &
97 												i_rTok );
98 	virtual void		Hdl_at_include(
99 							const Tok_at_include &
100 												i_rTok );
101 	virtual void		Hdl_at_label(
102 							const Tok_at_label &
103 												i_rTok );
104 	virtual void		Hdl_at_since(
105 							const Tok_at_since &
106 												i_rTok );
107 	virtual void		Hdl_at_HTML(
108 							const Tok_at_HTML &
109 												i_rTok );
110 	virtual void		Hdl_at_NOHTML(
111 							const Tok_at_NOHTML &
112 												i_rTok );
113 
114 	virtual void		Hdl_DocWord(
115 							const Tok_DocWord &	i_rTok );
116 
117 	virtual void		Hdl_Whitespace(
118 							const Tok_Whitespace &
119 												i_rTok );
120 	virtual void		Hdl_LineStart(
121 							const Tok_LineStart &
122 												i_rTok );
123 	virtual void		Hdl_Eol(
124 							const Tok_Eol &		i_rTok );
125 
126 	virtual void		Hdl_EoDocu(
127 							const Tok_EoDocu &	i_rTok );
128 
129 
130 	DYN ary::doc::OldCppDocu *
131 						ReleaseJustParsedDocu();
132 
133 	bool				IsComplete() const;
134 
135   private:
136     void                InstallAtTag(
137                             DYN ary::info::AtTag *
138                                                 let_dpTag,
139                             bool                i_bImplicit = false );  /// True for implicit @short and @descr.
140 	ary::doc::OldCppDocu &
141 						CurDocu();
142 	ary::info::AtTag &	CurAtTag();
143     bool                UsesHtmlInDocuText();
144 
145     void                RenameCurShortTag();
146     void                FinishCurShortTag();
147 
148 
149 	// DATA
150     enum E_TagState
151     {
152         ts_new,
153         ts_std
154     };
155     enum E_DocuState
156     {
157         ds_wait_for_short = 0,
158         ds_in_short,
159         ds_1newline_after_short,
160         ds_in_descr,
161         ds_std
162     };
163 
164 	Dyn<ary::doc::OldCppDocu>
165 						pCurDocu;
166 	ary::info::AtTag *	pCurAtTag;
167     uintt               nLineCountInDocu;
168 	UINT8				nCurSpecialMeaningTokens;
169 	UINT8				nCurSubtractFromLineStart;
170     E_TagState          eCurTagState;
171     E_DocuState         eDocuState;
172 	bool                bIsComplete;
173     bool                bUsesHtmlInDocuText;
174 };
175 
176 
177 // IMPLEMENTATION
178 inline bool
IsComplete() const179 Adoc_PE::IsComplete() const
180 {
181 	return bIsComplete;
182 }
183 
184 
185 
186 
187 }   // namespace adoc
188 #endif
189