absyntax/absyntax.hh
author Edouard Tisserant
Mon, 04 Apr 2011 18:54:55 +0200
changeset 273 beb05fe75e0c
parent 261 db2ad6541d92
child 279 c0453b7f99df
permissions -rwxr-xr-x
Make semantic error message compatible with beremiz
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
     1
/*
261
db2ad6541d92 Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents: 69
diff changeset
     2
 *  matiec - a compiler for the programming languages defined in IEC 61131-3
db2ad6541d92 Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents: 69
diff changeset
     3
 *  Copyright (C) 2003-2011  Mario de Sousa (msousa@fe.up.pt)
db2ad6541d92 Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents: 69
diff changeset
     4
 *
db2ad6541d92 Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents: 69
diff changeset
     5
 *  This program is free software: you can redistribute it and/or modify
db2ad6541d92 Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents: 69
diff changeset
     6
 *  it under the terms of the GNU General Public License as published by
db2ad6541d92 Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents: 69
diff changeset
     7
 *  the Free Software Foundation, either version 3 of the License, or
db2ad6541d92 Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents: 69
diff changeset
     8
 *  (at your option) any later version.
db2ad6541d92 Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents: 69
diff changeset
     9
 *
db2ad6541d92 Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents: 69
diff changeset
    10
 *  This program is distributed in the hope that it will be useful,
db2ad6541d92 Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents: 69
diff changeset
    11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
db2ad6541d92 Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents: 69
diff changeset
    12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
db2ad6541d92 Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents: 69
diff changeset
    13
 *  GNU General Public License for more details.
db2ad6541d92 Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents: 69
diff changeset
    14
 *
db2ad6541d92 Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents: 69
diff changeset
    15
 *  You should have received a copy of the GNU General Public License
db2ad6541d92 Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents: 69
diff changeset
    16
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
db2ad6541d92 Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents: 69
diff changeset
    17
 *
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    18
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    19
 * This code is made available on the understanding that it will not be
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    20
 * used in safety-critical situations without a full and competent review.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    21
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    22
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    23
/*
261
db2ad6541d92 Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents: 69
diff changeset
    24
 * An IEC 61131-3 compiler.
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    25
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    26
 * Based on the
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    27
 * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    28
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    29
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    30
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    31
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    32
 * Declaration of the Abstract Syntax data structure components
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    33
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    34
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    35
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    36
 * ABSYNTAX.H
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    37
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    38
 * This generates the parse tree structure used to bind the components
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    39
 * identified by Bison in the correct syntax order. At the end of the
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    40
 * Bison analysis the tree is walked in a sequential fashion generating
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    41
 * the relavent code.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    42
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    43
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    44
#ifndef _ABSYNTAX_HH
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    45
#define _ABSYNTAX_HH
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    46
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    47
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    48
#include <stdio.h> // required for NULL
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    49
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    50
/* Forward declaration of the visitor interface
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    51
 * dclared in the visitor.hh file
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    52
 * We cannot include the visitor.hh file, as it will
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    53
 * include this same file first, as it too requires references
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    54
 * to the abstract syntax classes defined here.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    55
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    56
class visitor_c; // forward declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    57
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    58
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    59
class symbol_c; // forward declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    60
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    61
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    62
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    63
/* The base class of all symbols */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    64
class symbol_c {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    65
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    66
  public:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    67
    /*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    68
     * Line number for the purposes of error checking
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    69
     */
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    70
    int first_line;
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    71
    int first_column;
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    72
    int last_line;
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    73
    int last_column;
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    74
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    75
  public:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    76
    /* default constructor */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    77
    symbol_c(void);
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    78
    symbol_c(int fl     /* first_line   */, 
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    79
             int fc     /* first_column */,
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    80
             int ll = 0 /* last_line    */,
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    81
             int lc = 0 /* last_column  */
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    82
            );
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    83
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    84
    /* default destructor */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    85
    /* must be virtual so compiler does not complain... */ 
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    86
    virtual ~symbol_c(void) {return;};
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    87
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    88
    virtual void *accept(visitor_c &visitor) {return NULL;};
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    89
};
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    90
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    91
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    92
class token_c: public symbol_c {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    93
  public:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    94
    /* the value of the symbol. */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    95
    const char *value;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    96
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    97
  public:
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    98
    token_c(const char *value, int fl = 0, int fc = 0, int ll = 0, int lc = 0);
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    99
};
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   100
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   101
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   102
 /* a list of symbols... */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   103
