A set of benchmarks to compare a new prototype MiniZinc implementation
at develop 935 B view raw
1/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */ 2 3/* 4 * Main authors: 5 * Guido Tack <guido.tack@monash.edu> 6 */ 7 8/* This Source Code Form is subject to the terms of the Mozilla Public 9 * License, v. 2.0. If a copy of the MPL was not distributed with this 10 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 11 12#ifndef __MINIZINC_PATHPRINTER_HH 13#define __MINIZINC_PATHPRINTER_HH 14 15#include <minizinc/ast.hh> 16 17#include <unordered_map> 18 19namespace MiniZinc { 20 21class Model; 22 23class PathFilePrinter { 24 typedef std::pair<std::string, std::string> NamePair; 25 typedef std::unordered_map<Id*, NamePair> NameMap; 26 27 NameMap betternames; 28 29private: 30 std::ostream& os; 31 int constraint_index; 32 33 void addBetterName(Id* id, std::string name, std::string path, bool overwrite); 34 35public: 36 PathFilePrinter(std::ostream& o, EnvI& envi); 37 void print(Model* m); 38 void print(Item* i); 39}; 40 41} // namespace MiniZinc 42 43#endif