MCPcopy Create free account
hub / github.com/Gecode/gecode / getOutput

Method getOutput

gecode/flatzinc/parser.hh:249–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247 }
248
249 AST::Array* getOutput(void) {
250 OutputOrder oo;
251 std::sort(_output.begin(),_output.end(),oo);
252 AST::Array* a = new AST::Array();
253 for (unsigned int i=0; i<_output.size(); i++) {
254 a->a.push_back(new AST::String(_output[i].first+" = "));
255 if (_output[i].second->isArray()) {
256 AST::Array* oa = _output[i].second->getArray();
257 for (unsigned int j=0; j<oa->a.size(); j++) {
258 a->a.push_back(oa->a[j]);
259 oa->a[j] = nullptr;
260 }
261 delete _output[i].second;
262 } else {
263 a->a.push_back(_output[i].second);
264 }
265 a->a.push_back(new AST::String(";\n"));
266 }
267 return a;
268 }
269
270 };
271

Callers 1

fillPrinterFunction · 0.80

Calls 6

sortFunction · 0.85
isArrayMethod · 0.80
getArrayMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected