1 /* Special test file for Semantic Analyzer and complex C++ inheritance.
5 #include "testsubclass.hh"
7 void animal::moose::setFeet(int numfeet
) //^1^
10 std::cerr
<< "Why would a moose have more than 4 feet?" << std::endl
;
17 int animal::moose::getFeet() //^2^
22 void animal::moose::doNothing() //^3^
27 ; // #15# ( "NAME1" "NAME2" "NAME3" )
31 void deer::moose::setAntlers(bool have_antlers
) //^4^
33 fAntlers
= have_antlers
;
36 bool deer::moose::getAntlers() //^5^
37 // %1% ( ( "testsubclass.cpp" "testsubclass.hh" ) ( "deer::moose::doSomething" "deer::moose::getAntlers" "moose" ) )
42 bool i_dont_have_symrefs()
43 // %2% ( ("testsubclass.cpp" ) ("i_dont_have_symrefs"))
47 void deer::moose::doSomething() //^6^
49 // All these functions should be identified by semantic analyzer.
63 void deer::alces::setLatin(bool l
) {
67 bool deer::alces::getLatin() {
71 void deer::alces::doLatinStuff(moose moosein
) {
72 // All these functions should be identified by semantic analyzer.
86 moose
deer::alces::createMoose()
88 moose MooseVariableName
;
94 MooseVariableName
= createMoose();
96 doLatinStuff(MooseVariableName
);
99 // #1# ( "fAlcesBool" "fIsValid" "fLatin" )
103 // #2# ( "fAlcesInt" "fGreek" "fIsProtectedInt" )
107 // #3# ( "fAlcesBool" "fIsValid" "fLatin" "fool" )
111 // #4# ( "fAlcesInt" "fGreek" "fIsProtectedInt" "fast" )
114 MooseVariableName
= m
// -5-
117 return MooseVariableName
;
120 /** Test Scope Changes
122 * This function is rigged to make sure the scope changes to account
123 * for different locations in local variable parsing.
125 int someFunction(int mPickle
)
127 moose mMoose
= deer::alces::createMoose();
134 // #5# ( "mMoose" "mOption1" "mPickle" )
142 // #6# ( "mMoose" "mOption2" "mPickle" )
148 // Thanks Ming-Wei Chang for this next example.
163 // #7# ( "private_a" "public_a" )
167 int some_regular_function(){
170 // #8# ( "public_a" )
178 /** Test Scope w/in a function (non-method) with classes using
179 * different levels of inheritance.
183 sneaky::antelope
Antelope(1);
184 sneaky::jackalope
Jackalope(1);
185 sneaky::bugalope
Bugalope(1);
188 // #9# ( "fAntyPublic" "fQuadPublic" "testAccess")
192 // #10# ( "fBunnyPublic" "testAccess")
202 // #11# ( "fBugPublic" "testAccess")
208 /** Test methods within each class for types of access to the baseclass.
211 bool sneaky::antelope::testAccess() //^7^
214 // #12# ( "fAntyPrivate" "fAntyProtected" "fAntyPublic" "fQuadProtected" "fQuadPublic" "testAccess" )
218 bool sneaky::jackalope::testAccess() //^8^
221 // #13# ( "fBunnyPrivate" "fBunnyProtected" "fBunnyPublic" "fQuadProtected" "fQuadPublic" "testAccess" )
225 bool sneaky::bugalope::testAccess() //^9^
228 // #14# ( "fBugPrivate" "fBugProtected" "fBugPublic" "fQuadPublic" "testAccess" )
232 // arch-tag: 20a08c42-9ba6-4c8d-966a-893b37c841ef