class list_c: public symbol_c {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   104
  public:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   105
    int n;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   106
    symbol_c **elements;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   107
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   108
  public:
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   109
    list_c(int fl = 0, int fc = 0, int ll = 0, int lc = 0);
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   110
    list_c(symbol_c *elem, int fl = 0, int fc = 0, int ll = 0, int lc = 0);
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   111
     /* insert a new element */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   112
    virtual void add_element(symbol_c *elem);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   113
};
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   114
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   115
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   116
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   117
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   118
#define SYM_LIST(class_name_c)								\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   119
class class_name_c:	public list_c {							\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   120
  public:										\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   121
    class_name_c(int fl = 0, int fc = 0, int ll = 0, int lc = 0);			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   122
    class_name_c(symbol_c *elem, int fl = 0, int fc = 0, int ll = 0, int lc = 0);	\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   123
    virtual void *accept(visitor_c &visitor);						\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   124
};
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   125
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   126
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   127
#define SYM_TOKEN(class_name_c)								\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   128
class class_name_c: 	public token_c {						\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   129
  public:										\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   130
    class_name_c(const char *value, int fl = 0, int fc = 0, int ll = 0, int lc = 0);	\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   131
    virtual void *accept(visitor_c &visitor);						\
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   132
};
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   133
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   134
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   135
#define SYM_REF0(class_name_c)			\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   136
class class_name_c: public symbol_c {		\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   137
  public:					\
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   138
    class_name_c(int fl = 0, int fc = 0, 	\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   139
		 int ll = 0, int lc = 0);	\
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   140
    virtual void *accept(visitor_c &visitor);	\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   141
};
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   142
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   143
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   144
#define SYM_REF1(class_name_c, ref1)			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   145
class class_name_c: public symbol_c {			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   146
  public:						\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   147
    symbol_c *ref1;					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   148
  public:						\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   149
    class_name_c(symbol_c *ref1,			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   150
		 int fl = 0, int fc = 0, 		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   151
		 int ll = 0, int lc = 0);		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   152
    virtual void *accept(visitor_c &visitor);		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   153
};
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   154
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   155
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   156
#define SYM_REF2(class_name_c, ref1, ref2)		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   157
class class_name_c: public symbol_c {			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   158
  public:						\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   159
    symbol_c *ref1;					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   160
    symbol_c *ref2;					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   161
  public:						\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   162
    class_name_c(symbol_c *ref1,			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   163
		 symbol_c *ref2 = NULL,			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   164
		 int fl = 0, int fc = 0, 		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   165
		 int ll = 0, int lc = 0);		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   166
    virtual void *accept(visitor_c &visitor);		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   167
};
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   168
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   169
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   170
#define SYM_REF3(class_name_c, ref1, ref2, ref3)	\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   171
class class_name_c: public symbol_c {			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   172
  public:						\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   173
    symbol_c *ref1;					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   174
    symbol_c *ref2;					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   175
    symbol_c *ref3;					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   176
  public:						\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   177
    class_name_c(symbol_c *ref1,			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   178
		 symbol_c *ref2,			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   179
		 symbol_c *ref3,			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   180
		 int fl = 0, int fc = 0, 		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   181
		 int ll = 0, int lc = 0);		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   182
    virtual void *accept(visitor_c &visitor);		\
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   183
};
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   184
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   185
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   186
#define SYM_REF4(class_name_c, ref1, ref2, ref3, ref4)	\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   187
class class_name_c: public symbol_c {			\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   188
  public:						\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   189
    symbol_c *ref1;					\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   190
    symbol_c *ref2;					\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   191
    symbol_c *ref3;					\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   192
    symbol_c *ref4;					\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   193
  public:						\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   194
    class_name_c(symbol_c *ref1,			\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   195
		 symbol_c *ref2,			\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   196
		 symbol_c *ref3,			\
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   197
		 symbol_c *ref4 = NULL,			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   198
		 int fl = 0, int fc = 0, 		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   199
		 int ll = 0, int lc = 0);		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   200
    virtual void *accept(visitor_c &visitor);		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   201
};
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   202
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   203
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   204
#define SYM_REF5(class_name_c, ref1, ref2, ref3, ref4, ref5)		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   205
class class_name_c: public symbol_c {					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   206
  public:								\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   207
    symbol_c *ref1;							\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   208
    symbol_c *ref2;							\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   209
    symbol_c *ref3;							\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   210
    symbol_c *ref4;							\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   211
    symbol_c *ref5;							\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   212
  public:								\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   213
    class_name_c(symbol_c *ref1,					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   214
		 symbol_c *ref2,					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   215
		 symbol_c *ref3,					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   216
		 symbol_c *ref4,					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   217
		 symbol_c *ref5,					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   218
		 int fl = 0, int fc = 0, 				\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   219
		 int ll = 0, int lc = 0);				\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   220
    virtual void *accept(visitor_c &visitor);				\
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   221
};
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   222
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   223
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   224
#define SYM_REF6(class_name_c, ref1, ref2, ref3, ref4, ref5, ref6)	\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   225
class class_name_c: public symbol_c {					\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   226
  public:								\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   227
    symbol_c *ref1;							\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   228
    symbol_c *ref2;							\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   229
    symbol_c *ref3;							\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   230
    symbol_c *ref4;							\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   231
    symbol_c *ref5;							\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   232
    symbol_c *ref6;							\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   233
  public:								\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   234
    class_name_c(symbol_c *ref1,					\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   235
		 symbol_c *ref2,					\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   236
		 symbol_c *ref3,					\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   237
		 symbol_c *ref4,					\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   238
		 symbol_c *ref5,					\
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   239
		 symbol_c *ref6 = NULL,					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   240
		 int fl = 0, int fc = 0, 				\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   241
		 int ll = 0, int lc = 0);				\
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   242
    virtual void *accept(visitor_c &visitor);				\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   243
};
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   244
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   245
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   246
#include "absyntax.def"
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   247
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   248
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   249
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   250
#undef SYM_LIST
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   251
#undef SYM_TOKEN
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   252
#undef SYM_REF0
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   253
#undef SYM_REF1
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   254
#undef SYM_REF2
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   255
#undef SYM_REF3
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   256
#undef SYM_REF4
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   257
#undef SYM_REF5
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   258
#undef SYM_REF6
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   259
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   260
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   261
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   262
#endif /*  _ABSYNTAX_HH */