MCPcopy Create free account
hub / github.com/devosoft/avida / VisitIfBlock

Method VisitIfBlock

avida-core/source/script/cDumpASTVisitor.cc:130–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128
129
130void cDumpASTVisitor::VisitIfBlock(cASTIfBlock& node)
131{
132 indent();
133 cout << "if:" << endl;
134
135 m_depth++;
136 indent();
137 cout << "condition:" << endl;
138
139 m_depth++;
140 node.GetCondition()->Accept(*this);
141 m_depth--;
142
143 indent();
144 cout << "do:" << endl;
145
146 m_depth++;
147 node.GetCode()->Accept(*this);
148 m_depth--;
149
150 if (node.HasElseIfs()) {
151 tListIterator<cASTIfBlock::cElseIf> it = node.ElseIfIterator();
152 cASTIfBlock::cElseIf* elif = NULL;
153 while ((elif = it.Next())) {
154 indent();
155 cout << "elseif:" << endl;
156
157 m_depth++;
158 indent();
159 cout << "condition:" << endl;
160
161 m_depth++;
162 elif->GetCondition()->Accept(*this);
163 m_depth--;
164
165 indent();
166 cout << "do:" << endl;
167
168 m_depth++;
169 elif->GetCode()->Accept(*this);
170 m_depth--;
171
172 m_depth--;
173 }
174 }
175
176 if (node.HasElse()) {
177 indent();
178 cout << "else:" << endl;
179
180 m_depth++;
181 node.GetElseCode()->Accept(*this);
182 m_depth--;
183 }
184
185 m_depth--;
186
187}

Callers 1

AcceptMethod · 0.45

Calls 8

AcceptMethod · 0.80
HasElseIfsMethod · 0.80
ElseIfIteratorMethod · 0.80
HasElseMethod · 0.80
GetElseCodeMethod · 0.80
GetConditionMethod · 0.45
GetCodeMethod · 0.45
NextMethod · 0.45

Tested by

no test coverage detected