ccb@204: /* msousa@267: * matiec - a compiler for the programming languages defined in IEC 61131-3 ccb@204: * msousa@267: * Copyright (C) 2009-2011 Mario de Sousa (msousa@fe.up.pt) Edouard@279: * Copyright (C) 2007-2011 Laurent Bessard and Edouard Tisserant ccb@204: * msousa@267: * This program is free software: you can redistribute it and/or modify msousa@267: * it under the terms of the GNU General Public License as published by msousa@267: * the Free Software Foundation, either version 3 of the License, or msousa@267: * (at your option) any later version. msousa@267: * msousa@267: * This program is distributed in the hope that it will be useful, msousa@267: * but WITHOUT ANY WARRANTY; without even the implied warranty of msousa@267: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the msousa@267: * GNU General Public License for more details. msousa@267: * msousa@267: * You should have received a copy of the GNU General Public License msousa@267: * along with this program. If not, see . msousa@267: * ccb@204: * ccb@204: * This code is made available on the understanding that it will not be ccb@204: * used in safety-critical situations without a full and competent review. ccb@204: */ ccb@204: ccb@204: /* msousa@267: * An IEC 61131-3 compiler. ccb@204: * ccb@204: * Based on the msousa@267: * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10) ccb@204: * ccb@204: */ ccb@204: ccb@204: #include "stage3.hh" ccb@204: ccb@204: int type_safety(symbol_c *tree_root){ ccb@204: visit_expression_type_c visit_expression_type(tree_root); ccb@204: ccb@204: (*tree_root).accept(visit_expression_type); ccb@204: msousa@262: if (visit_expression_type.get_error_found()) msousa@262: return -1; msousa@262: ccb@204: return 0; ccb@204: } ccb@204: ccb@204: int stage3(symbol_c *tree_root){ ccb@204: return type_safety(tree_root); ccb@204: }