msousa@677: /*
msousa@677: * matiec - a compiler for the programming languages defined in IEC 61131-3
msousa@677: *
msousa@677: * Copyright (C) 2012 Mario de Sousa (msousa@fe.up.pt)
msousa@677: *
msousa@677: *
msousa@677: * This program is free software: you can redistribute it and/or modify
msousa@677: * it under the terms of the GNU General Public License as published by
msousa@677: * the Free Software Foundation, either version 3 of the License, or
msousa@677: * (at your option) any later version.
msousa@677: *
msousa@677: * This program is distributed in the hope that it will be useful,
msousa@677: * but WITHOUT ANY WARRANTY; without even the implied warranty of
msousa@677: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
msousa@677: * GNU General Public License for more details.
msousa@677: *
msousa@677: * You should have received a copy of the GNU General Public License
msousa@677: * along with this program. If not, see .
msousa@677: *
msousa@677: *
msousa@677: * This code is made available on the understanding that it will not be
msousa@677: * used in safety-critical situations without a full and competent review.
msousa@677: */
msousa@677:
msousa@677: /*
msousa@677: * An IEC 61131-3 compiler.
msousa@677: *
msousa@677: * Based on the
msousa@677: * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
msousa@677: *
msousa@677: */
msousa@677:
msousa@677:
msousa@677: /*
msousa@677: * forced_narrow_candidate_datatypes_c
msousa@677: *
msousa@677: */
msousa@677:
msousa@677:
msousa@677:
msousa@677: #include "../absyntax_utils/absyntax_utils.hh"
msousa@677: #include "narrow_candidate_datatypes.hh"
msousa@677:
msousa@677:
msousa@677:
msousa@677: class forced_narrow_candidate_datatypes_c: public narrow_candidate_datatypes_c {
msousa@677:
msousa@677: private:
msousa@691: void forced_narrow_il_instruction(symbol_c *symbol, std::vector &next_il_instruction);
msousa@691:
msousa@677: public:
msousa@677: forced_narrow_candidate_datatypes_c(symbol_c *ignore);
msousa@677: virtual ~forced_narrow_candidate_datatypes_c(void);
msousa@691:
msousa@677: /****************************************/
msousa@677: /* B.2 - Language IL (Instruction List) */
msousa@677: /****************************************/
msousa@677: /***********************************/
msousa@677: /* B 2.1 Instructions and Operands */
msousa@677: /***********************************/
msousa@677: void *visit(instruction_list_c *symbol);
msousa@677: void *visit(il_instruction_c *symbol);
msousa@677: // void *visit(il_simple_operation_c *symbol);
msousa@677: // void *visit(il_function_call_c *symbol);
msousa@677: // void *visit(il_expression_c *symbol);
msousa@677: // void *visit(il_jump_operation_c *symbol);
msousa@677: // void *visit(il_fb_call_c *symbol);
msousa@677: // void *visit(il_formal_funct_call_c *symbol);
msousa@677: // void *visit(il_operand_list_c *symbol);
msousa@677: // void *visit(simple_instr_list_c *symbol);
msousa@691: void *visit(il_simple_instruction_c*symbol);
msousa@677: // void *visit(il_param_list_c *symbol);
msousa@677: // void *visit(il_param_assignment_c *symbol);
msousa@677: // void *visit(il_param_out_assignment_c *symbol);
msousa@677: // void *visit(il_assign_operator_c *symbol);
msousa@677: // void *visit(il_assign_operator_c *symbol);
msousa@681:
msousa@681: /***************************************/
msousa@681: /* B.3 - Language ST (Structured Text) */
msousa@681: /***************************************/
msousa@681: void *visit(statement_list_c *symbol);
msousa@677: }; // forced_narrow_candidate_datatypes_c
msousa@677:
msousa@677:
msousa@677:
msousa@677:
msousa@677:
msousa@677:
msousa@677:
msousa@677:
msousa@681: