stage1_2/stage1_2.hh
author Mario de Sousa <msousa@fe.up.pt>
Mon, 04 Apr 2011 10:48:30 +0100
changeset 268 1eba01e3fb70
parent 264 6facabd9c2cd
child 279 c0453b7f99df
permissions -rwxr-xr-x
Adding Makefile for Darwin (thanks go to Manuele)
177
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
     1
/*
264
6facabd9c2cd Updating License info (with Edoaurd's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 177
diff changeset
     2
 *  matiec - a compiler for the programming languages defined in IEC 61131-3
177
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
     3
 *
264
6facabd9c2cd Updating License info (with Edoaurd's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 177
diff changeset
     4
 *  Copyright (C) 2003-2011  Mario de Sousa (msousa@fe.up.pt)
177
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
     5
 *
264
6facabd9c2cd Updating License info (with Edoaurd's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 177
diff changeset
     6
 *  This program is free software: you can redistribute it and/or modify
6facabd9c2cd Updating License info (with Edoaurd's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 177
diff changeset
     7
 *  it under the terms of the GNU General Public License as published by
6facabd9c2cd Updating License info (with Edoaurd's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 177
diff changeset
     8
 *  the Free Software Foundation, either version 3 of the License, or
6facabd9c2cd Updating License info (with Edoaurd's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 177
diff changeset
     9
 *  (at your option) any later version.
6facabd9c2cd Updating License info (with Edoaurd's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 177
diff changeset
    10
 *
6facabd9c2cd Updating License info (with Edoaurd's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 177
diff changeset
    11
 *  This program is distributed in the hope that it will be useful,
6facabd9c2cd Updating License info (with Edoaurd's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 177
diff changeset
    12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
6facabd9c2cd Updating License info (with Edoaurd's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 177
diff changeset
    13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
6facabd9c2cd Updating License info (with Edoaurd's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 177
diff changeset
    14
 *  GNU General Public License for more details.
6facabd9c2cd Updating License info (with Edoaurd's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 177
diff changeset
    15
 *
6facabd9c2cd Updating License info (with Edoaurd's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 177
diff changeset
    16
 *  You should have received a copy of the GNU General Public License
6facabd9c2cd Updating License info (with Edoaurd's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 177
diff changeset
    17
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
6facabd9c2cd Updating License info (with Edoaurd's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 177
diff changeset
    18
 *
177
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    19
 *
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    20
 * This code is made available on the understanding that it will not be
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    21
 * used in safety-critical situations without a full and competent review.
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    22
 */
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    23
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    24
/*
264
6facabd9c2cd Updating License info (with Edoaurd's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 177
diff changeset
    25
 * An IEC 61131-3 compiler.
177
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    26
 *
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    27
 * Based on the
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    28
 * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    29
 *
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    30
 */
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    31
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    32
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    33
/*
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    34
 * The public interface to stage1_2.cc 
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    35
 */
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    36
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    37
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    38
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    39
#ifndef _STAGE1_2_HH
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    40
#define _STAGE1_2_HH
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    41
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    42
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    43
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    44
/*
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    45
 * This file includes the interface through which the main function accesses the stage1_2 services 
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    46
 */
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    47
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    48
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    49
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    50
typedef struct {
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    51
		/******************************************************/
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    52
		/* whether we are suporting safe extensions           */
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    53
		/* as defined in PLCopen - Technical Committee 5      */
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    54
		/* Safety Software Technical Specification,           */
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    55
		/* Part 1: Concepts and Function Blocks,              */
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    56
		/* Version 1.0 – Official Release                     */
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    57
		/******************************************************/
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    58
	bool safe_extensions;
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    59
		/* error messages specify full token location */
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    60
	bool full_token_loc; 
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    61
		/* Include directory, where included files will be searched for... */
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    62
	const char *includedir;
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    63
} stage1_2_options_t;
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    64
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    65
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    66
int stage1_2(const char *filename, symbol_c **tree_root, stage1_2_options_t options);
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    67
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    68
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    69
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    70
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    71
697562a5da7c Adding support for SAFEBOOL. Some code generation yet to do...
mario
parents:
diff changeset
    72
#endif   /* _STAGE1_2_HH */