generate_IEC_std.py
changeset 59 af079a11837b
parent 58 39cd981ff242
child 115 017a65259f07
equal deleted inserted replaced
58:39cd981ff242 59:af079a11837b
    53  *
    53  *
    54  * This program is distributed in the hope that it will be useful, but
    54  * This program is distributed in the hope that it will be useful, but
    55  * WITHOUT ANY WARRANTY; without even the implied warranty of
    55  * WITHOUT ANY WARRANTY; without even the implied warranty of
    56  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
    56  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
    57  * Public License for more details.
    57  * Public License for more details.
       
    58  *
       
    59  * This code is made available on the understanding that it will not be
       
    60  * used in safety-critical situations without a full and competent review.
       
    61  */
       
    62 
       
    63 /*
       
    64  * An IEC 61131-3 IL and ST compiler.
       
    65  *
       
    66  * Based on the
       
    67  * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
       
    68  *
       
    69  */
       
    70  
       
    71  """
       
    72 
       
    73 matiec_lesser_header = """/*
       
    74  * (c) 2003 Mario de Sousa
       
    75  *
       
    76  * Offered to the public under the terms of the GNU Lesser General Public
       
    77  * License as published by the Free Software Foundation; either version 2
       
    78  * of the License, or (at your option) any later version.
       
    79  *
       
    80  * This program is distributed in the hope that it will be useful, but
       
    81  * WITHOUT ANY WARRANTY; without even the implied warranty of
       
    82  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
       
    83  * General Public License for more details.
    58  *
    84  *
    59  * This code is made available on the understanding that it will not be
    85  * This code is made available on the understanding that it will not be
    60  * used in safety-critical situations without a full and competent review.
    86  * used in safety-critical situations without a full and competent review.
    61  */
    87  */
    62 
    88 
   363 ###################################################################
   389 ###################################################################
   364 """
   390 """
   365 Generate the part of search_expression_type_c::visit(function_invocation)
   391 Generate the part of search_expression_type_c::visit(function_invocation)
   366 that is responsible of returning type symbol for function invocation.
   392 that is responsible of returning type symbol for function invocation.
   367 """
   393 """
   368 search_type_code =  matiec_header + """
   394 search_type_code = matiec_header + """
   369 /****
   395 /****
   370  * IEC 61131-3 standard function lib
   396  * IEC 61131-3 standard function lib
   371  * generated code, do not edit by hand
   397  * generated code, do not edit by hand
   372  */
   398  */
   373 
   399 
   442 ###################################################################
   468 ###################################################################
   443 ###################################################################
   469 ###################################################################
   444 """
   470 """
   445 Generate the standard_function_names[] for inclusion in bizon generated code
   471 Generate the standard_function_names[] for inclusion in bizon generated code
   446 """
   472 """
   447 standard_function_names = """
   473 standard_function_names = matiec_header + """
   448 /****
   474 /****
   449  * IEC 61131-3 standard function lib
   475  * IEC 61131-3 standard function lib
   450  * generated code, do not edit by hand
   476  * generated code, do not edit by hand
   451  */
   477  */
   452 
   478 
   465 ###################################################################
   491 ###################################################################
   466 ###################################################################
   492 ###################################################################
   467 """
   493 """
   468 Generate the C implementation of the IEC standard function library.
   494 Generate the C implementation of the IEC standard function library.
   469 """
   495 """
   470 iec_std_lib_generated = matiec_header + """
   496 iec_std_lib_generated = matiec_lesser_header + """
   471 /****
   497 /****
   472  * IEC 61131-3 standard function lib
   498  * IEC 61131-3 standard function lib
   473  * generated code, do not edit by hand
   499  * generated code, do not edit by hand
   474  */
   500  */
   475 
   501