summaryrefslogtreecommitdiffstats
path: root/src/libixion/debug.hpp
blob: 32f5c6eac9b1ad84c83b71e56c01cb8ffd91c718 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

#ifndef INCLUDED_IXION_DEBUG_HPP
#define INCLUDED_IXION_DEBUG_HPP

#include <string>

#if defined(IXION_DEBUG_ON) || defined(IXION_TRACE_ON)
#include <iostream>
#endif

#ifdef IXION_DEBUG_ON
#define IXION_DEBUG(stream) \
    do { std::cerr << "[ixion]:[DEBUG]:" << __FILE__ << ":" << __LINE__ << ":" << __FUNCTION__ << ": " << stream << std::endl; } while (false)
#else
#define IXION_DEBUG(...)
#endif

#ifdef IXION_TRACE_ON
#define IXION_TRACE(stream) \
    do { std::cerr << "[ixion]:[TRACE]:" << __FILE__ << ":" << __LINE__ << ":" << __FUNCTION__ << ": " << stream << std::endl; } while (false)
#else
#define IXION_TRACE(...)
#endif

namespace ixion {

class formula_cell;
struct formula_token;
struct abs_address_t;
class model_context;

namespace detail {

std::string print_formula_expression(const model_context& cxt, const abs_address_t& pos, const formula_cell& cell);
std::string print_formula_token_repr(const formula_token& t);

}}

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */