absyntax/absyntax.hh
author laurent
Sat, 12 Dec 2009 20:41:32 +0100
changeset 233 3d23a68183d3
parent 69 41cb5b80416e
child 261 db2ad6541d92
permissions -rwxr-xr-x
Bug on standard functions called with literals fixed
Checking that number of parameters in function call doesn't exceed the maximum
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
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
     2
 * (c) 2003 Mario de Sousa
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
     3
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
     4
 * Offered to the public under the terms of the GNU General Public License
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
     5
 * as published by the Free Software Foundation; either version 2 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
     6
 * License, or (at your option) any later version.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
     7
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
     8
 * This program is distributed in the hope that it will be useful, but
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
     9
 * WITHOUT ANY WARRANTY; without even the implied warranty of
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    11
 * Public License for more details.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    12
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    13
 * 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
    14
 * 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
    15
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    16
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    17
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    18
 * An IEC 61131-3 IL and ST compiler.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    19
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    20
 * 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
    21
 * 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
    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
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    24
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
 * 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
    27
 */
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
 * 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
    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
 * 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
    33
 * 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
    34
 * 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
    35
 * 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
    36
 */
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
#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
    39
#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
    40
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    41
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    42
#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
    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
/* 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
    45
 * 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
    46
 * 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
    47
 * 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
    48
 * 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
    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
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
    51
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    52
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    53
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
    54
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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    57
/* 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
    58
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
    59
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    60
  public:
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
     * 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
    63
     */
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    64
    int first_line;
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    65
    int first_column;
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    66
    int last_line;
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    67
    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
    68
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    69
  public:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    70
    /* 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
    71
    symbol_c(void);
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    72
    symbol_c(int fl     /* first_line   */, 
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    73
             int fc     /* first_column */,
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    74
             int ll = 0 /* last_line    */,
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    75
             int lc = 0 /* last_column  */
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    76
            );
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    77
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    78
    /* 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
    79
    /* 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
    80
    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
    81
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    82
    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
    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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    85
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    86
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
    87
  public:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    88
    /* 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
    89
    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
    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
  public:
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    92
    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
    93
};
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    94
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    95
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    96
 /* 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
    97
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
    98
  public:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    99
    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
   100
    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
   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
  public:
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   103
    list_c(int fl = 0, int fc = 0, int ll = 0, int lc = 0);
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   104
    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
   105
     /* 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
   106
    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
   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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   109
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   110
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   111
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   112
#define SYM_LIST(class_name_c)								\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   113
class class_name_c:	public list_c {							\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   114
  public:										\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   115
    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
   116
    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
   117
    virtual void *accept(visitor_c &visitor);						\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   118
};
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   119
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   120
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   121
#define SYM_TOKEN(class_name_c)								\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   122
class class_name_c: 	public token_c {						\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   123
  public:										\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   124
    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
   125
    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
   126
};
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   127
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   128
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   129
#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
   130
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
   131
  public:					\
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   132
    class_name_c(int fl = 0, int fc = 0, 	\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   133
		 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
   134
    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
   135
};
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   136
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   137
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   138
#define SYM_REF1(class_name_c, ref1)			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   139
class class_name_c: public symbol_c {			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   140
  public:						\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   141
    symbol_c *ref1;					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   142
  public:						\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   143
    class_name_c(symbol_c *ref1,			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   144
		 int fl = 0, int fc = 0, 		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   145
		 int ll = 0, int lc = 0);		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   146
    virtual void *accept(visitor_c &visitor);		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   147
};
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   148
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   149
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   150
#define SYM_REF2(class_name_c, ref1, ref2)		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   151
class class_name_c: public symbol_c {			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   152
  public:						\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   153
    symbol_c *ref1;					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   154
    symbol_c *ref2;					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   155
  public:						\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   156
    class_name_c(symbol_c *ref1,			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   157
		 symbol_c *ref2 = NULL,			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   158
		 int fl = 0, int fc = 0, 		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   159
		 int ll = 0, int lc = 0);		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   160
    virtual void *accept(visitor_c &visitor);		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   161
};
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   162
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   163
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   164
#define SYM_REF3(class_name_c, ref1, ref2, ref3)	\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   165
class class_name_c: public symbol_c {			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   166
  public:						\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   167
    symbol_c *ref1;					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   168
    symbol_c *ref2;					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   169
    symbol_c *ref3;					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   170
  public:						\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   171
    class_name_c(symbol_c *ref1,			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   172
		 symbol_c *ref2,			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   173
		 symbol_c *ref3,			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   174
		 int fl = 0, int fc = 0, 		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   175
		 int ll = 0, int lc = 0);		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   176
    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
   177
};
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   178
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   179
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   180
#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
   181
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
   182
  public:						\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   183
    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
   184
    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
   185
    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
   186
    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
   187
  public:						\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   188
    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
   189
		 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
   190
		 symbol_c *ref3,			\
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   191
		 symbol_c *ref4 = NULL,			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   192
		 int fl = 0, int fc = 0, 		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   193
		 int ll = 0, int lc = 0);		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   194
    virtual void *accept(visitor_c &visitor);		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   195
};
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   196
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   197
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   198
#define SYM_REF5(class_name_c, ref1, ref2, ref3, ref4, ref5)		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   199
class class_name_c: public symbol_c {					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   200
  public:								\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   201
    symbol_c *ref1;							\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   202
    symbol_c *ref2;							\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   203
    symbol_c *ref3;							\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   204
    symbol_c *ref4;							\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   205
    symbol_c *ref5;							\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   206
  public:								\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   207
    class_name_c(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
		 int fl = 0, int fc = 0, 				\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   213
		 int ll = 0, int lc = 0);				\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   214
    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
   215
};
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   216
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   217
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   218
#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
   219
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
   220
  public:								\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   221
    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
   222
    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
   223
    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
   224
    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
   225
    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
   226
    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
   227
  public:								\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   228
    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
   229
		 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
   230
		 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
   231
		 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
   232
		 symbol_c *ref5,					\
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   233
		 symbol_c *ref6 = NULL,					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   234
		 int fl = 0, int fc = 0, 				\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   235
		 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
   236
    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
   237
};
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   238
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   239
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   240
#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
   241
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   242
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
#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
   245
#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
   246
#undef SYM_REF0
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   247
#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
   248
#undef SYM_REF2
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   249
#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
   250
#undef SYM_REF4
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   251
#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
   252
#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
   253
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   254
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   255
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   256
#endif /*  _ABSYNTAX_HH */