absyntax/absyntax.hh
author Edouard Tisserant
Thu, 07 Apr 2011 11:40:03 +0200
changeset 285 3a60c6ff98b1
parent 279 c0453b7f99df
child 286 a4f4990d5c66
permissions -rwxr-xr-x
Reverted semantic error message so that Beremiz can parse them and that user can double-click on error message to open related POU and select the faulty line.
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)
279
c0453b7f99df Re-generated std lib related code, with updated headers, updated all forgotten headers
Edouard Tisserant
parents: 261
diff changeset
     4
 *  Copyright (C) 2007-2011  Laurent Bessard and Edouard Tisserant
261
db2ad6541d92 Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents: 69
diff changeset
     5
 *
db2ad6541d92 Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents: 69
diff changeset
     6
 *  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
     7
 *  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
     8
 *  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
     9
 *  (at your option) any later version.
db2ad6541d92 Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents: 69
diff changeset
    10
 *
db2ad6541d92 Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents: 69
diff changeset
    11
 *  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
    12
 *  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
    13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
db2ad6541d92 Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents: 69
diff changeset
    14
 *  GNU General Public License for more details.
db2ad6541d92 Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents: 69
diff changeset
    15
 *
db2ad6541d92 Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents: 69
diff changeset
    16
 *  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
    17
 *  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
    18
 *
0
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
 * 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
    21
 * 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
    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
/*
261
db2ad6541d92 Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents: 69
diff changeset
    25
 * 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
    26
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    27
 * 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
    28
 * 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
    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
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    33
 * 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
    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
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    37
 * 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
    38
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    39
 * 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
    40
 * 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
    41
 * 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
    42
 * 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
    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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    45
#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
    46
#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
    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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    49
#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
    50
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    51
/* 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
    52
 * 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
    53
 * 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
    54
 * 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
    55
 * 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
    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
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
    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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    60
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
    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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    64
/* 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
    65
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
    66
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    67
  public:
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
     * 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
    70
     */
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    71
    int first_line;
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    72
    int first_column;
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    73
    int last_line;
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    74
    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
    75
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    76
  public:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    77
    /* 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
    78
    symbol_c(void);
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    79
    symbol_c(int fl     /* first_line   */, 
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    80
             int fc     /* first_column */,
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    81
             int ll = 0 /* last_line    */,
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    82
             int lc = 0 /* last_column  */
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    83
            );
0
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
    /* 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
    86
    /* 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
    87
    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
    88
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    89
    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
    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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    93
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
    94
  public:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    95
    /* 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
    96
    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
    97
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:
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
    99
    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
   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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   103
 /* 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
   104
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
   105
  public:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   106
    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
   107
    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
   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
  public:
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   110
    list_c(int fl = 0, int fc = 0, int ll = 0, int lc = 0);
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   111
    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
   112
     /* 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
   113
    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
   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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   118
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   119
#define SYM_LIST(class_name_c)								\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   120
class class_name_c:	public list_c {							\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   121
  public:										\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   122
    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
   123
    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
   124
    virtual void *accept(visitor_c &visitor);						\
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
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   128
#define SYM_TOKEN(class_name_c)								\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   129
class class_name_c: 	public token_c {						\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   130
  public:										\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   131
    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
   132
    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
   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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   136
#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
   137
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
   138
  public:					\
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   139
    class_name_c(int fl = 0, int fc = 0, 	\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   140
		 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
   141
    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
   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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   144
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   145
#define SYM_REF1(class_name_c, ref1)			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   146
class class_name_c: public symbol_c {			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   147
  public:						\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   148
    symbol_c *ref1;					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   149
  public:						\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   150
    class_name_c(symbol_c *ref1,			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   151
		 int fl = 0, int fc = 0, 		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   152
		 int ll = 0, int lc = 0);		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   153
    virtual void *accept(visitor_c &visitor);		\
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
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   157
#define SYM_REF2(class_name_c, ref1, ref2)		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   158
class class_name_c: public symbol_c {			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   159
  public:						\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   160
    symbol_c *ref1;					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   161
    symbol_c *ref2;					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   162
  public:						\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   163
    class_name_c(symbol_c *ref1,			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   164
		 symbol_c *ref2 = NULL,			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   165
		 int fl = 0, int fc = 0, 		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   166
		 int ll = 0, int lc = 0);		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   167
    virtual void *accept(visitor_c &visitor);		\
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
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   171
#define SYM_REF3(class_name_c, ref1, ref2, ref3)	\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   172
class class_name_c: public symbol_c {			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   173
  public:						\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   174
    symbol_c *ref1;					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   175
    symbol_c *ref2;					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   176
    symbol_c *ref3;					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   177
  public:						\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   178
    class_name_c(symbol_c *ref1,			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   179
		 symbol_c *ref2,			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   180
		 symbol_c *ref3,			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   181
		 int fl = 0, int fc = 0, 		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   182
		 int ll = 0, int lc = 0);		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   183
    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
   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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   187
#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
   188
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
   189
  public:						\
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 *ref1;					\
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 *ref2;					\
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 *ref3;					\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   193
    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
   194
  public:						\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   195
    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
   196
		 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
   197
		 symbol_c *ref3,			\
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   198
		 symbol_c *ref4 = NULL,			\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   199
		 int fl = 0, int fc = 0, 		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   200
		 int ll = 0, int lc = 0);		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   201
    virtual void *accept(visitor_c &visitor);		\
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
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   205
#define SYM_REF5(class_name_c, ref1, ref2, ref3, ref4, ref5)		\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   206
class class_name_c: public symbol_c {					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   207
  public:								\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   208
    symbol_c *ref1;							\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   209
    symbol_c *ref2;							\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   210
    symbol_c *ref3;							\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   211
    symbol_c *ref4;							\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   212
    symbol_c *ref5;							\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   213
  public:								\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   214
    class_name_c(symbol_c *ref1,					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   215
		 symbol_c *ref2,					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   216
		 symbol_c *ref3,					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   217
		 symbol_c *ref4,					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   218
		 symbol_c *ref5,					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   219
		 int fl = 0, int fc = 0, 				\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   220
		 int ll = 0, int lc = 0);				\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   221
    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
   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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   225
#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
   226
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
   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
    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;							\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   233
    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
   234
  public:								\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   235
    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
   236
		 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
   237
		 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
   238
		 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
   239
		 symbol_c *ref5,					\
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   240
		 symbol_c *ref6 = NULL,					\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   241
		 int fl = 0, int fc = 0, 				\
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   242
		 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
   243
    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
   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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   247
#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
   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
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_LIST
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_TOKEN
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   253
#undef SYM_REF0
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   254
#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
   255
#undef SYM_REF2
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   256
#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
   257
#undef SYM_REF4
69
41cb5b80416e Adding basic error checking.
mario
parents: 0
diff changeset
   258
#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
   259
#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
   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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   263
#endif /*  _ABSYNTAX_HH */