msousa@678: /* msousa@678: * matiec - a compiler for the programming languages defined in IEC 61131-3 msousa@678: * Copyright (C) 2003-2011 Mario de Sousa (msousa@fe.up.pt) msousa@678: * Copyright (C) 2007-2011 Laurent Bessard and Edouard Tisserant msousa@678: * msousa@678: * This program is free software: you can redistribute it and/or modify msousa@678: * it under the terms of the GNU General Public License as published by msousa@678: * the Free Software Foundation, either version 3 of the License, or msousa@678: * (at your option) any later version. msousa@678: * msousa@678: * This program is distributed in the hope that it will be useful, msousa@678: * but WITHOUT ANY WARRANTY; without even the implied warranty of msousa@678: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the msousa@678: * GNU General Public License for more details. msousa@678: * msousa@678: * You should have received a copy of the GNU General Public License msousa@678: * along with this program. If not, see . msousa@678: * msousa@678: * msousa@678: * This code is made available on the understanding that it will not be msousa@678: * used in safety-critical situations without a full and competent review. msousa@678: */ msousa@678: msousa@678: /* msousa@678: * An IEC 61131-3 compiler. msousa@678: * msousa@678: * Based on the msousa@678: * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10) msousa@678: * msousa@678: */ msousa@678: msousa@678: msousa@678: /* msousa@678: * Some classes to help with debuging. msousa@678: * msousa@678: * These classes will print out the current state of a symbol or a portion of the Abstract Syntax Tree. msousa@678: */ msousa@678: msousa@678: msousa@678: msousa@678: msousa@678: msousa@678: msousa@725: #include "../absyntax/absyntax.hh" msousa@678: msousa@678: msousa@725: class debug_c { msousa@678: public: mjsousa@979: static void print(const_value_c cvalue); mjsousa@979: static void print(symbol_c *symbol); mjsousa@979: static void print(const char *str); msousa@678: msousa@725: /* print the AST from this point downwards */ msousa@725: static void print_ast(symbol_c *root_symbol); msousa@678: }; msousa@678: msousa@678: msousa@678: msousa@678: msousa@678: msousa@678: msousa@678: msousa@678: msousa@678: msousa@678: msousa@678: msousa@678: msousa@678: msousa@678: msousa@678: msousa@678: msousa@725: msousa@725: