Branch data Line data Source code
1 : : /****************************************************************************** 2 : : * This file is part of the cvc5 project. 3 : : * 4 : : * Copyright (c) 2009-2026 by the authors listed in the file AUTHORS 5 : : * in the top-level source directory and their institutional affiliations. 6 : : * All rights reserved. See the file COPYING in the top-level source 7 : : * directory for licensing information. 8 : : * **************************************************************************** 9 : : * 10 : : * Implementation of command objects. 11 : : */ 12 : : 13 : : #include "parser/command_status.h" 14 : : 15 : : #include "printer/printer.h" 16 : : 17 : : using namespace std; 18 : : 19 : : namespace cvc5::parser { 20 : : 21 : : const CommandSuccess* CommandSuccess::s_instance = new CommandSuccess(); 22 : : const CommandInterrupted* CommandInterrupted::s_instance = 23 : : new CommandInterrupted(); 24 : : 25 : 148 : std::ostream& operator<<(std::ostream& out, const CommandStatus& s) 26 : : { 27 : 148 : s.toStream(out); 28 : 148 : return out; 29 : : } 30 : : 31 : 0 : ostream& operator<<(ostream& out, const CommandStatus* s) 32 : : { 33 [ - - ]: 0 : if (s == nullptr) 34 : : { 35 : 0 : out << "null"; 36 : : } 37 : : else 38 : : { 39 : 0 : out << *s; 40 : : } 41 : 0 : return out; 42 : : } 43 : : 44 : 23 : void CommandSuccess::toStream(std::ostream& out) const 45 : : { 46 : 23 : internal::Printer::getPrinter(out)->toStreamCmdSuccess(out); 47 : 23 : } 48 : : 49 : 0 : void CommandInterrupted::toStream(std::ostream& out) const 50 : : { 51 : 0 : internal::Printer::getPrinter(out)->toStreamCmdInterrupted(out); 52 : 0 : } 53 : : 54 : 6 : void CommandUnsupported::toStream(std::ostream& out) const 55 : : { 56 : 6 : internal::Printer::getPrinter(out)->toStreamCmdUnsupported(out); 57 : 6 : } 58 : : 59 : 83 : void CommandFailure::toStream(std::ostream& out) const 60 : : { 61 : 83 : internal::Printer::getPrinter(out)->toStreamCmdFailure(out, d_message); 62 : 83 : } 63 : : 64 : 36 : void CommandRecoverableFailure::toStream(std::ostream& out) const 65 : : { 66 : 36 : internal::Printer::getPrinter(out)->toStreamCmdRecoverableFailure(out, 67 : 36 : d_message); 68 : 36 : } 69 : : 70 : : } // namespace cvc5::parser