1*78bc99aaSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*78bc99aaSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*78bc99aaSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*78bc99aaSAndrew Rist  * distributed with this work for additional information
6*78bc99aaSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*78bc99aaSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*78bc99aaSAndrew Rist  * "License"); you may not use this file except in compliance
9*78bc99aaSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*78bc99aaSAndrew Rist  *
11*78bc99aaSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*78bc99aaSAndrew Rist  *
13*78bc99aaSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*78bc99aaSAndrew Rist  * software distributed under the License is distributed on an
15*78bc99aaSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*78bc99aaSAndrew Rist  * KIND, either express or implied.  See the License for the
17*78bc99aaSAndrew Rist  * specific language governing permissions and limitations
18*78bc99aaSAndrew Rist  * under the License.
19*78bc99aaSAndrew Rist  *
20*78bc99aaSAndrew Rist  *************************************************************/
21cdf0e10cSrcweir 
22cdf0e10cSrcweir #include <precomp.h>
23cdf0e10cSrcweir #include "pe_class.hxx"
24cdf0e10cSrcweir 
25cdf0e10cSrcweir 
26cdf0e10cSrcweir // NOT FULLY DECLARED SERVICES
27cdf0e10cSrcweir #include <cosv/tpl/tpltools.hxx>
28cdf0e10cSrcweir #include <ary/cpp/c_gate.hxx>
29cdf0e10cSrcweir #include <ary/cpp/c_class.hxx>
30cdf0e10cSrcweir #include <ary/cpp/c_namesp.hxx>
31cdf0e10cSrcweir #include <ary/cpp/cp_ce.hxx>
32cdf0e10cSrcweir #include <all_toks.hxx>
33cdf0e10cSrcweir #include "pe_base.hxx"
34cdf0e10cSrcweir #include "pe_defs.hxx"
35cdf0e10cSrcweir #include "pe_enum.hxx"
36cdf0e10cSrcweir #include "pe_tydef.hxx"
37cdf0e10cSrcweir #include "pe_vafu.hxx"
38cdf0e10cSrcweir #include "pe_ignor.hxx"
39cdf0e10cSrcweir 
40cdf0e10cSrcweir 
41cdf0e10cSrcweir namespace cpp {
42cdf0e10cSrcweir 
43cdf0e10cSrcweir // using ary::Cid;
44cdf0e10cSrcweir 
PE_Class(Cpp_PE * i_pParent)45cdf0e10cSrcweir PE_Class::PE_Class(Cpp_PE * i_pParent )
46cdf0e10cSrcweir 	:   Cpp_PE(i_pParent),
47cdf0e10cSrcweir 		pStati( new PeStatusArray<PE_Class> ),
48cdf0e10cSrcweir 		// pSpBase,
49cdf0e10cSrcweir 		// pSpTypedef,
50cdf0e10cSrcweir 		// pSpVarFunc,
51cdf0e10cSrcweir 		// pSpIgnore,
52cdf0e10cSrcweir 		// pSpuBase,
53cdf0e10cSrcweir 		// pSpuTypedef,
54cdf0e10cSrcweir 		// pSpuVarFunc,
55cdf0e10cSrcweir 		// pSpuUsing,
56cdf0e10cSrcweir         // pSpuIgnoreFailure,
57cdf0e10cSrcweir 		// sLocalName,
58cdf0e10cSrcweir 		eClassKey(ary::cpp::CK_class),
59cdf0e10cSrcweir 		pCurObject(0),
60cdf0e10cSrcweir         // aBases,
61cdf0e10cSrcweir 		eResult_KindOf(is_declaration)
62cdf0e10cSrcweir {
63cdf0e10cSrcweir 	Setup_StatusFunctions();
64cdf0e10cSrcweir 
65cdf0e10cSrcweir 	pSpBase     = new SP_Base(*this);
66cdf0e10cSrcweir 	pSpTypedef  = new SP_Typedef(*this);
67cdf0e10cSrcweir 	pSpVarFunc  = new SP_VarFunc(*this);
68cdf0e10cSrcweir 	pSpIgnore   = new SP_Ignore(*this);
69cdf0e10cSrcweir 	pSpDefs     = new SP_Defines(*this);
70cdf0e10cSrcweir 
71cdf0e10cSrcweir 	pSpuBase	= new SPU_Base(*pSpBase, 0, &PE_Class::SpReturn_Base);
72cdf0e10cSrcweir 	pSpuTypedef	= new SPU_Typedef(*pSpTypedef, 0, 0);
73cdf0e10cSrcweir 	pSpuVarFunc = new SPU_VarFunc(*pSpVarFunc, 0, 0);
74cdf0e10cSrcweir 
75cdf0e10cSrcweir 	pSpuTemplate= new SPU_Ignore(*pSpIgnore, 0, 0);
76cdf0e10cSrcweir 	pSpuUsing   = new SPU_Ignore(*pSpIgnore, 0, 0);
77cdf0e10cSrcweir     pSpuIgnoreFailure
78cdf0e10cSrcweir                 = new SPU_Ignore(*pSpIgnore, 0, 0);
79cdf0e10cSrcweir 	pSpuDefs	= new SPU_Defines(*pSpDefs, 0, 0);
80cdf0e10cSrcweir }
81cdf0e10cSrcweir 
82cdf0e10cSrcweir 
~PE_Class()83cdf0e10cSrcweir PE_Class::~PE_Class()
84cdf0e10cSrcweir {
85cdf0e10cSrcweir }
86cdf0e10cSrcweir 
87cdf0e10cSrcweir void
Call_Handler(const cpp::Token & i_rTok)88cdf0e10cSrcweir PE_Class::Call_Handler( const cpp::Token &	i_rTok )
89cdf0e10cSrcweir {
90cdf0e10cSrcweir 	pStati->Cur().Call_Handler(i_rTok.TypeId(), i_rTok.Text());
91cdf0e10cSrcweir }
92cdf0e10cSrcweir 
93cdf0e10cSrcweir Cpp_PE *
Handle_ChildFailure()94cdf0e10cSrcweir PE_Class::Handle_ChildFailure()
95cdf0e10cSrcweir {
96cdf0e10cSrcweir     SetCurSPU(pSpuIgnoreFailure.Ptr());
97cdf0e10cSrcweir     return &pSpuIgnoreFailure->Child();
98cdf0e10cSrcweir }
99cdf0e10cSrcweir 
100cdf0e10cSrcweir void
Setup_StatusFunctions()101cdf0e10cSrcweir PE_Class::Setup_StatusFunctions()
102cdf0e10cSrcweir {
103cdf0e10cSrcweir 	typedef CallFunction<PE_Class>::F_Tok	F_Tok;
104cdf0e10cSrcweir 
105cdf0e10cSrcweir 	static F_Tok stateF_start[] =			{ &PE_Class::On_start_class,
106cdf0e10cSrcweir 											  &PE_Class::On_start_struct,
107cdf0e10cSrcweir 											  &PE_Class::On_start_union };
108cdf0e10cSrcweir 	static INT16 stateT_start[] =       	{ Tid_class,
109cdf0e10cSrcweir 											  Tid_struct,
110cdf0e10cSrcweir 											  Tid_union };
111cdf0e10cSrcweir 
112cdf0e10cSrcweir 	static F_Tok stateF_expectName[] = 		{ &PE_Class::On_expectName_Identifier,
113cdf0e10cSrcweir 											  &PE_Class::On_expectName_SwBracket_Left,
114cdf0e10cSrcweir 											  &PE_Class::On_expectName_Colon
115cdf0e10cSrcweir 											};
116cdf0e10cSrcweir 	static INT16 stateT_expectName[] = 		{ Tid_Identifier,
117cdf0e10cSrcweir 											  Tid_SwBracket_Left,
118cdf0e10cSrcweir 											  Tid_Colon
119cdf0e10cSrcweir 											};
120cdf0e10cSrcweir 
121cdf0e10cSrcweir 	static F_Tok stateF_gotName[] =			{ &PE_Class::On_gotName_SwBracket_Left,
122cdf0e10cSrcweir 											  &PE_Class::On_gotName_Semicolon,
123cdf0e10cSrcweir 											  &PE_Class::On_gotName_Colon };
124cdf0e10cSrcweir 	static INT16 stateT_gotName[] =       	{ Tid_SwBracket_Left,
125cdf0e10cSrcweir 											  Tid_Semicolon,
126cdf0e10cSrcweir 											  Tid_Colon };
127cdf0e10cSrcweir 
128cdf0e10cSrcweir 	static F_Tok stateF_bodyStd[] =			{ &PE_Class::On_bodyStd_VarFunc,
129cdf0e10cSrcweir 											  &PE_Class::On_bodyStd_VarFunc,
130cdf0e10cSrcweir 											  &PE_Class::On_bodyStd_ClassKey,
131cdf0e10cSrcweir 											  &PE_Class::On_bodyStd_ClassKey,
132cdf0e10cSrcweir 											  &PE_Class::On_bodyStd_ClassKey,
133cdf0e10cSrcweir 
134cdf0e10cSrcweir 											  &PE_Class::On_bodyStd_enum,
135cdf0e10cSrcweir 											  &PE_Class::On_bodyStd_typedef,
136cdf0e10cSrcweir 											  &PE_Class::On_bodyStd_public,
137cdf0e10cSrcweir 											  &PE_Class::On_bodyStd_protected,
138cdf0e10cSrcweir 											  &PE_Class::On_bodyStd_private,
139cdf0e10cSrcweir 
140cdf0e10cSrcweir 											  &PE_Class::On_bodyStd_template,
141cdf0e10cSrcweir 											  &PE_Class::On_bodyStd_VarFunc,
142cdf0e10cSrcweir 											  &PE_Class::On_bodyStd_friend,
143cdf0e10cSrcweir 											  &PE_Class::On_bodyStd_VarFunc,
144cdf0e10cSrcweir 											  &PE_Class::On_bodyStd_VarFunc,
145cdf0e10cSrcweir 
146cdf0e10cSrcweir 											  &PE_Class::On_bodyStd_VarFunc,
147cdf0e10cSrcweir 											  &PE_Class::On_bodyStd_VarFunc,
148cdf0e10cSrcweir 											  &PE_Class::On_bodyStd_VarFunc,
149cdf0e10cSrcweir 											  &PE_Class::On_bodyStd_VarFunc,
150cdf0e10cSrcweir 											  &PE_Class::On_bodyStd_VarFunc,
151cdf0e10cSrcweir 
152cdf0e10cSrcweir 											  &PE_Class::On_bodyStd_using,
153cdf0e10cSrcweir 											  &PE_Class::On_bodyStd_SwBracket_Right,
154cdf0e10cSrcweir 											  &PE_Class::On_bodyStd_VarFunc,
155cdf0e10cSrcweir                                               &PE_Class::On_bodyStd_DefineName,
156cdf0e10cSrcweir                                               &PE_Class::On_bodyStd_MacroName,
157cdf0e10cSrcweir 
158cdf0e10cSrcweir 											  &PE_Class::On_bodyStd_VarFunc,
159cdf0e10cSrcweir 											  &PE_Class::On_bodyStd_VarFunc,
160cdf0e10cSrcweir                                               &PE_Class::On_bodyStd_VarFunc, };
161cdf0e10cSrcweir 
162cdf0e10cSrcweir 	static INT16 stateT_bodyStd[] =       	{ Tid_Identifier,
163cdf0e10cSrcweir 											  Tid_operator,
164cdf0e10cSrcweir 											  Tid_class,
165cdf0e10cSrcweir 											  Tid_struct,
166cdf0e10cSrcweir 											  Tid_union,
167cdf0e10cSrcweir 
168cdf0e10cSrcweir 											  Tid_enum,
169cdf0e10cSrcweir 											  Tid_typedef,
170cdf0e10cSrcweir 											  Tid_public,
171cdf0e10cSrcweir 											  Tid_protected,
172cdf0e10cSrcweir 											  Tid_private,
173cdf0e10cSrcweir 
174cdf0e10cSrcweir 											  Tid_template,
175cdf0e10cSrcweir 											  Tid_virtual,
176cdf0e10cSrcweir 											  Tid_friend,
177cdf0e10cSrcweir 											  Tid_Tilde,
178cdf0e10cSrcweir 											  Tid_const,
179cdf0e10cSrcweir 
180cdf0e10cSrcweir 											  Tid_volatile,
181cdf0e10cSrcweir 											  Tid_static,
182cdf0e10cSrcweir 											  Tid_mutable,
183cdf0e10cSrcweir 					  						  Tid_inline,
184cdf0e10cSrcweir 											  Tid_explicit,
185cdf0e10cSrcweir 
186cdf0e10cSrcweir 											  Tid_using,
187cdf0e10cSrcweir 											  Tid_SwBracket_Right,
188cdf0e10cSrcweir 											  Tid_DoubleColon,
189cdf0e10cSrcweir                                               Tid_typename,
190cdf0e10cSrcweir                                               Tid_DefineName,
191cdf0e10cSrcweir 
192cdf0e10cSrcweir                                               Tid_MacroName,
193cdf0e10cSrcweir 											  Tid_BuiltInType,
194cdf0e10cSrcweir 											  Tid_TypeSpecializer };
195cdf0e10cSrcweir 
196cdf0e10cSrcweir 											  static F_Tok stateF_inProtection[] = 	{ &PE_Class::On_inProtection_Colon };
197cdf0e10cSrcweir 	static INT16 stateT_inProtection[] =   	{ Tid_Colon };
198cdf0e10cSrcweir 
199cdf0e10cSrcweir 	static F_Tok stateF_afterDecl[] = 	    { &PE_Class::On_afterDecl_Semicolon };
200cdf0e10cSrcweir 	static INT16 stateT_afterDecl[] =   	{ Tid_Semicolon };
201cdf0e10cSrcweir 
202cdf0e10cSrcweir 	SEMPARSE_CREATE_STATUS(PE_Class, start, Hdl_SyntaxError);
203cdf0e10cSrcweir 	SEMPARSE_CREATE_STATUS(PE_Class, expectName, Hdl_SyntaxError);
204cdf0e10cSrcweir 	SEMPARSE_CREATE_STATUS(PE_Class, gotName, On_gotName_Return2Type);
205cdf0e10cSrcweir 	SEMPARSE_CREATE_STATUS(PE_Class, bodyStd, Hdl_SyntaxError);
206cdf0e10cSrcweir 	SEMPARSE_CREATE_STATUS(PE_Class, inProtection, Hdl_SyntaxError);
207cdf0e10cSrcweir 	SEMPARSE_CREATE_STATUS(PE_Class, afterDecl, On_afterDecl_Return2Type);
208cdf0e10cSrcweir 
209cdf0e10cSrcweir #if 0
210cdf0e10cSrcweir 	static F_Tok stateF_inFriend[] =	 	{ On_inFriend_class,
211cdf0e10cSrcweir 											  On_inFriend_struct,
212cdf0e10cSrcweir 											  On_inFriend_union };
213cdf0e10cSrcweir 											  // Default: On_inFriend_Function
214cdf0e10cSrcweir 	static INT16 stateT_inFriend[] =     	{ Tid_class,
215cdf0e10cSrcweir 											  Tid_struct,
216cdf0e10cSrcweir 											  Tid_union };
217cdf0e10cSrcweir #endif // 0
218cdf0e10cSrcweir }
219cdf0e10cSrcweir 
220cdf0e10cSrcweir void
InitData()221cdf0e10cSrcweir PE_Class::InitData()
222cdf0e10cSrcweir {
223cdf0e10cSrcweir 	pStati->SetCur(start);
224cdf0e10cSrcweir 	sLocalName.clear();
225cdf0e10cSrcweir 	eClassKey = ary::cpp::CK_class;
226cdf0e10cSrcweir 	pCurObject = 0;
227cdf0e10cSrcweir     csv::erase_container(aBases);
228cdf0e10cSrcweir     eResult_KindOf = is_declaration;
229cdf0e10cSrcweir }
230cdf0e10cSrcweir 
231cdf0e10cSrcweir void
TransferData()232cdf0e10cSrcweir PE_Class::TransferData()
233cdf0e10cSrcweir {
234cdf0e10cSrcweir 	pStati->SetCur(size_of_states);
235cdf0e10cSrcweir }
236cdf0e10cSrcweir 
237cdf0e10cSrcweir void
Hdl_SyntaxError(const char * i_sText)238cdf0e10cSrcweir PE_Class::Hdl_SyntaxError( const char * i_sText)
239cdf0e10cSrcweir {
240cdf0e10cSrcweir     if ( *i_sText == ';' )
241cdf0e10cSrcweir     {
242cdf0e10cSrcweir      	Cerr() << Env().CurFileName() << ", line "
243cdf0e10cSrcweir                   << Env().LineCount()
244cdf0e10cSrcweir                   << ": Sourcecode warning: ';' as a toplevel declaration is deprecated."
245cdf0e10cSrcweir                   << Endl();
246cdf0e10cSrcweir     	SetTokenResult(done,stay);
247cdf0e10cSrcweir         return;
248cdf0e10cSrcweir     }
249cdf0e10cSrcweir 
250cdf0e10cSrcweir 	StdHandlingOfSyntaxError(i_sText);
251cdf0e10cSrcweir }
252cdf0e10cSrcweir 
253cdf0e10cSrcweir void
Init_CurObject()254cdf0e10cSrcweir PE_Class::Init_CurObject()
255cdf0e10cSrcweir {
256cdf0e10cSrcweir     // KORR_FUTURE
257cdf0e10cSrcweir     //   This will have to be done before parsing base classes, because of
258cdf0e10cSrcweir     //   possible inline documentation for base classes.
259cdf0e10cSrcweir 	pCurObject = & Env().AryGate().Ces().Store_Class( Env().Context(), sLocalName, eClassKey );
260cdf0e10cSrcweir 
261cdf0e10cSrcweir   	for ( PE_Base::BaseList::const_iterator it = aBases.begin();
262cdf0e10cSrcweir 		  it !=  aBases.end();
263cdf0e10cSrcweir 		  ++it )
264cdf0e10cSrcweir 	{
265cdf0e10cSrcweir 		pCurObject->Add_BaseClass( *it );
266cdf0e10cSrcweir 	}  // end for
267cdf0e10cSrcweir 
268cdf0e10cSrcweir     Dyn< StringVector >
269cdf0e10cSrcweir             pTplParams( Env().Get_CurTemplateParameters() );
270cdf0e10cSrcweir     if ( pTplParams )
271cdf0e10cSrcweir     {
272cdf0e10cSrcweir       	for ( StringVector::const_iterator it = pTplParams->begin();
273cdf0e10cSrcweir 	    	  it !=  pTplParams->end();
274cdf0e10cSrcweir 		      ++it )
275cdf0e10cSrcweir     	{
276cdf0e10cSrcweir 	    	pCurObject->Add_TemplateParameterType( *it, ary::cpp::Type_id(0) );
277cdf0e10cSrcweir     	}  // end for
278cdf0e10cSrcweir     }
279cdf0e10cSrcweir }
280cdf0e10cSrcweir 
281cdf0e10cSrcweir void
SpReturn_Base()282cdf0e10cSrcweir PE_Class::SpReturn_Base()
283cdf0e10cSrcweir {
284cdf0e10cSrcweir 	aBases = pSpuBase->Child().Result_BaseIds();
285cdf0e10cSrcweir 	pStati->SetCur(gotName);
286cdf0e10cSrcweir }
287cdf0e10cSrcweir 
288cdf0e10cSrcweir void
On_start_class(const char *)289cdf0e10cSrcweir PE_Class::On_start_class( const char * )
290cdf0e10cSrcweir {
291cdf0e10cSrcweir 	SetTokenResult(done, stay);
292cdf0e10cSrcweir 	pStati->SetCur(expectName);
293cdf0e10cSrcweir 	eClassKey = ary::cpp::CK_class;
294cdf0e10cSrcweir }
295cdf0e10cSrcweir 
296cdf0e10cSrcweir void
On_start_struct(const char *)297cdf0e10cSrcweir PE_Class::On_start_struct( const char * )
298cdf0e10cSrcweir {
299cdf0e10cSrcweir 	SetTokenResult(done, stay);
300cdf0e10cSrcweir 	pStati->SetCur(expectName);
301cdf0e10cSrcweir 	eClassKey = ary::cpp::CK_struct;
302cdf0e10cSrcweir }
303cdf0e10cSrcweir 
304cdf0e10cSrcweir void
On_start_union(const char *)305cdf0e10cSrcweir PE_Class::On_start_union( const char * )
306cdf0e10cSrcweir {
307cdf0e10cSrcweir 	SetTokenResult(done, stay);
308cdf0e10cSrcweir 	pStati->SetCur(expectName);
309cdf0e10cSrcweir 	eClassKey = ary::cpp::CK_union;
310cdf0e10cSrcweir }
311cdf0e10cSrcweir 
312cdf0e10cSrcweir void
On_expectName_Identifier(const char * i_sText)313cdf0e10cSrcweir PE_Class::On_expectName_Identifier( const char * i_sText )
314cdf0e10cSrcweir {
315cdf0e10cSrcweir 	SetTokenResult(done, stay);
316cdf0e10cSrcweir 	pStati->SetCur(gotName);
317cdf0e10cSrcweir     sLocalName = i_sText;
318cdf0e10cSrcweir }
319cdf0e10cSrcweir 
320cdf0e10cSrcweir void
On_expectName_SwBracket_Left(const char *)321cdf0e10cSrcweir PE_Class::On_expectName_SwBracket_Left( const char * )
322cdf0e10cSrcweir {
323cdf0e10cSrcweir 	SetTokenResult(done, stay);
324cdf0e10cSrcweir 	pStati->SetCur(bodyStd);
325cdf0e10cSrcweir 
326cdf0e10cSrcweir     sLocalName = "";
327cdf0e10cSrcweir 	Init_CurObject();
328cdf0e10cSrcweir     sLocalName = pCurObject->LocalName();
329cdf0e10cSrcweir 
330cdf0e10cSrcweir     Env().OpenClass(*pCurObject);
331cdf0e10cSrcweir }
332cdf0e10cSrcweir 
333cdf0e10cSrcweir void
On_expectName_Colon(const char *)334cdf0e10cSrcweir PE_Class::On_expectName_Colon( const char * )
335cdf0e10cSrcweir {
336cdf0e10cSrcweir 	pStati->SetCur(gotName);
337cdf0e10cSrcweir     sLocalName = "";
338cdf0e10cSrcweir 
339cdf0e10cSrcweir 	pSpuBase->Push(done);
340cdf0e10cSrcweir }
341cdf0e10cSrcweir 
342cdf0e10cSrcweir void
On_gotName_SwBracket_Left(const char *)343cdf0e10cSrcweir PE_Class::On_gotName_SwBracket_Left( const char * )
344cdf0e10cSrcweir {
345cdf0e10cSrcweir 	SetTokenResult(done, stay);
346cdf0e10cSrcweir 	pStati->SetCur(bodyStd);
347cdf0e10cSrcweir 
348cdf0e10cSrcweir 	Init_CurObject();
349cdf0e10cSrcweir     if ( sLocalName.empty() )
350cdf0e10cSrcweir         sLocalName = pCurObject->LocalName();
351cdf0e10cSrcweir 
352cdf0e10cSrcweir     Env().OpenClass(*pCurObject);
353cdf0e10cSrcweir }
354cdf0e10cSrcweir 
355cdf0e10cSrcweir void
On_gotName_Semicolon(const char *)356cdf0e10cSrcweir PE_Class::On_gotName_Semicolon( const char * )
357cdf0e10cSrcweir {
358cdf0e10cSrcweir 	SetTokenResult(not_done, pop_success);
359cdf0e10cSrcweir 
360cdf0e10cSrcweir 	eResult_KindOf = is_predeclaration;
361cdf0e10cSrcweir }
362cdf0e10cSrcweir 
363cdf0e10cSrcweir void
On_gotName_Colon(const char *)364cdf0e10cSrcweir PE_Class::On_gotName_Colon( const char * )
365cdf0e10cSrcweir {
366cdf0e10cSrcweir 	pSpuBase->Push(done);
367cdf0e10cSrcweir }
368cdf0e10cSrcweir 
369cdf0e10cSrcweir void
On_gotName_Return2Type(const char *)370cdf0e10cSrcweir PE_Class::On_gotName_Return2Type( const char * )
371cdf0e10cSrcweir {
372cdf0e10cSrcweir 	SetTokenResult(not_done, pop_success);
373cdf0e10cSrcweir 
374cdf0e10cSrcweir 	eResult_KindOf = is_qualified_typename;
375cdf0e10cSrcweir }
376cdf0e10cSrcweir 
377cdf0e10cSrcweir void
On_bodyStd_VarFunc(const char *)378cdf0e10cSrcweir PE_Class::On_bodyStd_VarFunc( const char * )
379cdf0e10cSrcweir {
380cdf0e10cSrcweir     pSpuVarFunc->Push(not_done);
381cdf0e10cSrcweir }
382cdf0e10cSrcweir 
383cdf0e10cSrcweir void
On_bodyStd_ClassKey(const char *)384cdf0e10cSrcweir PE_Class::On_bodyStd_ClassKey( const char * )
385cdf0e10cSrcweir {
386cdf0e10cSrcweir 	pSpuVarFunc->Push(not_done);		// This is correct,
387cdf0e10cSrcweir                                         //   classes are parsed via PE_Type.
388cdf0e10cSrcweir }
389cdf0e10cSrcweir 
390cdf0e10cSrcweir void
On_bodyStd_enum(const char *)391cdf0e10cSrcweir PE_Class::On_bodyStd_enum( const char * )
392cdf0e10cSrcweir {
393cdf0e10cSrcweir 	pSpuVarFunc->Push(not_done);		// This is correct,
394cdf0e10cSrcweir                                         //   enums are parsed via PE_Type.
395cdf0e10cSrcweir }
396cdf0e10cSrcweir 
397cdf0e10cSrcweir void
On_bodyStd_typedef(const char *)398cdf0e10cSrcweir PE_Class::On_bodyStd_typedef( const char * )
399cdf0e10cSrcweir {
400cdf0e10cSrcweir     pSpuTypedef->Push(not_done);
401cdf0e10cSrcweir }
402cdf0e10cSrcweir 
403cdf0e10cSrcweir void
On_bodyStd_public(const char *)404cdf0e10cSrcweir PE_Class::On_bodyStd_public( const char * )
405cdf0e10cSrcweir {
406cdf0e10cSrcweir     SetTokenResult(done, stay);
407cdf0e10cSrcweir     pStati->SetCur(inProtection);
408cdf0e10cSrcweir 
409cdf0e10cSrcweir     Env().SetCurProtection(ary::cpp::PROTECT_public);
410cdf0e10cSrcweir }
411cdf0e10cSrcweir 
412cdf0e10cSrcweir void
On_bodyStd_protected(const char *)413cdf0e10cSrcweir PE_Class::On_bodyStd_protected( const char * )
414cdf0e10cSrcweir {
415cdf0e10cSrcweir     SetTokenResult(done, stay);
416cdf0e10cSrcweir     pStati->SetCur(inProtection);
417cdf0e10cSrcweir 
418cdf0e10cSrcweir     Env().SetCurProtection(ary::cpp::PROTECT_protected);
419cdf0e10cSrcweir }
420cdf0e10cSrcweir 
421cdf0e10cSrcweir void
On_bodyStd_private(const char *)422cdf0e10cSrcweir PE_Class::On_bodyStd_private( const char * )
423cdf0e10cSrcweir {
424cdf0e10cSrcweir     SetTokenResult(done, stay);
425cdf0e10cSrcweir     pStati->SetCur(inProtection);
426cdf0e10cSrcweir 
427cdf0e10cSrcweir     Env().SetCurProtection(ary::cpp::PROTECT_private);
428cdf0e10cSrcweir }
429cdf0e10cSrcweir 
430cdf0e10cSrcweir void
On_bodyStd_template(const char *)431cdf0e10cSrcweir PE_Class::On_bodyStd_template( const char * )
432cdf0e10cSrcweir {
433cdf0e10cSrcweir     pSpuTemplate->Push(done);
434cdf0e10cSrcweir }
435cdf0e10cSrcweir 
436cdf0e10cSrcweir void
On_bodyStd_friend(const char *)437cdf0e10cSrcweir PE_Class::On_bodyStd_friend( const char * )
438cdf0e10cSrcweir {
439cdf0e10cSrcweir     // KORR_FUTURE
440cdf0e10cSrcweir     pSpuUsing->Push(done);
441cdf0e10cSrcweir }
442cdf0e10cSrcweir 
443cdf0e10cSrcweir void
On_bodyStd_using(const char *)444cdf0e10cSrcweir PE_Class::On_bodyStd_using( const char * )
445cdf0e10cSrcweir {
446cdf0e10cSrcweir     pSpuUsing->Push(done);
447cdf0e10cSrcweir }
448cdf0e10cSrcweir 
449cdf0e10cSrcweir void
On_bodyStd_SwBracket_Right(const char *)450cdf0e10cSrcweir PE_Class::On_bodyStd_SwBracket_Right( const char * )
451cdf0e10cSrcweir {
452cdf0e10cSrcweir     SetTokenResult(done, stay);
453cdf0e10cSrcweir     pStati->SetCur(afterDecl);
454cdf0e10cSrcweir 
455cdf0e10cSrcweir     Env().CloseClass();
456cdf0e10cSrcweir }
457cdf0e10cSrcweir 
458cdf0e10cSrcweir void
On_bodyStd_DefineName(const char *)459cdf0e10cSrcweir PE_Class::On_bodyStd_DefineName(const char * )
460cdf0e10cSrcweir {
461cdf0e10cSrcweir 	pSpuDefs->Push(not_done);
462cdf0e10cSrcweir }
463cdf0e10cSrcweir 
464cdf0e10cSrcweir void
On_bodyStd_MacroName(const char *)465cdf0e10cSrcweir PE_Class::On_bodyStd_MacroName(const char * )
466cdf0e10cSrcweir {
467cdf0e10cSrcweir 	pSpuDefs->Push(not_done);
468cdf0e10cSrcweir }
469cdf0e10cSrcweir 
470cdf0e10cSrcweir 
471cdf0e10cSrcweir void
On_inProtection_Colon(const char *)472cdf0e10cSrcweir PE_Class::On_inProtection_Colon( const char * )
473cdf0e10cSrcweir {
474cdf0e10cSrcweir     SetTokenResult(done, stay);
475cdf0e10cSrcweir     pStati->SetCur(bodyStd);
476cdf0e10cSrcweir }
477cdf0e10cSrcweir 
478cdf0e10cSrcweir void
On_afterDecl_Semicolon(const char *)479cdf0e10cSrcweir PE_Class::On_afterDecl_Semicolon( const char * )
480cdf0e10cSrcweir {
481cdf0e10cSrcweir 	SetTokenResult(not_done, pop_success);
482cdf0e10cSrcweir 	eResult_KindOf = is_declaration;
483cdf0e10cSrcweir }
484cdf0e10cSrcweir 
485cdf0e10cSrcweir void
On_afterDecl_Return2Type(const char *)486cdf0e10cSrcweir PE_Class::On_afterDecl_Return2Type( const char * )
487cdf0e10cSrcweir {
488cdf0e10cSrcweir 	SetTokenResult(not_done, pop_success);
489cdf0e10cSrcweir 	eResult_KindOf = is_implicit_declaration;
490cdf0e10cSrcweir }
491cdf0e10cSrcweir 
492cdf0e10cSrcweir 
493cdf0e10cSrcweir }   // namespace cpp
494cdf0e10cSrcweir 
495cdf0e10cSrcweir 
496cdf0e10cSrcweir 
497cdf0e10cSrcweir 
498