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 #pragma once 13 14 #include <minizinc/ast.hh> 15 16 #include <unordered_map> 17 18 namespace MiniZinc { 19 20 class Model; 21 22 class PathFilePrinter { 23 typedef std::pair<std::string, std::string> NamePair; 24 typedef std::unordered_map<Id*, NamePair> NameMap; 25 26 private: 27 NameMap _betternames; 28 std::ostream& _os; 29 int _constraintIndex; 30 31 void addBetterName(Id* id, const std::string& name, const std::string& path, bool overwrite); 32 33 public: 34 PathFilePrinter(std::ostream& o, EnvI& envi); 35 void print(Model* m); 36 void print(Item* i); 37 }; 38 39 } // namespace MiniZinc 40