stage1_2/iec.y
author lbessard
Fri, 18 Jul 2008 14:44:07 +0200
changeset 133 fff75b8283be
parent 131 f55ef301e14c
child 134 0e43c556cd2d
permissions -rwxr-xr-x
Some bugs on syntax checking tests fixed
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
/*
91
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
     2
 * (c) 2003-2007 Mario de Sousa
0
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
/*
91
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
    18
 * An IEC 61131-3 IL, ST and SFC 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
    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
 * Stage 2
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
 *  This file contains the syntax definition of the textual
91
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
    30
 *  languages IL and ST, as well as the textual version of SFC.
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
    31
 *  The syntax parser, comprising the 2nd stage of the overall 
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
    32
 *  compiler, is generated by runing bison on this file.
0
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
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
/**********************************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    39
/**********************************************************************/
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
/*******                                                        *******/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    43
/*******   The following syntax does not have any conflicts.    *******/
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
/*******   P L E A S E    K E E P    I T    T H A T    W A Y !  *******/
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
/**********************************************************************/
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
/**********************************************************************/
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
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
#include <string.h>	/* required for strdup()  */
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
/* declare the token parser generated by flex... */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    61
int yylex(void);
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
/* declare the error handler defined at the end of this file */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    64
void yyerror (const char *error_msg);
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
/* produce a more verbose parsing error message */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    67
#define YYERROR_VERBOSE
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
/* Include debuging code.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    70
 * Printing of debug info must then be activated by setting
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    71
 * the variable yydebug to 1.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    72
 */
41
8998c8b24b60 First working IEC std lib test, actually test from string and to_string functions.
etisserant
parents: 40
diff changeset
    73
#define YYDEBUG 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
    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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    76
/* file with declaration of absyntax classes... */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    77
#include "../absyntax/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
    78
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    79
/* file with declaration of token constants. Generated by bison! */
15
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
    80
// #include "iec.y.hh"
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
    81
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
    82
/* The interface through which bison and flex interact. */
15
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
    83
#include "stage1_2_priv.hh"
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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    86
/* an ugly hack!!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    87
 * We will probably not need it when we decide
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    88
 *  to cut down the abstract syntax down to size.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    89
 *  We keep it as it is until we get to write
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    90
 *  stages 3 and 4 of the compiler. Who knows,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    91
 *  we might just find out that we really do need
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    92
 *  the abstract syntax tree to stay as it is
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    93
 *  afterall!
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
/* for each element <elem> in list_c * <list>
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    96
 * execute the code <code>
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
#define FOR_EACH_ELEMENT(elem, list, code) {		\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    99
  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
   100
  for(int i = 0; i < list->n; i++) {			\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   101
    elem = list->elements[i];				\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   102
    code;						\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   103
  }							\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   104
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   105
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   106
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
   107
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
   108
/* Macros used to pass the line and column locations when
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
   109
 * creating a new object for the abstract syntax tree.
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
   110
 */
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
   111
#define locloc(foo) foo.first_line, foo.first_column, foo.last_line, foo.last_column
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
   112
#define   locf(foo) foo.first_line, foo.first_column
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
   113
#define   locl(foo) foo.last_line,  foo.last_column
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
   114
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
   115
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
   116
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   117
/* A macro for printing out internal parser errors... */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   118
#define ERROR error_exit(__FILE__,__LINE__)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   119
/* function defined in main.cc */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   120
extern void error_exit(const char *file_name, int line_no);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   121
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   122
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   123
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   124
/*************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   125
/* global variables...   */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   126
/*************************/
15
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   127
/* NOTE: For some strange reason bison ver 2.3 is including these declarations
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   128
 *       in the iec.y.hh file, which is in turn included by flex.
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   129
 *       We cannot therefore define any variables over here, but merely declare 
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   130
 *       their existance (otherwise we get errors when linking the code, since we
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   131
 *       would get a new variable defined each time iec.y.hh is included!).
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   132
 *       Even though the variables are declared 'extern' over here, they will in
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   133
 *       fact be defined towards the end of this same file (i.e. in the prologue)
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   134
 */
0
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
/* A global flag used to tell the parser if overloaded funtions should be allowed.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   137
 * The IEC 61131-3 standard allows overloaded funtions in the standard library,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   138
 * but disallows them in user code...
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   139
 */
15
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   140
extern bool allow_function_overloading;
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   141
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   142
/* A pointer to the root of the parsing tree that will be generated 
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   143
 * by bison.
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   144
 */
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   145
extern symbol_c *tree_root;
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   146
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   147
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   148
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   149
/************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   150
/* forward declarations */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   151
/************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   152
/* The functions declared here are defined at the end of this file... */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   153
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   154
/* Convert an il_operator_c into an identifier_c */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   155
symbol_c *il_operator_c_2_identifier_c(symbol_c *il_operator);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   156
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   157
/* print an error message */
95
b119b1db0a7a Changing format of error reporting.
mario
parents: 94
diff changeset
   158
void print_err_msg(const char *filename,
b119b1db0a7a Changing format of error reporting.
mario
parents: 94
diff changeset
   159
                   int first_line,
b119b1db0a7a Changing format of error reporting.
mario
parents: 94
diff changeset
   160
                   int first_column,
b119b1db0a7a Changing format of error reporting.
mario
parents: 94
diff changeset
   161
                   int last_line,
b119b1db0a7a Changing format of error reporting.
mario
parents: 94
diff changeset
   162
                   int last_column,
b119b1db0a7a Changing format of error reporting.
mario
parents: 94
diff changeset
   163
                   const char *additional_error_msg);
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   164
%}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   165
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   166
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   167
15
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   168
20
81a06a308b7e *** empty log message ***
mario
parents: 17
diff changeset
   169
// %glr-parser
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
   170
// %expect-rr 1
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
   171
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
   172
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
   173
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
   174
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   175
%union {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   176
    symbol_c 	*leaf;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   177
    list_c	*list;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   178
    char 	*ID;	/* token value */
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
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
   181
/*
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
   182
 TODO: DO we need to define a destructor do free
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
   183
       memory when recovering from errors, or do the
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
   184
       class destructors already handle this?
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
   185
       Following is example on how to define
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
   186
       detructors, using the syntax:
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
   187
       %destructor { CODE } SYMBOLS
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
   188
%union
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
   189
      {
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
   190
        char *string;
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
   191
      }
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
   192
      %token <string> STRING
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
   193
      %type  <string> string
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
   194
      %destructor { free ($$); } STRING string
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
   195
*/
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   196
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   197
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   198
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   199
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   200
/*****************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   201
/* Prelimenary constructs... */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   202
/*****************************/
73
0e623bbdee95 fixing infinite error loops at library level, and ...
mario
parents: 68
diff changeset
   203
/* A token used to identify the very end of the input file
0e623bbdee95 fixing infinite error loops at library level, and ...
mario
parents: 68
diff changeset
   204
 * after all includes have already been processed.
0e623bbdee95 fixing infinite error loops at library level, and ...
mario
parents: 68
diff changeset
   205
 *
0e623bbdee95 fixing infinite error loops at library level, and ...
mario
parents: 68
diff changeset
   206
 * Flex automatically returns the token with value 0
74
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
   207
 * at the end of the file. We therefore specify here
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
   208
 * a token with that exact same value here, so we can use it
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
   209
 * to detect the very end of the input files.
73
0e623bbdee95 fixing infinite error loops at library level, and ...
mario
parents: 68
diff changeset
   210
 */
0e623bbdee95 fixing infinite error loops at library level, and ...
mario
parents: 68
diff changeset
   211
%token END_OF_INPUT 0
0e623bbdee95 fixing infinite error loops at library level, and ...
mario
parents: 68
diff changeset
   212
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   213
/* A bogus token that, in principle, flex MUST NEVER generate */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   214
/* USE 1:
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
 * This token is currently also being used as the default
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   217
 * initialisation value of the token_id member in
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   218
 * the symbol_c base class.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   219
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   220
 * USE 2
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
 * This token may also be used in the future to remove
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   223
 * mysterious reduce/reduce conflicts due to the fact
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   224
 * that our grammar may not be LALR(1) but merely LR(1).
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   225
 * This means that bison cannot handle it without some
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   226
 * caoxing from ourselves. We will then need this token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   227
 * to do the coaxing...
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   228
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   229
%token BOGUS_TOKEN_ID
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   230
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
   231
%type <leaf>	start
15
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   232
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   233
%type <leaf>	any_identifier
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   234
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   235
%token <ID>	prev_declared_variable_name_token
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   236
%token <ID>	prev_declared_fb_name_token
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   237
%type <leaf>	prev_declared_variable_name
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   238
%type <leaf>	prev_declared_fb_name
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   239
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   240
%token  <ID>	prev_declared_simple_type_name_token
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   241
%token  <ID>	prev_declared_subrange_type_name_token
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   242
%token  <ID>	prev_declared_enumerated_type_name_token
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   243
%token  <ID>	prev_declared_array_type_name_token
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   244
%token  <ID>	prev_declared_structure_type_name_token
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   245
%token  <ID>	prev_declared_string_type_name_token
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   246
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   247
%type  <leaf>	prev_declared_simple_type_name
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   248
%type  <leaf>	prev_declared_subrange_type_name
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   249
%type  <leaf>	prev_declared_enumerated_type_name
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   250
%type  <leaf>	prev_declared_array_type_name
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   251
%type  <leaf>	prev_declared_structure_type_name
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   252
%type  <leaf>	prev_declared_string_type_name
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   253
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   254
%token <ID>	prev_declared_derived_function_name_token
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   255
%token <ID>	prev_declared_derived_function_block_name_token
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   256
%token <ID>	prev_declared_program_type_name_token
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   257
%type  <leaf>	prev_declared_derived_function_name
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   258
%type  <leaf>	prev_declared_derived_function_block_name
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   259
%type  <leaf>	prev_declared_program_type_name
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   260
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   261
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   262
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   263
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   264
/* The pragmas... */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   265
%token <ID>	pragma_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   266
%type <leaf>	pragma
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   267
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   268
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   269
/* Where do these tokens belong ?? */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   270
/* TODO: get the syntax parser to handle these tokens... */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   271
%token	EN
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   272
%token	ENO
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   273
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   274
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   275
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   276
/***************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   277
/* B 0 - Programming Model */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   278
/***************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   279
%type <list>	library
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   280
%type <leaf>	library_element_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   281
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   282
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   283
/*******************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   284
/* B 1.1 - Letters, digits and identifiers */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   285
/*******************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   286
/* Done totally within flex...
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   287
  letter
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   288
  digit
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   289
  octal_digit
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   290
  hex_digit
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   291
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   292
%token <ID>	identifier_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   293
%type  <leaf>	identifier
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   294
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   295
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   296
/*********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   297
/* B 1.2 - Constants */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   298
/*********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   299
%type <leaf>	constant
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   300
/* a helper symbol for expression */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   301
%type  <leaf> non_negative_constant
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   302
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   303
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   304
/******************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   305
/* B 1.2.1 - Numeric Literals */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   306
/******************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   307
/* Done totally within flex...
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   308
  bit
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   309
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   310
%type  <leaf> numeric_literal
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   311
/* helper symbol for non_negative_constant */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   312
%type  <leaf> non_negative_numeric_literal
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   313
%type  <leaf> integer_literal
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   314
%type  <leaf> signed_integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   315
/* a helper symbol for non_negative_constant */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   316
%type  <leaf> non_negative_signed_integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   317
%token <ID>   integer_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   318
%type  <leaf> integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   319
%token <ID>   binary_integer_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   320
%type  <leaf> binary_integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   321
%token <ID>   octal_integer_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   322
%type  <leaf> octal_integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   323
%token <ID>   hex_integer_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   324
%type  <leaf> hex_integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   325
%token <ID>   real_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   326
%type  <leaf> real
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   327
%type  <leaf> signed_real
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   328
/* helper symbol for non_negative_real_literal */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   329
%type  <leaf> non_negative_signed_real
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   330
%type  <leaf> real_literal
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   331
/* helper symbol for non_negative_numeric_literal */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   332
%type  <leaf> non_negative_real_literal
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   333
// %type  <leaf> exponent
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   334
%type  <leaf> bit_string_literal
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   335
%type  <leaf> boolean_literal
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   336
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   337
%token FALSE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   338
%token TRUE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   339
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   340
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   341
/*******************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   342
/* B 1.2.2 - Character Strings */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   343
/*******************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   344
%token <ID>   single_byte_character_string_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   345
%token <ID>   double_byte_character_string_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   346
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   347
%type  <leaf> character_string
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   348
%type  <leaf> single_byte_character_string
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   349
%type  <leaf> double_byte_character_string
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   350
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   351
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   352
/***************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   353
/* B 1.2.3 - Time Literals */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   354
/***************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   355
%type  <leaf> time_literal
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   356
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   357
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   358
/************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   359
/* B 1.2.3.1 - Duration */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   360
/************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   361
%type  <leaf>	duration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   362
%type  <leaf>	interval
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   363
%type  <leaf>	days
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   364
%type  <leaf>	fixed_point
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   365
%type  <leaf>	hours
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   366
%type  <leaf>	minutes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   367
%type  <leaf>	seconds
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   368
%type  <leaf>	milliseconds
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   369
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   370
%type  <leaf>	integer_d
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   371
%type  <leaf>	integer_h
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   372
%type  <leaf>	integer_m
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   373
%type  <leaf>	integer_s
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   374
%type  <leaf>	integer_ms
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   375
%type  <leaf>	fixed_point_d
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   376
%type  <leaf>	fixed_point_h
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   377
%type  <leaf>	fixed_point_m
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   378
%type  <leaf>	fixed_point_s
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   379
%type  <leaf>	fixed_point_ms
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   380
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   381
%token <ID>	fixed_point_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   382
%token <ID>	fixed_point_d_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   383
%token <ID>	integer_d_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   384
%token <ID>	fixed_point_h_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   385
%token <ID>	integer_h_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   386
%token <ID>	fixed_point_m_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   387
%token <ID>	integer_m_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   388
%token <ID>	fixed_point_s_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   389
%token <ID>	integer_s_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   390
%token <ID>	fixed_point_ms_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   391
%token <ID>	integer_ms_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   392
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   393
%token TIME
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   394
%token T_SHARP
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   395
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   396
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   397
/************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   398
/* B 1.2.3.2 - Time of day and Date */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   399
/************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   400
%type  <leaf>	time_of_day
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   401
%type  <leaf>	daytime
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   402
%type  <leaf>	day_hour
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   403
%type  <leaf>	day_minute
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   404
%type  <leaf>	day_second
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   405
%type  <leaf>	date
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   406
%type  <leaf>	date_literal
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   407
%type  <leaf>	year
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   408
%type  <leaf>	month
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   409
%type  <leaf>	day
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   410
%type  <leaf>	date_and_time
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   411
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   412
%token TIME_OF_DAY
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   413
%token DATE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   414
%token D_SHARP
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   415
%token DATE_AND_TIME
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   416
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   417
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   418
/**********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   419
/* B 1.3 - Data Types */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   420
/**********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   421
/* Strangely, the following symbol does seem to be required! */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   422
// %type  <leaf> data_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   423
%type  <leaf> non_generic_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   424
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   425
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   426
/***********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   427
/* B 1.3.1 - Elementary Data Types */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   428
/***********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   429
/* NOTES:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   430
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   431
 *    - To make the definition of bit_string_literal more
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   432
 *      concise, it is useful to use an extra non-terminal
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   433
 *      symbol (i.e. a grouping or construct) that groups the
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   434
 *      following elements (BYTE, WORD, DWORD, LWORD).
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   435
 *      Note that the definition of bit_string_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   436
 *      (according to the spec) includes the above elements
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   437
 *      and an extra BOOL.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   438
 *      We could use an extra construct with the first four
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   439
 *      elements to be used solely in the definition of
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   440
 *      bit_string_literal, but with the objective of not
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   441
 *      having to replicate the actions (if we ever need
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   442
 *      to change them, they would need to be changed in both
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   443
 *      bit_string_type_name and the extra grouping), we
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   444
 *      have re-defined bit_string_type_name as only including
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   445
 *      the first four elements.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   446
 *      In order to have our parser implement the specification
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   447
 *      correctly we have augmented every occurence of
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   448
 *      bit_string_type_name in other rules with the BOOL
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   449
 *      token. Since bit_string_type_name only appears in
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   450
 *      the rule for elementary_type_name, this does not
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   451
 *      seem to be a big concession to make!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   452
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   453
 *    - We have added a helper symbol to concentrate the
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   454
 *      instantiation of STRING and WSTRING into a single
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   455
 *      location (elementary_string_type_name).
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   456
 *      These two elements show up in several other rules,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   457
 *      but we want to create the equivalent abstract syntax
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   458
 *      in a single location of this file, in order to make
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   459
 *      possible future changes easier to edit...
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   460
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   461
%type  <leaf>	elementary_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   462
%type  <leaf>	numeric_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   463
%type  <leaf>	integer_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   464
%type  <leaf>	signed_integer_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   465
%type  <leaf>	unsigned_integer_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   466
%type  <leaf>	real_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   467
%type  <leaf>	date_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   468
%type  <leaf>	bit_string_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   469
/* helper symbol to concentrate the instantiation
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   470
 * of STRING and WSTRING into a single location
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   471
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   472
%type  <leaf>	elementary_string_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   473
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   474
%token BYTE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   475
%token WORD
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   476
%token DWORD
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   477
%token LWORD
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   478
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   479
%token LREAL
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   480
%token REAL
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   481
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   482
%token SINT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   483
%token INT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   484
%token DINT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   485
%token LINT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   486
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   487
%token USINT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   488
%token UINT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   489
%token UDINT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   490
%token ULINT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   491
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   492
%token WSTRING
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   493
%token STRING
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   494
%token BOOL
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   495
15
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   496
// %token TIME
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   497
// %token DATE
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   498
// %token DATE_AND_TIME
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   499
%token DT
15
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   500
// %token TIME_OF_DAY
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   501
%token TOD
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   502
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   503
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   504
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   505
/* B 1.3.2 - Generic data types */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   506
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   507
/* Strangely, the following symbol does seem to be required! */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   508
// %type  <leaf>	generic_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   509
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   510
/* The following tokens do not seem to be used either
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   511
 * but we declare them so they become reserved words...
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   512
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   513
%token ANY
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   514
%token ANY_DERIVED
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   515
%token ANY_ELEMENTARY
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   516
%token ANY_MAGNITUDE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   517
%token ANY_NUM
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   518
%token ANY_REAL
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   519
%token ANY_INT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   520
%token ANY_BIT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   521
%token ANY_STRING
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   522
%token ANY_DATE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   523
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   524
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   525
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   526
/* B 1.3.3 - Derived data types */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   527
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   528
%type  <leaf>	derived_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   529
%type  <leaf>	single_element_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   530
// %type  <leaf>	simple_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   531
// %type  <leaf>	subrange_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   532
// %type  <leaf>	enumerated_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   533
// %type  <leaf>	array_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   534
// %type  <leaf>	structure_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   535
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   536
%type  <leaf>	data_type_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   537
/* helper symbol for data_type_declaration */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   538
%type  <list>	type_declaration_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   539
%type  <leaf>	type_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   540
%type  <leaf>	single_element_type_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   541
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   542
%type  <leaf>	simple_type_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   543
%type  <leaf>	simple_spec_init
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   544
%type  <leaf>	simple_specification
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   545
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   546
%type  <leaf>	subrange_type_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   547
%type  <leaf>	subrange_spec_init
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   548
%type  <leaf>	subrange_specification
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   549
%type  <leaf>	subrange
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   550
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   551
%type  <leaf>	enumerated_type_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   552
%type  <leaf>	enumerated_spec_init
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   553
%type  <leaf>	enumerated_specification
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   554
/* helper symbol for enumerated_value */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   555
%type  <list>	enumerated_value_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   556
%type  <leaf>	enumerated_value
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
   557
//%type  <leaf>	enumerated_value_without_identifier
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   558
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   559
%type  <leaf>	array_type_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   560
%type  <leaf>	array_spec_init
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   561
%type  <leaf>	array_specification
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   562
/* helper symbol for array_specification */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   563
%type  <list>	array_subrange_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   564
%type  <leaf>	array_initialization
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   565
/* helper symbol for array_initialization */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   566
%type  <list>	array_initial_elements_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   567
%type  <leaf>	array_initial_elements
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   568
%type  <leaf>	array_initial_element
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   569
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   570
%type  <leaf>	structure_type_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   571
%type  <leaf>	structure_specification
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   572
%type  <leaf>	initialized_structure
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   573
%type  <leaf>	structure_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   574
/* helper symbol for structure_declaration */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   575
%type  <list>	structure_element_declaration_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   576
%type  <leaf>	structure_element_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   577
%type  <leaf>	structure_element_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   578
%type  <leaf>	structure_initialization
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   579
/* helper symbol for structure_initialization */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   580
%type  <list>	structure_element_initialization_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   581
%type  <leaf>	structure_element_initialization
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   582
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   583
//%type  <leaf>	string_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   584
%type  <leaf>	string_type_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   585
/* helper symbol for string_type_declaration */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   586
%type  <leaf>	string_type_declaration_size
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   587
/* helper symbol for string_type_declaration */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   588
%type  <leaf>	string_type_declaration_init
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   589
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   590
%token ASSIGN
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   591
%token DOTDOT  /* ".." */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   592
%token TYPE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   593
%token END_TYPE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   594
%token ARRAY
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   595
%token OF
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   596
%token STRUCT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   597
%token END_STRUCT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   598
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   599
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   600
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   601
/*********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   602
/* B 1.4 - Variables */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   603
/*********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   604
%type  <leaf>	variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   605
%type  <leaf>	symbolic_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   606
/* helper symbol for prog_cnxn */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   607
%type  <leaf>	any_symbolic_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   608
%type  <leaf>	variable_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   609
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   610
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   611
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   612
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   613
/********************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   614
/* B.1.4.1   Directly Represented Variables */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   615
/********************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   616
/* Done totally within flex...
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   617
 location_prefix
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   618
 size_prefix
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   619
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   620
%token <ID>	direct_variable_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   621
%type  <leaf>	direct_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   622
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   623
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   624
/*************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   625
/* B.1.4.2   Multi-element Variables */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   626
/*************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   627
%type  <leaf>	multi_element_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   628
/* helper symbol for any_symbolic_variable */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   629
%type  <leaf>	any_multi_element_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   630
%type  <leaf>	array_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   631
/* helper symbol for any_symbolic_variable */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   632
%type  <leaf>	any_array_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   633
%type  <leaf>	subscripted_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   634
/* helper symbol for any_symbolic_variable */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   635
%type  <leaf>	any_subscripted_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   636
%type  <list>	subscript_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   637
%type  <leaf>	subscript
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   638
%type  <leaf>	structured_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   639
/* helper symbol for any_symbolic_variable */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   640
%type  <leaf>	any_structured_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   641
%type  <leaf>	record_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   642
/* helper symbol for any_symbolic_variable */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   643
%type  <leaf>	any_record_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   644
%type  <leaf>	field_selector
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   645
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   646
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   647
/******************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   648
/* B 1.4.3 - Declaration & Initialisation */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   649
/******************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   650
%type  <leaf>	input_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   651
/* helper symbol for input_declarations */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   652
%type  <list>	input_declaration_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   653
%type  <leaf>	input_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   654
%type  <leaf>	edge_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   655
%type  <leaf>	var_init_decl
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   656
%type  <leaf>	var1_init_decl
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   657
%type  <list>	var1_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   658
%type  <leaf>	array_var_init_decl
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   659
%type  <leaf>	structured_var_init_decl
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   660
%type  <leaf>	fb_name_decl
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   661
/* helper symbol for fb_name_decl */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   662
%type  <list>	fb_name_list_with_colon
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   663
/* helper symbol for fb_name_list_with_colon */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   664
%type  <list>	var1_list_with_colon
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   665
// %type  <list>	fb_name_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   666
// %type  <leaf>	fb_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   667
%type  <leaf>	output_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   668
%type  <leaf>	input_output_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   669
/* helper symbol for input_output_declarations */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   670
%type  <list>	var_declaration_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   671
%type  <leaf>	var_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   672
%type  <leaf>	temp_var_decl
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   673
%type  <leaf>	var1_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   674
%type  <leaf>	array_var_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   675
%type  <leaf>	structured_var_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   676
%type  <leaf>	var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   677
%type  <leaf>	retentive_var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   678
%type  <leaf>	located_var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   679
/* helper symbol for located_var_declarations */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   680
%type  <list>	located_var_decl_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   681
%type  <leaf>	located_var_decl
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   682
%type  <leaf>	external_var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   683
/* helper symbol for external_var_declarations */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   684
%type  <list>	external_declaration_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   685
%type  <leaf>	external_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   686
%type  <leaf>	global_var_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   687
%type  <leaf>	global_var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   688
/* helper symbol for global_var_declarations */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   689
%type  <list>	global_var_decl_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   690
%type  <leaf>	global_var_decl
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   691
%type  <leaf>	global_var_spec
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   692
%type  <leaf>	located_var_spec_init
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   693
%type  <leaf>	location
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   694
%type  <list>	global_var_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   695
%type  <leaf>	string_var_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   696
%type  <leaf>	single_byte_string_var_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   697
%type  <leaf>	single_byte_string_spec
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   698
%type  <leaf>	double_byte_string_var_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   699
%type  <leaf>	double_byte_string_spec
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   700
%type  <leaf>	incompl_located_var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   701
/* helper symbol for incompl_located_var_declarations */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   702
%type  <list>	incompl_located_var_decl_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   703
%type  <leaf>	incompl_located_var_decl
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   704
%type  <leaf>	incompl_location
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   705
%type  <leaf>	var_spec
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   706
/* helper symbol for var_spec */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   707
%type  <leaf>	string_spec
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   708
/* intermediate helper symbol for:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   709
 *  - non_retentive_var_decls
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   710
 *  - output_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   711
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   712
%type  <list>	var_init_decl_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   713
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   714
%token  <ID>	incompl_location_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   715
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   716
%token VAR_INPUT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   717
%token VAR_OUTPUT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   718
%token VAR_IN_OUT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   719
%token VAR_EXTERNAL
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   720
%token VAR_GLOBAL
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   721
%token END_VAR
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   722
%token RETAIN
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   723
%token NON_RETAIN
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   724
%token R_EDGE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   725
%token F_EDGE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   726
%token AT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   727
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   728
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   729
/***********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   730
/* B 1.5.1 - Functions */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   731
/***********************/
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
   732
// %type  <leaf>	function_name
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   733
/* helper symbol for IL language */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   734
%type  <leaf>	function_name_no_clashes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   735
%type  <leaf>	function_name_simpleop_clashes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   736
//%type  <leaf>	function_name_expression_clashes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   737
/* helper symbols for ST language */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   738
//%type  <leaf>	function_name_NOT_clashes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   739
%type  <leaf>	function_name_no_NOT_clashes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   740
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   741
//%type  <leaf>	standard_function_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   742
/* helper symbols for IL language */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   743
%type  <leaf>	standard_function_name_no_clashes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   744
%type  <leaf>	standard_function_name_simpleop_clashes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   745
%type  <leaf>	standard_function_name_expression_clashes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   746
/* helper symbols for ST language */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   747
%type  <leaf>	standard_function_name_NOT_clashes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   748
%type  <leaf>	standard_function_name_no_NOT_clashes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   749
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   750
%type  <leaf>	derived_function_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   751
%type  <leaf>	function_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   752
/* helper symbol for function_declaration */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   753
%type  <leaf>	function_name_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   754
%type  <leaf>	io_var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   755
%type  <leaf>	function_var_decls
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   756
%type  <leaf>	function_body
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   757
%type  <leaf>	var2_init_decl
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   758
/* intermediate helper symbol for function_declaration */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   759
%type  <list>	io_OR_function_var_declarations_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   760
/* intermediate helper symbol for function_var_decls */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   761
%type  <list>	var2_init_decl_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   762
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   763
%token <ID>	standard_function_name_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   764
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   765
%token FUNCTION
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   766
%token END_FUNCTION
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   767
%token CONSTANT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   768
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   769
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   770
/*****************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   771
/* B 1.5.2 - Function Blocks */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   772
/*****************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   773
%type  <leaf>	function_block_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   774
%type  <leaf>	standard_function_block_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   775
%type  <leaf>	derived_function_block_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   776
%type  <leaf>	function_block_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   777
%type  <leaf>	other_var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   778
%type  <leaf>	temp_var_decls
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   779
%type  <leaf>	non_retentive_var_decls
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   780
%type  <leaf>	function_block_body
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   781
/* intermediate helper symbol for function_declaration */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   782
%type  <list>	io_OR_other_var_declarations_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   783
/* intermediate helper symbol for temp_var_decls */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   784
%type  <list>	temp_var_decls_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   785
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   786
%token <ID>	standard_function_block_name_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   787
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   788
%token FUNCTION_BLOCK
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   789
%token END_FUNCTION_BLOCK
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   790
%token VAR_TEMP
15
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   791
// %token END_VAR
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   792
%token VAR
15
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   793
// %token NON_RETAIN
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   794
// %token END_VAR
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   795
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   796
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   797
/**********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   798
/* B 1.5.3 - Programs */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   799
/**********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   800
%type  <leaf>	program_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   801
%type  <leaf>	program_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   802
/* helper symbol for program_declaration */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   803
%type  <list>	program_var_declarations_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   804
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   805
%token PROGRAM
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   806
%token END_PROGRAM
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   807
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   808
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   809
/********************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   810
/* B 1.6 Sequential Function Chart elements */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   811
/********************************************/
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
   812
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   813
%type  <list>	sequential_function_chart
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
   814
%type  <list>	sfc_network
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   815
%type  <leaf>	initial_step
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   816
%type  <leaf>	step
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
   817
%type  <list>	action_association_list
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   818
%type  <leaf>	step_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   819
%type  <leaf>	action_association
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
   820
/* helper symbol for action_association */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   821
%type  <list>	indicator_name_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   822
%type  <leaf>	action_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   823
%type  <leaf>	action_qualifier
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
   824
%type  <leaf>	qualifier
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   825
%type  <leaf>	timed_qualifier
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   826
%type  <leaf>	action_time
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   827
%type  <leaf>	indicator_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   828
%type  <leaf>	transition
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   829
%type  <leaf>	steps
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   830
%type  <list>	step_name_list
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
   831
%type  <leaf>	transition_priority
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
   832
%type  <leaf>	transition_condition
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   833
%type  <leaf>	action
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
   834
%type  <leaf>	transition_name
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
   835
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   836
15
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   837
// %token ASSIGN
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   838
%token ACTION
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   839
%token END_ACTION
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   840
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   841
%token TRANSITION
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   842
%token END_TRANSITION
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   843
%token FROM
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   844
%token TO
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   845
%token PRIORITY
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   846
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   847
%token INITIAL_STEP
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   848
%token STEP
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   849
%token END_STEP
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   850
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   851
%token L
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   852
%token D
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   853
%token SD
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   854
%token DS
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   855
%token SL
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   856
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   857
%token N
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   858
%token P
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   859
/* NOTE: the following two clash with the R and S IL operators.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   860
 * It will have to be handled when we include parsing of SFC...
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   861
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   862
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   863
%token R
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   864
%token S
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   865
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   866
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   867
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   868
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   869
/* B 1.7 Configuration elements */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   870
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   871
%type  <leaf>	configuration_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   872
%type  <leaf>	resource_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   873
%type  <leaf>	configuration_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   874
// helper symbol for
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   875
//  - configuration_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   876
//  - resource_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   877
//
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   878
%type  <leaf>	optional_global_var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   879
// helper symbol for configuration_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   880
%type  <leaf>	optional_access_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   881
// helper symbol for configuration_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   882
%type  <leaf>	optional_instance_specific_initializations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   883
// helper symbol for configuration_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   884
%type  <list>	resource_declaration_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   885
%type  <leaf>	resource_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   886
%type  <leaf>	single_resource_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   887
// helper symbol for single_resource_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   888
%type  <list>	task_configuration_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   889
// helper symbol for single_resource_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   890
%type  <list>	program_configuration_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   891
%type  <leaf>	resource_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   892
// %type  <leaf>	access_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   893
// helper symbol for access_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   894
// %type  <leaf>	access_declaration_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   895
// %type  <leaf>	access_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   896
// %type  <leaf>	access_path
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   897
// helper symbol for access_path
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   898
%type  <list>	any_fb_name_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   899
%type  <leaf>	global_var_reference
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   900
// %type  <leaf>	access_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   901
%type  <leaf>	program_output_reference
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   902
%type  <leaf>	program_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   903
// %type  <leaf>	direction
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   904
%type  <leaf>	task_configuration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   905
%type  <leaf>	task_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   906
%type  <leaf>	task_initialization
74
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
   907
// 3 helper symbols for task_initialization
75
0e381bdb8888 Fixing handling of task initialisation.
mario
parents: 74
diff changeset
   908
%type  <leaf>	task_initialization_single
0e381bdb8888 Fixing handling of task initialisation.
mario
parents: 74
diff changeset
   909
%type  <leaf>	task_initialization_interval
0e381bdb8888 Fixing handling of task initialisation.
mario
parents: 74
diff changeset
   910
%type  <leaf>	task_initialization_priority
74
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
   911
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   912
%type  <leaf>	data_source
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   913
%type  <leaf>	program_configuration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   914
// helper symbol for program_configuration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   915
%type  <leaf>	optional_task_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   916
// helper symbol for program_configuration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   917
%type  <leaf>	optional_prog_conf_elements
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   918
%type  <list>	prog_conf_elements
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   919
%type  <leaf>	prog_conf_element
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   920
%type  <leaf>	fb_task
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   921
%type  <leaf>	prog_cnxn
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   922
%type  <leaf>	prog_data_source
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   923
%type  <leaf>	data_sink
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   924
%type  <leaf>	instance_specific_initializations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   925
// helper symbol for instance_specific_initializations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   926
%type  <list>	instance_specific_init_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   927
%type  <leaf>	instance_specific_init
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   928
// helper symbol for instance_specific_init
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   929
%type  <leaf>	fb_initialization
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   930
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   931
%type  <leaf>	prev_declared_global_var_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   932
%token  <ID>	prev_declared_global_var_name_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   933
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   934
%type  <leaf>	prev_declared_program_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   935
%token  <ID>	prev_declared_program_name_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   936
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   937
%type  <leaf>	prev_declared_resource_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   938
%token  <ID>	prev_declared_resource_name_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   939
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   940
%token  <ID>	prev_declared_configuration_name_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   941
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   942
// %type  <leaf>	prev_declared_task_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   943
// %token  <ID>	prev_declared_task_name_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   944
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   945
%token CONFIGURATION
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   946
%token END_CONFIGURATION
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   947
%token TASK
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   948
%token RESOURCE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   949
%token ON
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   950
%token END_RESOURCE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   951
%token VAR_CONFIG
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   952
%token VAR_ACCESS
15
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   953
// %token END_VAR
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   954
%token WITH
15
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   955
// %token PROGRAM
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   956
// %token RETAIN
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   957
// %token NON_RETAIN
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
   958
// %token PRIORITY
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   959
%token SINGLE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   960
%token INTERVAL
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   961
%token READ_WRITE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   962
%token READ_ONLY
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   963
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   964
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   965
/***********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   966
/* B 2.1 Instructions and Operands */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   967
/***********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   968
%type  <list>	instruction_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   969
%type  <leaf>	il_instruction
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   970
%type  <leaf>	il_incomplete_instruction
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   971
%type  <leaf>	label
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   972
%type  <leaf>	il_simple_operation
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   973
// helper symbol for il_simple_operation
91
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
   974
//%type <tmp_symbol> il_simple_operator_clash_il_operand
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   975
%type  <leaf>	il_expression
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   976
%type  <leaf>	il_jump_operation
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   977
%type  <leaf>	il_fb_call
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   978
%type  <leaf>	il_formal_funct_call
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   979
// helper symbol for il_formal_funct_call
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   980
%type  <leaf> il_expr_operator_clash_eol_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   981
%type  <leaf>	il_operand
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   982
%type  <list>	il_operand_list
91
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
   983
// helper symbol for il_simple_operation
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
   984
%type  <list>	il_operand_list2
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   985
%type  <list>	simple_instr_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   986
%type  <leaf>	il_simple_instruction
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   987
%type  <list>	il_param_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   988
%type  <list>	il_param_instruction_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   989
%type  <leaf>	il_param_instruction
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   990
%type  <leaf>	il_param_last_instruction
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   991
%type  <leaf>	il_param_assignment
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   992
%type  <leaf>	il_param_out_assignment
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   993
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   994
%token EOL
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   995
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   996
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   997
/*******************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   998
/* B 2.2 Operators */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   999
/*******************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1000
%token <ID>	sendto_identifier_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1001
%type  <leaf>	sendto_identifier
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1002
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1003
%type  <leaf>	LD_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1004
%type  <leaf>	LDN_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1005
%type  <leaf>	ST_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1006
%type  <leaf>	STN_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1007
%type  <leaf>	NOT_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1008
%type  <leaf>	S_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1009
%type  <leaf>	R_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1010
%type  <leaf>	S1_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1011
%type  <leaf>	R1_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1012
%type  <leaf>	CLK_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1013
%type  <leaf>	CU_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1014
%type  <leaf>	CD_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1015
%type  <leaf>	PV_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1016
%type  <leaf>	IN_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1017
%type  <leaf>	PT_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1018
%type  <leaf>	AND_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1019
%type  <leaf>	AND2_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1020
%type  <leaf>	OR_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1021
%type  <leaf>	XOR_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1022
%type  <leaf>	ANDN_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1023
%type  <leaf>	ANDN2_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1024
%type  <leaf>	ORN_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1025
%type  <leaf>	XORN_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1026
%type  <leaf>	ADD_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1027
%type  <leaf>	SUB_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1028
%type  <leaf>	MUL_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1029
%type  <leaf>	DIV_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1030
%type  <leaf>	MOD_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1031
%type  <leaf>	GT_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1032
%type  <leaf>	GE_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1033
%type  <leaf>	EQ_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1034
%type  <leaf>	LT_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1035
%type  <leaf>	LE_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1036
%type  <leaf>	NE_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1037
%type  <leaf>	CAL_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1038
%type  <leaf>	CALC_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1039
%type  <leaf>	CALCN_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1040
%type  <leaf>	RET_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1041
%type  <leaf>	RETC_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1042
%type  <leaf>	RETCN_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1043
%type  <leaf>	JMP_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1044
%type  <leaf>	JMPC_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1045
%type  <leaf>	JMPCN_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1046
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1047
%type  <leaf>	il_simple_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1048
%type  <leaf>	il_simple_operator_clash
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1049
%type  <leaf>	il_simple_operator_clash1
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1050
%type  <leaf>	il_simple_operator_clash2
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1051
%type  <leaf>	il_simple_operator_noclash
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1052
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1053
//%type  <leaf>	il_expr_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1054
%type  <leaf>	il_expr_operator_clash
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1055
%type  <leaf>	il_expr_operator_noclash
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1056
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1057
%type  <leaf>	il_assign_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1058
%type  <leaf>	il_assign_out_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1059
%type  <leaf>	il_call_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1060
%type  <leaf>	il_return_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1061
%type  <leaf>	il_jump_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1062
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1063
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1064
%token LD
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1065
%token LDN
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1066
%token ST
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1067
%token STN
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1068
%token NOT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1069
%token S
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1070
%token R
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1071
%token S1
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1072
%token R1
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1073
%token CLK
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1074
%token CU
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1075
%token CD
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1076
%token PV
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1077
%token IN
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1078
%token PT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1079
%token AND
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1080
%token AND2  /* character '&' in the source code*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1081
%token OR
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1082
%token XOR
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1083
%token ANDN
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1084
%token ANDN2 /* characters '&N' in the source code */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1085
%token ORN
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1086
%token XORN
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1087
%token ADD
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1088
%token SUB
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1089
%token MUL
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1090
%token DIV
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1091
%token MOD
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1092
%token GT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1093
%token GE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1094
%token EQ
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1095
%token LT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1096
%token LE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1097
%token NE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1098
%token CAL
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1099
%token CALC
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1100
%token CALCN
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1101
%token RET
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1102
%token RETC
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1103
%token RETCN
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1104
%token JMP
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1105
%token JMPC
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1106
%token JMPCN
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1107
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1108
%token SENDTO   /* "=>" */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1109
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1110
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1111
/***********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1112
/* B 3.1 - Expressions */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1113
/***********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1114
/* NOTE:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1115
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1116
 *    - unary_operator, multiply_operator,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1117
 *      add_operator and comparison_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1118
 *      are not required. Their values are integrated
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1119
 *      directly into other rules...
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1120
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1121
%type  <leaf>	expression
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1122
%type  <leaf>	xor_expression
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1123
%type  <leaf>	and_expression
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1124
%type  <leaf>	comparison
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1125
%type  <leaf>	equ_expression
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1126
// %type  <leaf>	comparison_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1127
%type  <leaf>	add_expression
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1128
// %type  <leaf>	add_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1129
%type  <leaf>	term
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1130
// %type  <leaf>	multiply_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1131
%type  <leaf>	power_expression
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1132
%type  <leaf>	unary_expression
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1133
// %type  <leaf>	unary_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1134
%type  <leaf>	primary_expression
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1135
/* intermediate helper symbol for primary_expression */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1136
%type  <leaf>	function_invocation
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1137
15
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  1138
// %token AND
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  1139
// %token XOR
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  1140
// %token OR
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  1141
// %token MOD
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  1142
// %token NOT
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1143
%token OPER_NE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1144
%token OPER_GE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1145
%token OPER_LE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1146
%token OPER_EXP
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1147
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1148
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1149
/********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1150
/* B 3.2 Statements */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1151
/********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1152
%type <list> statement_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1153
%type <leaf> statement
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1154
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1155
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1156
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1157
/*********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1158
/* B 3.2.1 Assignment Statements */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1159
/*********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1160
%type <leaf> assignment_statement
15
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  1161
// %token ASSIGN   /* ":=" */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1162
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1163
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1164
/*****************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1165
/* B 3.2.2 Subprogram Control Statements */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1166
/*****************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1167
%type <leaf>	subprogram_control_statement
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1168
%type <leaf>	return_statement
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1169
%type <leaf>	fb_invocation
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  1170
// %type <leaf>	param_assignment
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  1171
%type <leaf>	param_assignment_formal
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  1172
%type <leaf>	param_assignment_nonformal
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  1173
/* helper symbols for fb_invocation */
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  1174
%type <list> param_assignment_formal_list
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  1175
%type <list> param_assignment_nonformal_list
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1176
15
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  1177
// %token ASSIGN
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  1178
// %token SENDTO   /* "=>" */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1179
%token RETURN
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1180
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1181
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1182
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1183
/* B 3.2.3 Selection Statements */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1184
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1185
%type <leaf>	selection_statement
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1186
%type <leaf>	if_statement
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1187
%type <leaf>	case_statement
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1188
%type <leaf>	case_element
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1189
%type <list>	case_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1190
%type <leaf>	case_list_element
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1191
/* helper symbol for if_statement */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1192
%type <list>	elseif_statement_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1193
/* helper symbol for elseif_statement_list */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1194
%type <leaf>	elseif_statement
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1195
/* helper symbol for case_statement */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1196
%type <list>	case_element_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1197
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1198
%token IF
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1199
%token THEN
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1200
%token ELSIF
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1201
%token ELSE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1202
%token END_IF
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1203
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1204
%token CASE
15
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  1205
// %token OF
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  1206
// %token ELSE
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1207
%token END_CASE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1208
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1209
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1210
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1211
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1212
/* B 3.2.4 Iteration Statements */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1213
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1214
%type <leaf>	iteration_statement
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1215
%type <leaf>	for_statement
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1216
%type <leaf>	control_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1217
%type <leaf>	while_statement
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1218
%type <leaf>	repeat_statement
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1219
%type <leaf>	exit_statement
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1220
/* Integrated directly into for_statement */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1221
// %type <leaf>	for_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1222
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1223
%token FOR
15
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  1224
// %token ASSIGN
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  1225
// %token TO
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1226
%token BY
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1227
%token DO
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1228
%token END_FOR
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1229
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1230
%token WHILE
15
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  1231
// %token DO
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1232
%token END_WHILE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1233
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1234
%token REPEAT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1235
%token UNTIL
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1236
%token END_REPEAT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1237
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1238
%token EXIT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1239
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1240
%%
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1241
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1242
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1243
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1244
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1245
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1246
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1247
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1248
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1249
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1250
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1251
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1252
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1253
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1254
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1255
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1256
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1257
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1258
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1259
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1260
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1261
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1262
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1263
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1264
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1265
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1266
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1267
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1268
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1269
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1270
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1271
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1272
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1273
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1274
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1275
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1276
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1277
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1278
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1279
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1280
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1281
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1282
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1283
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1284
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1285
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1286
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1287
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1288
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1289
/********************************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1290
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1291
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1292
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1293
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1294
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1295
/*****************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1296
/* Prelimenary constructs... */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1297
/*****************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1298
start:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1299
  library	{$$ = $1;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1300
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1301
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1302
/* the pragmas... */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1303
pragma:
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1304
  pragma_token	{$$ = new pragma_c($1, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1305
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1306
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1307
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1308
/* NOTE:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1309
 *       short version:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1310
 *       identifier is used for previously undeclared identifiers
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1311
 *       any_identifier is used when any identifier, previously
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1312
 *       declared or not, is required in the syntax.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1313
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1314
 *       long version:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1315
 *       When flex comes across an identifier, it first
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1316
 *       searches through the currently declared variables,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1317
 *       functions, types, etc... to determine if it has
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1318
 *       been previously declared.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1319
 *       Only if the identifier has not yet been declared
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1320
 *       will it return an identifier_token (later turned into
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1321
 *       an identifier symbol by the bison generated syntax parser).
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1322
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1323
 *       Some constructs in the syntax, such as when calling
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1324
 *       a function 'F(var1 := 1; var2 := 2);', will accept _any_
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1325
 *       identifier in 'var1', even if it has been previously
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1326
 *       declared in the current scope, since var1 belongs to
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1327
 *       another scope (the variables declared in function F).
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1328
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1329
 *       For the above reason, we need to define 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
  1330
 *       any_identifier. All the symbols that may become an
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1331
 *       any_identifier are expected to be stored in the
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1332
 *       abstract syntax as a identifier_c
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1333
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1334
/* NOTE:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1335
 *  Type names, function names, function block type names and
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1336
 *  program type names are considerd keywords once they are defined,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1337
 *  so may no longer be used for variable names!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1338
 *  BUT the spec is confusing on this issue, as it is not clear when
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1339
 *  a function name should be considered as defined. If it is to be
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1340
 *  considered defined only from the location from where it is declared
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1341
 *  and onwards, it means that before it is declared its name may be
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1342
 *  used for variable names!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1343
 *  This means that we must allow names previously used for functions
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1344
 *  (et. al.) to also constitue an any_identifier!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1345
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1346
any_identifier:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1347
  identifier
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1348
| prev_declared_fb_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1349
| prev_declared_variable_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1350
/**/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1351
| prev_declared_enumerated_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1352
| prev_declared_simple_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1353
| prev_declared_subrange_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1354
| prev_declared_array_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1355
| prev_declared_structure_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1356
| prev_declared_string_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1357
| prev_declared_derived_function_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1358
| prev_declared_derived_function_block_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1359
| prev_declared_program_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1360
/**/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1361
| prev_declared_resource_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1362
| prev_declared_program_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1363
| prev_declared_global_var_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1364
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1365
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1366
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1367
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1368
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1369
prev_declared_variable_name: prev_declared_variable_name_token {$$ = new identifier_c($1, locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1370
prev_declared_fb_name: prev_declared_fb_name_token {$$ = new identifier_c($1, locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1371
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1372
prev_declared_simple_type_name: prev_declared_simple_type_name_token {$$ = new identifier_c($1, locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1373
prev_declared_subrange_type_name: prev_declared_subrange_type_name_token {$$ = new identifier_c($1, locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1374
prev_declared_enumerated_type_name: prev_declared_enumerated_type_name_token {$$ = new identifier_c($1, locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1375
prev_declared_array_type_name: prev_declared_array_type_name_token {$$ = new identifier_c($1, locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1376
prev_declared_structure_type_name: prev_declared_structure_type_name_token {$$ = new identifier_c($1, locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1377
prev_declared_string_type_name: prev_declared_string_type_name_token {$$ = new identifier_c($1, locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1378
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1379
prev_declared_derived_function_name: prev_declared_derived_function_name_token {$$ = new identifier_c($1, locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1380
prev_declared_derived_function_block_name: prev_declared_derived_function_block_name_token {$$ = new identifier_c($1, locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1381
prev_declared_program_type_name: prev_declared_program_type_name_token {$$ = new identifier_c($1, locloc(@$));};
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1382
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1383
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1384
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1385
/***************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1386
/* B 0 - Programming Model */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1387
/***************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1388
library:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1389
  /* empty */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1390
	{if (tree_root == NULL)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1391
	  tree_root = new library_c();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1392
	 $$ = (list_c *)tree_root;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1393
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1394
| library library_element_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1395
	{$$ = $1; $$->add_element($2);}
77
fe4ecf7efa79 adding some comments.
mario
parents: 75
diff changeset
  1396
/* ERROR_CHECK_BEGIN */
73
0e623bbdee95 fixing infinite error loops at library level, and ...
mario
parents: 68
diff changeset
  1397
| library error END_OF_INPUT
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1398
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1399
	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown syntax error.");
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1400
	 yyerrok;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1401
	}
77
fe4ecf7efa79 adding some comments.
mario
parents: 75
diff changeset
  1402
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1403
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1404
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1405
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1406
library_element_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1407
  data_type_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1408
| function_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1409
| function_block_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1410
| program_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1411
| configuration_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1412
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1413
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1414
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1415
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1416
/*******************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1417
/* B 1.1 - Letters, digits and identifiers */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1418
/*******************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1419
/* NOTE: the spec defines identifier as:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1420
 *         identifier ::= (letter|('_' (letter|digit))) {['_'] (letter|digit)}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1421
 *       In essence, any sequence of letters or digits, starting with a letter
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1422
 *       or '_'.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1423
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1424
 *       On section 2.1.3 (pg 26) , the spec states
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1425
 *       "The keywords listed in annex C shall not be used for any other purpose,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1426
 *         e.g., variable names or extensions as defined in 1.5.1."
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1427
 *       (NOTE: the spec itself does not follow this rule, as it defines standard
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1428
 *       functions with names identidal to keywords, e.g. 'MOD', 'NOT' !!. This is
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1429
 *       another issue altogether, and is worked around somewhere else...)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1430
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1431
 *       This means that we must re-define indentifier so as to exclude
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1432
 *       any keywords defined in annex C.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1433
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1434
 *       Note also that the list includes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1435
 *          - Data type names
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1436
 *          - Function names
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1437
 *          - Function Block names
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1438
 *       This means that any named used for a function name, data type name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1439
 *       or function block name, essentially becomes a keyword, and may therefore
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1440
 *       no longer be re-used for any other use! (see NOTE 2)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1441
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1442
 *       In our case, excluding the keywords is achieved in the lexical parser,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1443
 *       by two mechanisms:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1444
 *         (1) giving higher priority to the keywords (tokens) than to identifiers,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1445
 *             so when the lexical parser finds a keyword it will be parsed as a
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1446
 *             token before being parsed as an identifier.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1447
 *         (2) when an identifier is found that is not a keyword, the lexical parser
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1448
 *             then looks in the global symbol table, and will not return an identifier
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1449
 *             if the name has been previously used as a data type name, function name,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1450
 *             or function block name! (In these cases it will return a
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1451
 *             prev_declared_function_name_token, etc...).
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1452
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1453
 *       Unfortunately, the language (especially IL) uses tokens that are
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1454
 *       not defined as keywords in the spec (e.g. 'IN', 'R1', 'S1', 'PT', etc...)!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1455
 *       This means that it is valid to name a function 'IN', a variable 'PT', etc...
78
aead91ec37cd removing 'identifier' from definition of symbolic_variable
mario
parents: 77
diff changeset
  1456
 *       In order to solve this potential ambiguity, flex only parses the above 
aead91ec37cd removing 'identifier' from definition of symbolic_variable
mario
parents: 77
diff changeset
  1457
 *       identifiers as keywords / tokens if we are currently parsing IL code.
aead91ec37cd removing 'identifier' from definition of symbolic_variable
mario
parents: 77
diff changeset
  1458
 *       When parsing all code other than IL code, the above identifiers are treated
aead91ec37cd removing 'identifier' from definition of symbolic_variable
mario
parents: 77
diff changeset
  1459
 *       just like any other identifier.
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1460
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1461
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1462
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1463
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1464
 * NOTE 2:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1465
 *         I (Mario) find it strange that the writers of the spec really want
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1466
 *         names previously used for function names, data type names or function
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1467
 *         block names, to become full fledged keywords. I understand that they
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1468
 *         do not want these names being used as variable names, but how about
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1469
 *         enumeration values? How about structure element names?
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1470
 *         If we interpret the spec literally, these would not be accepted,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1471
 *         which would probably burden the programmer quite a bit, in making sure
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1472
 *         all these name don't clash!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1473
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1474
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1475
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1476
 * NOTE 3: The keywords, as specified in Annex C are...
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1477
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1478
 *          - Data type names
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1479
 *          - Function names
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1480
 *          - Function Block names
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1481
 *          - ACTION...END_ACTION
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1482
 *          - ARRAY...OF
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1483
 *          - AT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1484
 *          - CASE...OF...ELSE...END_CASE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1485
 *          - CONFIGURATION...END_CONFIGURATION
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1486
 *          - CONSTANT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1487
 *          - EN, ENO
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1488
 *          - EXIT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1489
 *          - FALSE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1490
 *          - F_EDGE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1491
 *          - FOR...TO...BY...DO...END_FOR
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1492
 *          - FUNCTION...END_FUNCTION
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1493
 *          - FUNCTION_BLOCK...END_FUNCTION_BLOCK
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1494
 *          - IF...THEN...ELSIF...ELSE...END_IF
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1495
 *          - INITIAL_STEP...END_STEP
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1496
 *          - NOT, MOD, AND, XOR, OR
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1497
 *          - PROGRAM...WITH...
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1498
 *          - PROGRAM...END_PROGRAM
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1499
 *          - R_EDGE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1500
 *          - READ_ONLY, READ_WRITE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1501
 *          - REPEAT...UNTIL...END_REPEAT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1502
 *          - RESOURCE...ON...END_RESOURCE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1503
 *          - RETAIN, NON_RETAIN
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1504
 *          - RETURN
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1505
 *          - STEP...END_STEP
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1506
 *          - STRUCT...END_STRUCT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1507
 *          - TASK
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1508
 *          - TRANSITION...FROM...TO...END_TRANSITION
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1509
 *          - TRUE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1510
 *          - TYPE...END_TYPE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1511
 *          - VAR...END_VAR
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1512
 *          - VAR_INPUT...END_VAR
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1513
 *          - VAR_OUTPUT...END_VAR
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1514
 *          - VAR_IN_OUT...END_VAR
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1515
 *          - VAR_TEMP...END_VAR
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1516
 *          - VAR_EXTERNAL...END_VAR
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1517
 *          - VAR_ACCESS...END_VAR
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1518
 *          - VAR_CONFIG...END_VAR
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1519
 *          - VAR_GLOBAL...END_VAR
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1520
 *          - WHILE...DO...END_WHILE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1521
 *          - WITH
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1522
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1523
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1524
identifier:
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1525
  identifier_token	{$$ = new identifier_c($1, locloc(@$));}
78
aead91ec37cd removing 'identifier' from definition of symbolic_variable
mario
parents: 77
diff changeset
  1526
;
aead91ec37cd removing 'identifier' from definition of symbolic_variable
mario
parents: 77
diff changeset
  1527
aead91ec37cd removing 'identifier' from definition of symbolic_variable
mario
parents: 77
diff changeset
  1528
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1529
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1530
/*********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1531
/* B 1.2 - Constants */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1532
/*********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1533
constant:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1534
  numeric_literal
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1535
| character_string
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1536
| time_literal
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1537
| bit_string_literal
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1538
| boolean_literal
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1539
/* NOTE: in order to remove reduce/reduce conflicts,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1540
 * unsigned_integer, signed_integer, binary_integer, octal_integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1541
 * and hex_integer have been integrated directly into
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1542
 * the constants construct, instead of belonging to
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1543
 * either the bit_string_literal or integer_literal
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1544
 * construct.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1545
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1546
/* NOTE: unsigned_integer, although used in some
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1547
 * rules, is not defined in the spec!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1548
 * We therefore replaced unsigned_integer as integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1549
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1550
/*| integer {} */  /* i.e. an unsigned_integer */ /* NOTE: already included as a signed integer! */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1551
| signed_integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1552
| binary_integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1553
| octal_integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1554
| hex_integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1555
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1556
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1557
/* a helper symbol for expression */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1558
/* A constant without any preceding '-', but may
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1559
 * include a preceding '+' !
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1560
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1561
non_negative_constant:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1562
  non_negative_numeric_literal
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1563
| character_string
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1564
| time_literal
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1565
| bit_string_literal
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1566
| boolean_literal
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1567
| non_negative_signed_integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1568
| binary_integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1569
| octal_integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1570
| hex_integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1571
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1572
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1573
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1574
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1575
/******************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1576
/* B 1.2.1 - Numeric Literals */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1577
/******************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1578
/* NOTES:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1579
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1580
 *    - integer is parsed by flex, but signed_integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1581
 *      is parsed by bison. Flex cannot parse a signed
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1582
 *      integer correctly!  For example: '123+456'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1583
 *      would be parsed by flex as an {integer} {signed_integer}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1584
 *      instead of {integer} '+' {integer}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1585
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1586
 *    - Neither flex nor bison can parse a real_literal
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1587
 *      completely (and correctly).
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1588
 *      Note that we cannot use the definition of real in bison as
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1589
 *      real: signed_integer '.' integer [exponent]
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1590
 *      exponent: {'E'|'e'} ['+'|'-'] integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1591
 *      because 123e45 would be parsed by flex as
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1592
 *      integer (123) identifier (e45).
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1593
 *      I.e., flex never hands over an 'e' directly to
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1594
 *      bison, but rather interprets it as an identifier.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1595
 *      I guess we could jump through hoops and get it
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1596
 *      working in bison, but the following alternative
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1597
 *      seems more straight forward...
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1598
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1599
 *      We therefore had to break up the definition of
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1600
 *      real_literal in discrete parts:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1601
 *      real_literal: [real_type_name '#'] singned_real
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1602
 *      signed_real: ['+'|'-'] real
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1603
 *      Flex handles real, while bison handles signed_real
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1604
 *      and real_literal.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1605
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1606
 *    - According to the spec, intger '.' integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1607
 *      may be reduced to either a real or a fixed_point.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1608
 *      It is nevertheless possible to figure out from the
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1609
 *      context which of the two rules should be used in
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1610
 *      the reduction.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1611
 *      Unfortunately, due to the issue described above
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1612
 *      regarding the exponent of a real, the syntax
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1613
 *      integer '.' integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1614
 *      must be parsed by flex as a single token (i.e.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1615
 *      fixed_point_token). This means we must add fixed_point
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1616
 *      to the definition of real!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1617
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1618
 *    - The syntax also uses a construct
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1619
 *        fixed_point: integer ['.' integer]
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1620
 *      Notice that real is not defined based on fixed point,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1621
 *      but rather off integer thus:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1622
 *        real: integer '.' integer [exponent]
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1623
 *      This means that a real may not be composed of a single
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1624
 *      integer, unlike the construct fixed_point!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1625
 *      This also means that a
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1626
 *        integer '.' integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1627
 *      could be reduced to either a real or a fixed_point
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1628
 *      construct. It is probably possible to decide by looking
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1629
 *      at the context, BUT:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1630
 *       Unfortunatley, due to the reasons explained way above,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1631
 *      a real (with an exponent) has to be handled by flex as a
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1632
 *      whole. This means that we cannot leave to bison (the syntax
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1633
 *      parser) the decision of how to reduce an
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1634
 *        integer '.' integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1635
 *      (either to real or to fixed_point)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1636
 *      The decision on how to reduce it would need to be done by
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1637
 *      ther lexical analyser (i.e. flex). But flex cannot do this
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1638
 *      sort of thing.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1639
 *      The solution I (Mario) adopted is to have flex return
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1640
 *      a real_token on (notice that exponent is no longer optional)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1641
 *        integer '.' integer exponent
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1642
 *      and to return a fixed_point_token when it finds
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1643
 *        integer '.' integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1644
 *      We now redefine real and fixed_point to be
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1645
 *        fixed_point: fixed_point_token | integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1646
 *        real: real_token | fixed_point_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1647
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1648
real:
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1649
  real_token		{$$ = new real_c($1, locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1650
| fixed_point_token	{$$ = new real_c($1, locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1651
;
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1652
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1653
integer:	integer_token		{$$ = new integer_c($1, locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1654
binary_integer:	binary_integer_token	{$$ = new binary_integer_c($1, locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1655
octal_integer:	octal_integer_token	{$$ = new octal_integer_c($1, locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1656
hex_integer:	hex_integer_token	{$$ = new hex_integer_c($1, locloc(@$));};
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1657
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1658
numeric_literal:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1659
  integer_literal
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1660
| real_literal
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1661
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1662
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1663
/* helper symbol for non_negative_constant */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1664
non_negative_numeric_literal:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1665
  integer_literal
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1666
| non_negative_real_literal
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1667
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1668
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1669
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1670
integer_literal:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1671
  integer_type_name '#' signed_integer
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1672
	{$$ = new integer_literal_c($1, $3, locf(@1), locl(@3));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1673
| integer_type_name '#' binary_integer
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1674
	{$$ = new integer_literal_c($1, $3, locf(@1), locl(@3));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1675
| integer_type_name '#' octal_integer
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1676
	{$$ = new integer_literal_c($1, $3, locf(@1), locl(@3));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1677
| integer_type_name '#' hex_integer
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1678
	{$$ = new integer_literal_c($1, $3, locf(@1), locl(@3));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1679
/* NOTE: see note in the definition of constant for reason
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1680
 * why signed_integer, binary_integer, octal_integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1681
 * and hex_integer are missing here!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1682
 */
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1683
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1684
| integer_type_name signed_integer
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1685
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1686
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1687
	 print_err_msg(current_filename, locf(@1), locl(@2), "'#' missing between integer type name and value in integer literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1688
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1689
| integer_type_name binary_integer
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1690
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1691
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1692
	 print_err_msg(current_filename, locf(@1), locl(@2), "'#' missing between integer type name and value in integer literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1693
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1694
| integer_type_name octal_integer
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1695
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1696
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1697
	 print_err_msg(current_filename, locf(@1), locl(@2), "'#' missing between integer type name and value in integer literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1698
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1699
| integer_type_name hex_integer
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1700
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1701
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1702
	 print_err_msg(current_filename, locf(@1), locl(@2), "'#' missing between integer type name and value in integer literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1703
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1704
| integer_type_name error signed_integer
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1705
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1706
	 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '#' between integer type name and value in integer literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1707
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1708
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1709
| integer_type_name error binary_integer
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1710
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1711
	 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '#' between integer type name and value in integer literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1712
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1713
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1714
| integer_type_name error octal_integer
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1715
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1716
	 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '#' between integer type name and value in integer literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1717
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1718
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1719
| integer_type_name error hex_integer
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1720
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1721
	 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '#' between integer type name and value in integer literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1722
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1723
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1724
| integer_type_name '#' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1725
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1726
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid value for integer literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1727
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1728
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1729
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1730
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1731
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1732
signed_integer:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1733
  integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1734
| '+' integer   {$$ = $2;}
118
d4cf7ea933a4 Problem with negated literals while compiling generated C file on 32bits systems fixed
lbessard
parents: 98
diff changeset
  1735
| '-' integer	{$$ = new neg_literal_c($2, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1736
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1737
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1738
/* a helper symbol for non_negative_constant */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1739
/* A integer without any preceding '-', but may
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1740
 * include a preceding '+' !
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1741
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1742
non_negative_signed_integer:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1743
  integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1744
| '+' integer   {$$ = $2;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1745
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1746
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1747
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1748
real_literal:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1749
  signed_real
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1750
| real_type_name '#' signed_real
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1751
	{$$ = new real_literal_c($1, $3, locf(@1), locl(@3));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1752
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1753
| real_type_name signed_real
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1754
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1755
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1756
	 print_err_msg(current_filename, locf(@1), locl(@2), "'#' missing between real type name and value in real literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1757
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1758
| real_type_name error signed_real
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1759
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1760
	 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '#' between real type name and value in real literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1761
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1762
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1763
| real_type_name '#' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1764
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1765
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid value for real literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1766
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1767
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1768
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1769
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1770
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1771
/* helper symbol for non_negative_numeric_literal */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1772
non_negative_real_literal:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1773
  non_negative_signed_real
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1774
| real_type_name '#' signed_real
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1775
	{$$ = new real_literal_c($1, $3, locf(@1), locl(@3));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1776
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1777
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1778
signed_real:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1779
  real
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1780
| '+' real	{$$ = $2;}
118
d4cf7ea933a4 Problem with negated literals while compiling generated C file on 32bits systems fixed
lbessard
parents: 98
diff changeset
  1781
| '-' real	{$$ = new neg_literal_c($2, locloc(@2));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1782
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1783
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1784
/* helper symbol for non_negative_real_literal */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1785
non_negative_signed_real:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1786
  real
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1787
| '+' real	{$$ = $2;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1788
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1789
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1790
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1791
bit_string_literal:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1792
  bit_string_type_name '#' integer  /* i.e. unsigned_integer */
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1793
	{$$ = new bit_string_literal_c($1, $3, locf(@1), locl(@3));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1794
| bit_string_type_name '#' binary_integer
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1795
	{$$ = new bit_string_literal_c($1, $3, locf(@1), locl(@3));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1796
| bit_string_type_name '#' octal_integer
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1797
	{$$ = new bit_string_literal_c($1, $3, locf(@1), locl(@3));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1798
| bit_string_type_name '#' hex_integer
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1799
	{$$ = new bit_string_literal_c($1, $3, locf(@1), locl(@3));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1800
/* NOTE: see note in the definition of constant for reason
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1801
 * why unsigned_integer, binary_integer, octal_integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1802
 * and hex_integer are missing here!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1803
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1804
/* NOTE: see note under the B 1.2.1 section of token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1805
 * and grouping type definition for reason why the use of
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1806
 * bit_string_type_name, although seemingly incorrect, is
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1807
 * really correct here!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1808
 */
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1809
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1810
| bit_string_type_name integer
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1811
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1812
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1813
	 print_err_msg(current_filename, locf(@1), locl(@2), "'#' missing between bit string type name and value in bit string literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1814
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1815
| bit_string_type_name binary_integer
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1816
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1817
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1818
	 print_err_msg(current_filename, locf(@1), locl(@2), "'#' missing between bit string type name and value in bit string literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1819
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1820
| bit_string_type_name octal_integer
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1821
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1822
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1823
	 print_err_msg(current_filename, locf(@1), locl(@2), "'#' missing between bit string type name and value in bit string literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1824
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1825
| bit_string_type_name hex_integer
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1826
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1827
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1828
	 print_err_msg(current_filename, locf(@1), locl(@2), "'#' missing between bit string type name and value in bit string literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1829
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1830
| bit_string_type_name error integer
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1831
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1832
	 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '#' between bit string type name and value in bit string literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1833
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1834
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1835
| bit_string_type_name error binary_integer
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1836
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1837
	 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '#' between bit string type name and value in bit string literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1838
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1839
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1840
| bit_string_type_name error octal_integer
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1841
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1842
	 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '#' between bit string type name and value in bit string literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1843
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1844
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1845
| bit_string_type_name error hex_integer
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1846
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1847
	 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '#' between bit string type name and value in bit string literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1848
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1849
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1850
| bit_string_type_name '#' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1851
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1852
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid value for bit string literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1853
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1854
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1855
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1856
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1857
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1858
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1859
boolean_literal:
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1860
  TRUE	{$$ = new boolean_literal_c(new bool_type_name_c(locloc(@$)),
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1861
  				    new boolean_true_c(locloc(@$)),
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1862
				    locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1863
| FALSE	{$$ = new boolean_literal_c(new bool_type_name_c(locloc(@$)),
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1864
				    new boolean_false_c(locloc(@$)),
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1865
				    locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1866
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1867
|	BOOL '#' '1' {}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1868
|	BOOL '#' '0' {}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1869
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1870
/* NOTE: the rules
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1871
 * BOOL '#' '1'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1872
 * and
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1873
 * BOOL '#' '0'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1874
 * do not work as expected...
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1875
 * Consider that we are using 'BOOL' and '#' as tokens
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1876
 * that flex hands over to bison (yacc). Because flex would
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1877
 * then parse the single '1' or '0' as an integer,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1878
 * the rule in bison would have to be
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1879
 * BOOL '#' integer, followed by verifying 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
  1880
 * integer has the correct value!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1881
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1882
 * We therefore have flex return TRUE whenever it
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1883
 * comes across 'TRUE' or 'BOOL#1', and FALSE whenever
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1884
 * it comes across 'FALSE' or 'BOOL#0'.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1885
 * Note that this means that flex will parse "BOOL#01"
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1886
 * as FALSE followed by an integer ('1').
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1887
 * Bison should detect this as an error, so we should
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1888
 * be OK.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1889
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1890
 * Another option would be to change the rules to accept
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1891
 * BOOL '#' integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1892
 * but then check whether the integer has a correct
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1893
 * value! At the moment I feel that the first option
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1894
 * is more straight forward.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1895
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1896
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1897
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1898
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1899
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1900
/*******************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1901
/* B 1.2.2 - Character Strings */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1902
/*******************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1903
/* Transform the tokens given us by flex into leafs */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1904
single_byte_character_string:	single_byte_character_string_token
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1905
	{$$ = new single_byte_character_string_c($1, locloc(@$));};
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1906
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1907
double_byte_character_string:	double_byte_character_string_token
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1908
	{$$ = new double_byte_character_string_c($1, locloc(@$));};
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1909
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1910
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1911
character_string:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1912
  single_byte_character_string
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1913
| double_byte_character_string
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1914
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1915
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1916
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1917
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1918
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1919
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1920
/***************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1921
/* B 1.2.3 - Time Literals */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1922
/***************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1923
time_literal:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1924
  time_of_day
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1925
| date
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1926
| date_and_time
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1927
| duration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1928
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1929
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1930
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1931
/************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1932
/* B 1.2.3.1 - Duration */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1933
/************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1934
duration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1935
/*  (T | TIME) '#' ['-'] interval */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1936
/* NOTE: since TIME is also a data type, it is a keyword
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1937
 *       and may therefore be handled by a token.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1938
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1939
 *       Unfortunately T is not a data type, and therefore
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1940
 *       not a keyword. This means that we may have variables named T!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1941
 *       Flex cannot return the token TIME when it comes across a single T!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1942
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1943
 *       We therefore have flex returning the token T_SHARP
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1944
 *       when it comes across 'T#'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1945
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1946
  TIME '#' interval
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1947
	{$$ = new duration_c(NULL, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1948
| TIME '#' '-' interval
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1949
	{$$ = new duration_c(new neg_time_c(locloc(@$)), $4, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1950
| T_SHARP interval
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1951
	{$$ = new duration_c(NULL, $2, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1952
| T_SHARP '-' interval
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1953
	{$$ = new duration_c(new neg_time_c(locloc(@$)), $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1954
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1955
| TIME interval
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1956
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1957
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1958
	 print_err_msg(current_filename, locf(@1), locl(@2), "'#' missing between 'TIME' and interval in duration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1959
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1960
| TIME '-' interval
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1961
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1962
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1963
	 print_err_msg(current_filename, locf(@1), locl(@2), "'#' missing between 'TIME' and interval in duration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1964
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1965
| TIME error interval
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1966
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1967
	 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '#' between 'TIME' and interval in duration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1968
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1969
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1970
| TIME error '-' interval
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1971
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1972
	 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '#' between 'TIME' and interval in duration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1973
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1974
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1975
| TIME '#' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1976
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1977
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid value for duration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1978
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1979
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1980
| T_SHARP error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1981
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1982
	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid value for duration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1983
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1984
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  1985
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1986
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1987
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1988
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1989
interval:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1990
  days
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1991
| hours
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1992
| minutes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1993
| seconds
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1994
| milliseconds
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1995
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1996
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1997
integer_d:  integer_d_token  {$$ = new integer_c($1, locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1998
integer_h:  integer_h_token  {$$ = new integer_c($1, locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  1999
integer_m:  integer_m_token  {$$ = new integer_c($1, locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2000
integer_s:  integer_s_token  {$$ = new integer_c($1, locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2001
integer_ms: integer_ms_token {$$ = new integer_c($1, locloc(@$));};
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2002
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2003
fixed_point_d:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2004
  fixed_point_d_token
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2005
	{$$ = new fixed_point_c($1, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2006
| integer_d
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2007
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2008
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2009
fixed_point_h:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2010
  fixed_point_h_token
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2011
	{$$ = new fixed_point_c($1, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2012
| integer_h
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2013
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2014
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2015
fixed_point_m:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2016
  fixed_point_m_token
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2017
	{$$ = new fixed_point_c($1, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2018
| integer_m
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2019
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2020
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2021
fixed_point_s:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2022
  fixed_point_s_token
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2023
	{$$ = new fixed_point_c($1, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2024
| integer_s
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2025
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2026
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2027
fixed_point_ms:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2028
  fixed_point_ms_token
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2029
	{$$ = new fixed_point_c($1, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2030
| integer_ms
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2031
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2032
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2033
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2034
fixed_point:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2035
  fixed_point_token
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2036
	{$$ = new fixed_point_c($1, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2037
| integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2038
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2039
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2040
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2041
days:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2042
/*  fixed_point ('d') */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2043
  fixed_point_d
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2044
	{$$ = new days_c($1, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2045
/*| integer ('d') ['_'] hours */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2046
| integer_d hours
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2047
	{$$ = new days_c($1, $2, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2048
| integer_d '_' hours
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2049
	{$$ = new days_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2050
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2051
| integer_d '_' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2052
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2053
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid value for hours in duration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2054
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2055
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2056
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2057
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2058
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2059
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2060
hours:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2061
/*  fixed_point ('h') */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2062
  fixed_point_h
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2063
	{$$ = new hours_c($1, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2064
/*| integer ('h') ['_'] minutes */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2065
| integer_h minutes
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2066
	{$$ = new hours_c($1, $2, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2067
| integer_h '_' minutes
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2068
	{$$ = new hours_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2069
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2070
| integer_h '_' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2071
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2072
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid value for minutes in duration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2073
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2074
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2075
/* ERROR_CHECK_END */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2076
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2077
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2078
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2079
minutes:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2080
/*  fixed_point ('m') */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2081
  fixed_point_m
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2082
	{$$ = new minutes_c($1, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2083
/*| integer ('m') ['_'] seconds */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2084
| integer_m seconds
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2085
	{$$ = new minutes_c($1, $2, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2086
| integer_m '_' seconds
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2087
	{$$ = new minutes_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2088
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2089
| integer_m '_' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2090
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2091
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid value for seconds in duration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2092
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2093
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2094
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2095
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2096
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2097
seconds:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2098
/*  fixed_point ('s') */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2099
  fixed_point_s
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2100
	{$$ = new seconds_c($1, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2101
/*| integer ('s') ['_'] milliseconds */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2102
| integer_s milliseconds
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2103
	{$$ = new seconds_c($1, $2, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2104
| integer_s '_' milliseconds
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2105
	{$$ = new seconds_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2106
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2107
| integer_s '_' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2108
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2109
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid value for milliseconds in duration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2110
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2111
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2112
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2113
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2114
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2115
milliseconds:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2116
/*  fixed_point ('ms') */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2117
  fixed_point_ms
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2118
	{$$ = new milliseconds_c($1, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2119
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2120
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2121
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2122
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2123
/************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2124
/* B 1.2.3.2 - Time of day and Date */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2125
/************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2126
time_of_day:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2127
  TIME_OF_DAY '#' daytime
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2128
	{$$ = new time_of_day_c($3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2129
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2130
| TIME_OF_DAY daytime
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2131
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2132
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2133
	 print_err_msg(current_filename, locf(@1), locl(@2), "'#' missing between 'TIME_OF_DAY' and daytime in time of day.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2134
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2135
| TIME_OF_DAY error daytime
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2136
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2137
	 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '#' between 'TIME_OF_DAY' and daytime in time of day.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2138
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2139
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2140
| TIME_OF_DAY '#' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2141
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2142
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid value for time of day.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2143
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2144
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2145
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2146
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2147
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2148
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2149
daytime:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2150
  day_hour ':' day_minute ':' day_second
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2151
	{$$ = new daytime_c($1, $3, $5, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2152
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2153
| day_hour day_minute ':' day_second
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2154
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2155
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2156
	 print_err_msg(current_filename, locf(@1), locl(@2), "':' missing between hours and minutes in daytime.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2157
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2158
| day_hour error day_minute ':' day_second
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2159
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2160
	 print_err_msg(current_filename, locf(@1), locl(@3), "expecting ':' between hours and minutes in daytime.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2161
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2162
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2163
| day_hour ':' ':' day_second
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2164
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2165
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2166
	 print_err_msg(current_filename, locf(@2), locl(@3), "no minutes defined in daytime.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2167
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2168
| day_hour ':' error ':' day_second
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2169
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2170
	 print_err_msg(current_filename, locf(@2), locl(@4), "invalid value for minutes in daytime.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2171
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2172
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2173
| day_hour ':' day_minute day_second
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2174
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2175
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2176
	 print_err_msg(current_filename, locf(@3), locl(@4), "':' missing between minutes and seconds in daytime.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2177
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2178
| day_hour ':' day_minute error day_second
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2179
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2180
	 print_err_msg(current_filename, locf(@3), locl(@5), "expecting ':' between minutes and seconds in daytime.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2181
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2182
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2183
| day_hour ':' day_minute ':' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2184
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2185
	 print_err_msg(current_filename, locf(@4), locl(@4), "invalid value for seconds in daytime.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2186
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2187
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2188
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2189
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2190
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2191
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2192
day_hour: integer;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2193
day_minute: integer;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2194
day_second: fixed_point;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2195
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2196
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2197
date:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2198
  DATE '#' date_literal
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2199
	{$$ = new date_c($3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2200
| D_SHARP date_literal
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2201
	{$$ = new date_c($2, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2202
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2203
| DATE date_literal
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2204
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2205
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2206
	 print_err_msg(current_filename, locf(@1), locl(@2), "'#' missing between 'DATE' and date literal in date.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2207
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2208
| DATE error date_literal
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2209
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2210
	 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '#' between 'DATE' and date literal in date.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2211
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2212
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2213
| DATE '#' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2214
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2215
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid value for date.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2216
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2217
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2218
| D_SHARP error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2219
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2220
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid value for date.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2221
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2222
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2223
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2224
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2225
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2226
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2227
date_literal:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2228
  year '-' month '-' day
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2229
	{$$ = new date_literal_c($1, $3, $5, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2230
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2231
| year month '-' day
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2232
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2233
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2234
	 print_err_msg(current_filename, locf(@1), locl(@2), "'-' missing between year and month in date literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2235
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2236
| year error month '-' day
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2237
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2238
	 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '-' between year and month in date literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2239
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2240
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2241
| year '-' '-' day
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2242
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2243
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2244
	 print_err_msg(current_filename, locf(@2), locl(@3), "no month defined in date literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2245
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2246
| year '-' error '-' day
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2247
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2248
	 print_err_msg(current_filename, locf(@2), locl(@4), "invalid value for month in date literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2249
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2250
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2251
| year '-' month day
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2252
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2253
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2254
	 print_err_msg(current_filename, locf(@3), locl(@4), "':' missing between month and day in date literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2255
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2256
| year ':' month error day
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2257
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2258
	 print_err_msg(current_filename, locf(@3), locl(@5), "expecting ':' between month and day in date literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2259
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2260
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2261
| year ':' month ':' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2262
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2263
	 print_err_msg(current_filename, locf(@4), locl(@4), "invalid value for day in date literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2264
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2265
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2266
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2267
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2268
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2269
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2270
year: integer;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2271
month: integer;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2272
day: integer;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2273
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2274
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2275
date_and_time:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2276
  DATE_AND_TIME '#' date_literal '-' daytime
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2277
	{$$ = new date_and_time_c($3, $5, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2278
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2279
| DATE_AND_TIME date_literal '-' daytime
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2280
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2281
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2282
	 print_err_msg(current_filename, locf(@1), locl(@2), "'#' missing between 'DATE_AND_TIME' and date literal in date and time.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2283
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2284
| DATE_AND_TIME error date_literal '-' daytime
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2285
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2286
	 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '#' between 'DATE_AND_TIME' and date literal in date and time.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2287
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2288
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2289
| DATE_AND_TIME '#' '-' daytime
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2290
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2291
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2292
	 print_err_msg(current_filename, locf(@2), locl(@2), "no value defined for date literal in date and time.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2293
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2294
| DATE_AND_TIME '#' error '-' daytime
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2295
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2296
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid value for date literal in date and time.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2297
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2298
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2299
| DATE_AND_TIME '#' date_literal daytime
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2300
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2301
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2302
	 print_err_msg(current_filename, locf(@2), locl(@2), "'-' missing between date literal and daytime in date and time.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2303
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2304
| DATE_AND_TIME '#' date_literal error daytime
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2305
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2306
	 print_err_msg(current_filename, locf(@2), locl(@2), "expecting '-' between date literal and daytime in date and time.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2307
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2308
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2309
| DATE_AND_TIME '#' date_literal '-' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2310
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2311
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid value for daytime in date and time.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2312
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2313
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2314
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2315
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2316
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2317
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2318
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2319
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2320
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2321
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2322
/**********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2323
/* B 1.3 - Data Types */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2324
/**********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2325
/* Strangely, the following symbol does seem to be required! */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2326
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2327
data_type_name:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2328
  non_generic_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2329
| generic_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2330
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2331
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2332
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2333
non_generic_type_name:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2334
  elementary_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2335
| derived_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2336
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2337
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2338
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2339
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2340
/***********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2341
/* B 1.3.1 - Elementary Data Types */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2342
/***********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2343
elementary_type_name:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2344
  numeric_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2345
| date_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2346
| bit_string_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2347
| elementary_string_type_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2348
| TIME		{$$ = new time_type_name_c(locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2349
| BOOL		{$$ = new bool_type_name_c(locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2350
/* NOTE: see note under the B 1.2.1 section of token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2351
 * and grouping type definition for reason why BOOL
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2352
 * was added to this definition.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2353
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2354
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2355
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2356
numeric_type_name:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2357
  integer_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2358
| real_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2359
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2360
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2361
integer_type_name:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2362
  signed_integer_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2363
| unsigned_integer_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2364
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2365
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2366
signed_integer_type_name:
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2367
  SINT	{$$ = new sint_type_name_c(locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2368
| INT	{$$ = new int_type_name_c(locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2369
| DINT	{$$ = new dint_type_name_c(locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2370
| LINT	{$$ = new lint_type_name_c(locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2371
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2372
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2373
unsigned_integer_type_name:
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2374
  USINT	{$$ = new usint_type_name_c(locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2375
| UINT	{$$ = new uint_type_name_c(locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2376
| UDINT	{$$ = new udint_type_name_c(locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2377
| ULINT	{$$ = new ulint_type_name_c(locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2378
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2379
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2380
real_type_name:
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2381
  REAL	{$$ = new real_type_name_c(locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2382
| LREAL	{$$ = new lreal_type_name_c(locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2383
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2384
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2385
date_type_name:
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2386
  DATE		{$$ = new date_type_name_c(locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2387
| TIME_OF_DAY	{$$ = new tod_type_name_c(locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2388
| TOD		{$$ = new tod_type_name_c(locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2389
| DATE_AND_TIME	{$$ = new dt_type_name_c(locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2390
| DT		{$$ = new dt_type_name_c(locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2391
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2392
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2393
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2394
bit_string_type_name:
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2395
  BYTE	{$$ = new byte_type_name_c(locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2396
| WORD	{$$ = new word_type_name_c(locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2397
| DWORD	{$$ = new dword_type_name_c(locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2398
| LWORD	{$$ = new lword_type_name_c(locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2399
/* NOTE: see note under the B 1.2.1 section of token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2400
 * and grouping type definition for reason why the BOOL
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2401
 * was omitted from this definition.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2402
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2403
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2404
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2405
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2406
/* Helper symbol to concentrate the instantiation
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2407
 * of STRING and WSTRING into a single location.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2408
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2409
 * These two elements show up in several other rules,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2410
 * but we want to create the equivalent abstract syntax
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2411
 * in a single location of this file, in order to make
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2412
 * possible future changes easier to edit...
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2413
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2414
elementary_string_type_name:
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2415
  STRING	{$$ = new string_type_name_c(locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2416
| WSTRING	{$$ = new wstring_type_name_c(locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2417
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2418
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2419
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2420
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2421
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2422
/* B 1.3.2 - Generic data types */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2423
/********************************/
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2424
/* Strangely, the following symbol does not seem to be required! */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2425
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2426
generic_type_name:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2427
  ANY
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2428
| ANY_DERIVED
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2429
| ANY_ELEMENTARY
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2430
| ANY_MAGNITUDE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2431
| ANY_NUM
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2432
| ANY_REAL
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2433
| ANY_INT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2434
| ANY_BIT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2435
| ANY_STRING
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2436
| ANY_DATE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2437
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2438
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2439
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2440
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2441
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2442
/* B 1.3.3 - Derived data types */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2443
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2444
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2445
derived_type_name:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2446
  single_element_type_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2447
| prev_declared_array_type_name
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2448
| prev_declared_structure_type_name
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2449
| prev_declared_string_type_name
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2450
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2451
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2452
single_element_type_name:
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2453
  prev_declared_simple_type_name
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2454
/* Include the following if arrays of function blocks are to be allowed!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2455
 * Since the standard does not allow them,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2456
 * we leave it commented out for the time being...
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2457
 */
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2458
//| prev_declared_derived_function_block_name
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2459
| prev_declared_subrange_type_name
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2460
| prev_declared_enumerated_type_name
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2461
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2462
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2463
/* NOTE: in order to remove a reduce/reduce conflict,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2464
 *       all occurences of simple_type_name, etc...
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2465
 *       have been replaced with identifier!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2466
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2467
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2468
simple_type_name: identifier;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2469
subrange_type_name: identifier;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2470
enumerated_type_name: identifier;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2471
array_type_name: identifier;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2472
structure_type_name: identifier;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2473
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2474
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2475
data_type_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2476
  TYPE type_declaration_list END_TYPE
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2477
	{$$ = new data_type_declaration_c($2, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2478
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2479
| TYPE END_TYPE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2480
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2481
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2482
	 print_err_msg(current_filename, locf(@1), locl(@2), "no data type declared in data type(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2483
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2484
| TYPE error type_declaration_list END_TYPE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2485
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2486
	 print_err_msg(current_filename, locf(@1), locl(@3), "unexpected token after 'TYPE' in data type(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2487
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2488
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2489
| TYPE error END_TYPE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2490
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2491
	 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in data type(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2492
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2493
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2494
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2495
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2496
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2497
/* helper symbol for data_type_declaration */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2498
type_declaration_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2499
  type_declaration ';'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2500
	{$$ = new type_declaration_list_c(locloc(@$)); $$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2501
| type_declaration_list type_declaration ';'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2502
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2503
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2504
| type_declaration error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2505
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2506
	 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at end of data type declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2507
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2508
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2509
| type_declaration_list type_declaration error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2510
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2511
	 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at end of data type declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2512
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2513
	}
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  2514
| type_declaration_list error ';'
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  2515
	{$$ = NULL;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  2516
	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid data type declaration.");
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  2517
	 yyerrok;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  2518
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2519
| type_declaration_list ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2520
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2521
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2522
	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after data type declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2523
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2524
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2525
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2526
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2527
type_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2528
  single_element_type_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2529
| array_type_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2530
| structure_type_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2531
| string_type_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2532
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2533
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2534
single_element_type_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2535
  simple_type_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2536
| subrange_type_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2537
| enumerated_type_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2538
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2539
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2540
simple_type_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2541
/*  simple_type_name ':' simple_spec_init */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2542
  identifier ':' simple_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2543
	{$$ = new simple_type_declaration_c($1, $3, locloc(@$));
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2544
	 library_element_symtable.insert($1, prev_declared_simple_type_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2545
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2546
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2547
| identifier simple_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2548
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2549
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2550
	 print_err_msg(current_filename, locf(@1), locl(@2), "':' missing between data type name and specification in simple type declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2551
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2552
| identifier ':' identifier
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2553
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2554
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2555
	 print_err_msg(current_filename, locf(@3), locl(@3), "unknown data type defined in specification for data type declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2556
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2557
| identifier ':' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2558
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2559
	 print_err_msg(current_filename, locf(@2), locl(@2), "no specification defined in data type declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2560
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2561
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2562
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2563
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2564
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2565
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2566
simple_spec_init:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2567
  simple_specification
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2568
  /* The following commented line was changed to the 
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2569
   * next two lines so that we wouldn't
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2570
   * have the first element of a simple_spec_init_c()
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2571
   * pointing to another simple_spec_init_c!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2572
   */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2573
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2574
| simple_specification ASSIGN constant
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2575
	{$$ = new simple_spec_init_c($1, $3);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2576
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2577
| elementary_type_name ASSIGN constant
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2578
	{$$ = new simple_spec_init_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2579
| prev_declared_simple_type_name ASSIGN constant
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2580
	{$$ = new simple_spec_init_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2581
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2582
| elementary_type_name constant
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2583
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2584
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2585
	 print_err_msg(current_filename, locf(@1), locl(@2), "':=' missing in specification with initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2586
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2587
| prev_declared_simple_type_name constant
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2588
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2589
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2590
	 print_err_msg(current_filename, locf(@1), locl(@2), "':=' missing in specification with initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2591
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2592
| identifier ASSIGN constant
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2593
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2594
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2595
	 print_err_msg(current_filename, locf(@1), locl(@1), "unknown type defined in specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2596
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2597
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2598
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2599
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2600
/* When converting to C/C++, we need to know whether
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2601
 * the elementary_type_name is being used in a variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2602
 * declaration or elsewhere (ex. declaration of a derived
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2603
 * type), so the abstract syntax has the elementary_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2604
 * wrapped inside a simple_spec_init_c.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2605
 * The exact same thing occurs with prev_declared_simple_type_name.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2606
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2607
 * This is why in the definition of simple_spec_init,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2608
 * simple_specification was brocken up into its
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2609
 * constituent components...
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2610
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2611
simple_specification:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2612
// elementary_type_name | simple_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2613
  elementary_type_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2614
	{$$ = new simple_spec_init_c($1, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2615
| prev_declared_simple_type_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2616
	{$$ = new simple_spec_init_c($1, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2617
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2618
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2619
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2620
subrange_type_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2621
/*  subrange_type_name ':' subrange_spec_init */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2622
  identifier ':' subrange_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2623
	{$$ = new subrange_type_declaration_c($1, $3, locloc(@$));
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2624
	 library_element_symtable.insert($1, prev_declared_subrange_type_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2625
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2626
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2627
| identifier subrange_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2628
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2629
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2630
	 print_err_msg(current_filename, locf(@1), locl(@2), "':' missing between data type name and specification in subrange type declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2631
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2632
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2633
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2634
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2635
subrange_spec_init:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2636
  subrange_specification
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2637
	{$$ = new subrange_spec_init_c($1, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2638
| subrange_specification ASSIGN signed_integer
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2639
	{$$ = new subrange_spec_init_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2640
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2641
| subrange_specification signed_integer
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2642
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2643
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2644
	 print_err_msg(current_filename, locf(@1), locl(@2), "':=' missing in subrange specification with initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2645
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2646
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2647
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2648
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2649
subrange_specification:
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2650
  integer_type_name '(' subrange ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2651
	{$$ = new subrange_specification_c($1, $3, locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2652
| prev_declared_subrange_type_name
98
d0cdf1d00b74 Adding support for derived data types.
lbessard
parents: 96
diff changeset
  2653
  {$$ = new subrange_specification_c($1, NULL, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2654
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2655
| integer_type_name '(' ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2656
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2657
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2658
	 print_err_msg(current_filename, locf(@2), locl(@3), "no subrange defined in subrange specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2659
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2660
| integer_type_name '(' error ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2661
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2662
	 print_err_msg(current_filename, locf(@2), locl(@4), "invalid subrange defined in subrange specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2663
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2664
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2665
| integer_type_name '(' subrange error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2666
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2667
	 print_err_msg(current_filename, locf(@3), locl(@3), "')' missing after subrange defined in subrange specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2668
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2669
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2670
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2671
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2672
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2673
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2674
subrange:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2675
  signed_integer DOTDOT signed_integer
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2676
	{$$ = new subrange_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2677
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2678
| signed_integer signed_integer
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2679
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2680
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2681
	 print_err_msg(current_filename, locf(@1), locl(@2), "'..' missing between bounds in subrange definition.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2682
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2683
| signed_integer error signed_integer
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2684
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2685
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2686
	 print_err_msg(current_filename, locf(@1), locl(@2), "expecting '..' between bounds in subrange definition.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2687
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2688
| signed_integer DOTDOT error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2689
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2690
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2691
	 print_err_msg(current_filename, locf(@1), locl(@2), "invalid value for upper bound in subrange definition.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2692
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2693
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2694
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2695
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2696
enumerated_type_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2697
/*  enumerated_type_name ':' enumerated_spec_init */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2698
  identifier ':' enumerated_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2699
	{$$ = new enumerated_type_declaration_c($1, $3, locloc(@$));
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2700
	 library_element_symtable.insert($1, prev_declared_enumerated_type_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2701
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2702
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2703
| identifier enumerated_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2704
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2705
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2706
	 print_err_msg(current_filename, locf(@1), locl(@2), "':' missing between data type name and specification in enumerated type declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2707
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2708
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2709
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2710
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2711
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2712
enumerated_spec_init:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2713
  enumerated_specification
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2714
	{$$ = new enumerated_spec_init_c($1, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2715
| enumerated_specification ASSIGN enumerated_value
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2716
	{$$ = new enumerated_spec_init_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2717
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2718
| enumerated_specification enumerated_value
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2719
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2720
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2721
	 print_err_msg(current_filename, locf(@1), locl(@2), "':=' missing in enumerated specification with initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2722
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2723
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2724
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2725
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2726
enumerated_specification:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2727
  '(' enumerated_value_list ')'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2728
	{$$ = $2;}
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2729
| prev_declared_enumerated_type_name
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2730
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2731
| '(' ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2732
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2733
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2734
	 print_err_msg(current_filename, locf(@1), locl(@2), "no enumerated value list defined in enumerated specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2735
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2736
| '(' error ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2737
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2738
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid enumerated value list defined in enumerated specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2739
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2740
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2741
| '(' enumerated_value_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2742
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2743
	 print_err_msg(current_filename, locf(@2), locl(@2), "')' missing at the end of enumerated specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2744
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2745
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2746
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2747
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2748
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2749
/* helper symbol for enumerated_specification */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2750
enumerated_value_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2751
  enumerated_value
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2752
	{$$ = new enumerated_value_list_c(locloc(@$)); $$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2753
| enumerated_value_list ',' enumerated_value
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2754
	{$$ = $1; $$->add_element($3);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2755
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2756
| enumerated_value_list enumerated_value
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2757
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2758
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2759
	 print_err_msg(current_filename, locf(@1), locl(@2), "',' missing in enumerated value list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2760
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2761
| enumerated_value_list ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2762
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2763
	 print_err_msg(current_filename, locf(@1), locl(@2), "invalid value in enumerated value list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2764
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2765
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2766
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2767
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2768
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2769
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2770
enumerated_value:
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  2771
  identifier 
121
9e8ce092e169 Adding support for POU struct definition in POUS.h
lbessard
parents: 118
diff changeset
  2772
  {$$ = new enumerated_value_c(NULL, $1, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2773
| prev_declared_enumerated_type_name '#' any_identifier
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2774
	{$$ = new enumerated_value_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2775
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2776
| prev_declared_enumerated_type_name any_identifier
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2777
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2778
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2779
	 print_err_msg(current_filename, locf(@1), locl(@2), "'#' missing between enumerated type name and value in enumerated literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2780
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2781
| prev_declared_enumerated_type_name error any_identifier
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2782
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2783
	 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '#' between enumerated type name and value in enumerated literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2784
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2785
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2786
| prev_declared_enumerated_type_name '#' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2787
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2788
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid value for enumerated literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2789
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2790
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2791
| identifier '#' any_identifier
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2792
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2793
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2794
	 print_err_msg(current_filename, locf(@1), locl(@1), "unknown type name for typed literal.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2795
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2796
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2797
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2798
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2799
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  2800
/*
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  2801
enumerated_value_without_identifier:
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  2802
  prev_declared_enumerated_type_name '#' any_identifier
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2803
	{$$ = new enumerated_value_c($1, $3, locloc(@$));}
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  2804
;
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  2805
*/
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  2806
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2807
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2808
array_type_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2809
/*  array_type_name ':' array_spec_init */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2810
  identifier ':' array_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2811
	{$$ = new array_type_declaration_c($1, $3, locloc(@$));
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2812
	 library_element_symtable.insert($1, prev_declared_array_type_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2813
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2814
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2815
| identifier array_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2816
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2817
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2818
	 print_err_msg(current_filename, locf(@1), locl(@2), "':' missing between data type name and specification in array type declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2819
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2820
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2821
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2822
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2823
array_spec_init:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2824
  array_specification
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2825
	{$$ = new array_spec_init_c($1, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2826
| array_specification ASSIGN array_initialization
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2827
	{$$ = new array_spec_init_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2828
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2829
| array_specification array_initialization
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2830
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2831
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2832
	 print_err_msg(current_filename, locf(@1), locl(@2), "':=' missing in array specification with initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2833
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2834
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2835
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2836
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2837
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2838
array_specification:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2839
  prev_declared_array_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2840
| ARRAY '[' array_subrange_list ']' OF non_generic_type_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2841
	{$$ = new array_specification_c($3, $6, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2842
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2843
| ARRAY array_subrange_list ']' OF non_generic_type_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2844
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2845
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2846
	 print_err_msg(current_filename, locf(@1), locl(@2), "'[' missing before subrange list in array specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2847
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2848
| ARRAY error array_subrange_list ']' OF non_generic_type_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2849
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2850
	 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '[' after 'ARRAY' in array specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2851
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2852
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2853
| ARRAY '[' ']' OF non_generic_type_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2854
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2855
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2856
	 print_err_msg(current_filename, locf(@2), locl(@3), "no subrange list defined in array specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2857
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2858
| ARRAY '[' error ']' OF non_generic_type_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2859
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2860
	 print_err_msg(current_filename, locf(@2), locl(@4), "invalid subrange list defined in array specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2861
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2862
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2863
| ARRAY OF non_generic_type_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2864
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2865
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2866
	 print_err_msg(current_filename, locf(@1), locl(@2), "no subrange list defined in array specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2867
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2868
| ARRAY error OF non_generic_type_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2869
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2870
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid subrange list defined in array specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2871
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2872
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2873
| ARRAY '[' array_subrange_list OF non_generic_type_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2874
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2875
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2876
	 print_err_msg(current_filename, locf(@3), locl(@4), "']' missing after subrange list in array specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2877
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2878
| ARRAY '[' array_subrange_list error OF non_generic_type_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2879
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2880
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2881
	 print_err_msg(current_filename, locf(@3), locl(@5), "expecting '[' after subrange list in array specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2882
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2883
| ARRAY '[' array_subrange_list ']' non_generic_type_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2884
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2885
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2886
	 print_err_msg(current_filename, locf(@4), locl(@5), "'OF' missing between subrange list and item type name in array specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2887
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2888
| ARRAY '[' array_subrange_list ']' error non_generic_type_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2889
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2890
	 print_err_msg(current_filename, locf(@4), locl(@6), "expecting 'OF' between subrange list and item type name in array specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2891
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2892
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2893
| ARRAY '[' array_subrange_list ']' OF error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2894
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2895
	 print_err_msg(current_filename, locf(@1), locl(@3), "no itme data type defined in array specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2896
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2897
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2898
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2899
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2900
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2901
/* helper symbol for array_specification */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2902
array_subrange_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2903
  subrange
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2904
	{$$ = new array_subrange_list_c(locloc(@$)); $$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2905
| array_subrange_list ',' subrange
98
d0cdf1d00b74 Adding support for derived data types.
lbessard
parents: 96
diff changeset
  2906
	{$$ = $1; $$->add_element($3);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2907
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2908
| array_subrange_list subrange
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2909
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2910
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2911
	 print_err_msg(current_filename, locf(@1), locl(@2), "',' missing in subrange list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2912
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2913
| array_subrange_list ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2914
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2915
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid subrange in subrange list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2916
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2917
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2918
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2919
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2920
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2921
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2922
array_initialization:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2923
  '[' array_initial_elements_list ']'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2924
	{$$ = $2;}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2925
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2926
| '[' ']'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2927
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2928
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2929
	 print_err_msg(current_filename, locf(@1), locl(@2), "no initial values list defined in array initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2930
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2931
| '[' error ']'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2932
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2933
	 print_err_msg(current_filename, locf(@1), locl(@2), "invalid initial values list defined in array initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2934
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2935
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2936
| '[' array_initial_elements_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2937
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2938
	 print_err_msg(current_filename, locf(@1), locl(@2), "']' missing at the end of array initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2939
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2940
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2941
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2942
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2943
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2944
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2945
/* helper symbol for array_initialization */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2946
array_initial_elements_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2947
  array_initial_elements
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2948
	{$$ = new array_initial_elements_list_c(locloc(@$)); $$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2949
| array_initial_elements_list ',' array_initial_elements
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2950
	{$$ = $1; $$->add_element($3);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2951
/* ERROR_CHECK_BEGIN 
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2952
| array_initial_elements_list ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2953
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2954
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid array initial value in array initial values list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2955
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2956
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2957
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2958
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2959
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2960
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2961
array_initial_elements:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2962
  array_initial_element
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2963
| integer '(' ')'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2964
| integer '(' array_initial_element ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2965
	{$$ = new array_initial_elements_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2966
/* ERROR_CHECK_BEGIN 
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2967
| integer '(' error ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2968
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2969
	 print_err_msg(current_filename, locf(@2), locl(@4), "invalid array initial value in array initial values list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2970
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2971
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2972
| integer '(' array_initial_element error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2973
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2974
	 print_err_msg(current_filename, locf(@2), locl(@4), "')' missing at the end of array initial value in array initial values list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2975
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2976
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2977
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2978
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2979
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2980
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2981
array_initial_element:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2982
  constant
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2983
| enumerated_value
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2984
| structure_initialization
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2985
| array_initialization
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2986
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2987
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2988
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2989
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2990
structure_type_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2991
/*  structure_type_name ':' structure_specification */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2992
  identifier ':' structure_specification
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2993
	{$$ = new structure_type_declaration_c($1, $3, locloc(@$));
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2994
	 library_element_symtable.insert($1, prev_declared_structure_type_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2995
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2996
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2997
| identifier structure_specification
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2998
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2999
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3000
	 print_err_msg(current_filename, locf(@1), locl(@2), "':' missing between data type name and specification in structure type declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3001
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3002
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3003
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3004
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3005
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3006
structure_specification:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3007
  structure_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3008
| initialized_structure
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3009
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3010
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3011
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3012
initialized_structure:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3013
  prev_declared_structure_type_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3014
	{$$ = new initialized_structure_c($1, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3015
| prev_declared_structure_type_name ASSIGN structure_initialization
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3016
	{$$ = new initialized_structure_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3017
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3018
| prev_declared_structure_type_name structure_initialization
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3019
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3020
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3021
	 print_err_msg(current_filename, locf(@1), locl(@2), "':=' missing in structure specification with initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3022
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3023
| identifier ASSIGN structure_initialization
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3024
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3025
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3026
	 print_err_msg(current_filename, locf(@1), locl(@2), "unknown type name for structure specification with initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3027
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3028
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3029
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3030
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3031
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3032
structure_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3033
  STRUCT structure_element_declaration_list END_STRUCT
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3034
	{$$ = $2;}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3035
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3036
| STRUCT END_STRUCT
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3037
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3038
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3039
	 print_err_msg(current_filename, locf(@1), locl(@2), "no structure element declared in structure type declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3040
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3041
| STRUCT error structure_element_declaration_list END_STRUCT
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3042
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3043
	 print_err_msg(current_filename, locf(@1), locl(@3), "unexpected token after 'STRUCT' in structure type declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3044
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3045
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3046
| STRUCT error END_STRUCT
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3047
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3048
	 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in structure type declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3049
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3050
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3051
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3052
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3053
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3054
/* helper symbol for structure_declaration */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3055
structure_element_declaration_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3056
  structure_element_declaration ';'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3057
	{$$ = new structure_element_declaration_list_c(locloc(@$)); $$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3058
| structure_element_declaration_list structure_element_declaration ';'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3059
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3060
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3061
| structure_element_declaration error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3062
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3063
	 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at end of structure element declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3064
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3065
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3066
| structure_element_declaration_list structure_element_declaration error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3067
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3068
	 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at end of structure element declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3069
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3070
	}
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  3071
| structure_element_declaration_list error ';'
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  3072
	{$$ = NULL;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  3073
	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid structure element declaration.");
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  3074
	 yyerrok;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  3075
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3076
| structure_element_declaration_list ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3077
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3078
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3079
	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after structure element declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3080
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3081
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3082
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3083
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3084
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3085
structure_element_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3086
  structure_element_name ':' simple_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3087
	{$$ = new structure_element_declaration_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3088
| structure_element_name ':' subrange_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3089
	{$$ = new structure_element_declaration_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3090
| structure_element_name ':' enumerated_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3091
	{$$ = new structure_element_declaration_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3092
| structure_element_name ':' array_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3093
	{$$ = new structure_element_declaration_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3094
| structure_element_name ':' initialized_structure
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3095
	{$$ = new structure_element_declaration_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3096
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3097
| structure_element_name simple_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3098
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3099
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3100
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between structure element name and simple specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3101
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3102
| structure_element_name subrange_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3103
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3104
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3105
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between structure element name and subrange specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3106
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3107
| structure_element_name enumerated_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3108
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3109
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3110
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between structure element name and enumerated specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3111
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3112
| structure_element_name array_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3113
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3114
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3115
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between structure element name and array specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3116
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3117
| structure_element_name initialized_structure
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3118
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3119
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3120
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between structure element name and structure specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3121
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3122
| structure_element_name ':' identifier
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3123
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3124
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3125
	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown variable type defined in structure element declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3126
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3127
| structure_element_name ':' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3128
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3129
	 print_err_msg(current_filename, locf(@2), locl(@2), "no specification defined in structure element declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3130
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3131
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3132
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3133
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3134
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3135
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3136
structure_element_name: any_identifier;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3137
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3138
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3139
structure_initialization:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3140
  '(' structure_element_initialization_list ')'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3141
	{$$ = $2;}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3142
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3143
| '(' error ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3144
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3145
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid structure element initialization list in structure initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3146
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3147
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3148
| '(' structure_element_initialization_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3149
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3150
	 print_err_msg(current_filename, locf(@2), locl(@2), "expecting ')' at the end of structure element initialization list in structure initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3151
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3152
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3153
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3154
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3155
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3156
/* helper symbol for structure_initialization */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3157
structure_element_initialization_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3158
  structure_element_initialization
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3159
	{$$ = new structure_element_initialization_list_c(locloc(@$)); $$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3160
| structure_element_initialization_list ',' structure_element_initialization
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3161
	{$$ = $1; $$->add_element($3);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3162
/* ERROR_CHECK_BEGIN 
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3163
| structure_element_initialization_list structure_element_initialization
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3164
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3165
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3166
	 print_err_msg(current_filename, locf(@2), locl(@2), "',' missing in structure element initialization list in structure initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3167
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3168
| structure_element_initialization_list ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3169
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3170
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid structure element initialization in structure initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3171
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3172
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3173
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3174
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3175
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3176
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3177
structure_element_initialization:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3178
  structure_element_name ASSIGN constant
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3179
	{$$ = new structure_element_initialization_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3180
| structure_element_name ASSIGN enumerated_value
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3181
	{$$ = new structure_element_initialization_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3182
| structure_element_name ASSIGN array_initialization
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3183
	{$$ = new structure_element_initialization_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3184
| structure_element_name ASSIGN structure_initialization
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3185
	{$$ = new structure_element_initialization_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3186
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3187
| structure_element_name constant
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3188
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3189
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3190
	 print_err_msg(current_filename, locf(@1), locl(@2), "':=' missing in structure element initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3191
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3192
| structure_element_name enumerated_value
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3193
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3194
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3195
	 print_err_msg(current_filename, locf(@1), locl(@2), "':=' missing in enumerated structure element initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3196
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3197
| structure_element_name array_initialization
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3198
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3199
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3200
	 print_err_msg(current_filename, locf(@1), locl(@2), "':=' missing in array structure element initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3201
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3202
| structure_element_name structure_initialization
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3203
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3204
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3205
	 print_err_msg(current_filename, locf(@1), locl(@2), "':=' missing in structured structure element initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3206
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3207
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3208
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3209
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3210
/* NOTE: in order to remove a reduce/reduce conflict,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3211
 *       all occurences of string_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3212
 *       have been replaced with identifier!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3213
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3214
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3215
string_type_name: identifier;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3216
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3217
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3218
string_type_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3219
/*  string_type_name ':' elementary_string_type_name string_type_declaration_size string_type_declaration_init */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3220
  identifier ':' elementary_string_type_name string_type_declaration_size string_type_declaration_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3221
	{$$ = new string_type_declaration_c($1, $3, $4, $5, locloc(@$));
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3222
	 library_element_symtable.insert($1, prev_declared_string_type_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3223
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3224
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3225
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3226
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3227
/* helper symbol for string_type_declaration */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3228
string_type_declaration_size:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3229
  '[' integer ']'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3230
	{$$ = $2;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3231
/* REMOVED !! */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3232
//|  /* empty */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3233
//	{$$ = NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3234
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3235
/* The syntax contains a reduce/reduce conflict.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3236
 * The optional '[' <size> ']'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3237
 * has been changed to become mandatory to remove the conflict.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3238
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3239
 * The conflict arises because
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3240
 *  new_str_type : STRING := "hello!"
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3241
 * may be reduced to a string_type_declaration OR
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3242
 * a simple_type_declaration.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3243
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3244
 * Our change forces it to be reduced to a
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3245
 * simple_type_declaration!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3246
 * We chose this option because changing the definition
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3247
 * of simple_spec_init would force us to change all the other
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3248
 * rules in which it appears. The change we made has no
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3249
 * side-effects!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3250
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3251
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3252
/* helper symbol for string_type_declaration */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3253
string_type_declaration_init:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3254
  /* empty */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3255
	{$$ = NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3256
| ASSIGN character_string
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3257
	{$$ = $2;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3258
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3259
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3260
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3261
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3262
/*********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3263
/* B 1.4 - Variables */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3264
/*********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3265
variable:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3266
  symbolic_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3267
| direct_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3268
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3269
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3270
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3271
symbolic_variable:
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3272
/* NOTE: To be entirely correct, variable_name must be replacemed by
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3273
 *         prev_declared_variable_name | prev_declared_fb_name | prev_declared_global_var_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3274
 */
78
aead91ec37cd removing 'identifier' from definition of symbolic_variable
mario
parents: 77
diff changeset
  3275
  prev_declared_fb_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3276
	{$$ = new symbolic_variable_c($1, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3277
| prev_declared_global_var_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3278
	{$$ = new symbolic_variable_c($1, locloc(@$));}
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  3279
| prev_declared_variable_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3280
	{$$ = new symbolic_variable_c($1, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3281
| multi_element_variable
78
aead91ec37cd removing 'identifier' from definition of symbolic_variable
mario
parents: 77
diff changeset
  3282
/*
aead91ec37cd removing 'identifier' from definition of symbolic_variable
mario
parents: 77
diff changeset
  3283
| identifier
aead91ec37cd removing 'identifier' from definition of symbolic_variable
mario
parents: 77
diff changeset
  3284
	{$$ = new symbolic_variable_c($1, locloc(@$));}
aead91ec37cd removing 'identifier' from definition of symbolic_variable
mario
parents: 77
diff changeset
  3285
*/
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3286
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3287
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3288
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3289
/* NOTE: in section B 1.7, when configuring a program, symbolic_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3290
 *       is used. Nevertheless, during the parsing of a configuration,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3291
 *       the variables in question are out of scope, so we should
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3292
 *       be allowing any_identifier instead of prev_declared_variable_name!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3293
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3294
 *       We therefore need a new any_symbolic_variable construct that
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3295
 *       allows the use of any_identifier instead of previously declared
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3296
 *       variables, function blocks, etc...
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3297
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3298
any_symbolic_variable:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3299
// variable_name -> replaced by any_identifier
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3300
  any_identifier
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3301
	{$$ = new symbolic_variable_c($1, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3302
| any_multi_element_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3303
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3304
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3305
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3306
/* for yet undeclared variable names ! */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3307
variable_name: identifier;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3308
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3309
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3310
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3311
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3312
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3313
/********************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3314
/* B.1.4.1   Directly Represented Variables */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3315
/********************************************/
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3316
direct_variable: direct_variable_token	{$$ = new direct_variable_c($1, locloc(@$));};
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3317
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3318
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3319
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3320
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3321
/*************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3322
/* B.1.4.2   Multi-element Variables */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3323
/*************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3324
multi_element_variable:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3325
  array_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3326
| structured_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3327
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3328
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3329
/* please see note above any_symbolic_variable */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3330
any_multi_element_variable:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3331
  any_array_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3332
| any_structured_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3333
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3334
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3335
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3336
array_variable:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3337
  subscripted_variable '[' subscript_list ']'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3338
	{$$ = new array_variable_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3339
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3340
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3341
/* please see note above any_symbolic_variable */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3342
any_array_variable:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3343
  any_subscripted_variable '[' subscript_list ']'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3344
	{$$ = new array_variable_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3345
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3346
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3347
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3348
subscripted_variable:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3349
  symbolic_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3350
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3351
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3352
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3353
/* please see note above any_symbolic_variable */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3354
any_subscripted_variable:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3355
  any_symbolic_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3356
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3357
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3358
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3359
subscript_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3360
  subscript
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3361
	{$$ = new subscript_list_c(locloc(@$)); $$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3362
| subscript_list ',' subscript
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3363
	{$$ = $1; $$->add_element($3);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3364
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3365
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3366
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3367
subscript:  expression;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3368
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3369
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3370
structured_variable:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3371
  record_variable '.' field_selector
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3372
	{$$ = new structured_variable_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3373
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3374
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3375
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3376
/* please see note above any_symbolic_variable */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3377
any_structured_variable:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3378
  any_record_variable '.' field_selector
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3379
	{$$ = new structured_variable_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3380
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3381
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3382
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3383
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3384
record_variable:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3385
  symbolic_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3386
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3387
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3388
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3389
/* please see note above any_symbolic_variable */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3390
any_record_variable:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3391
  any_symbolic_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3392
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3393
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3394
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3395
field_selector: any_identifier;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3396
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3397
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3398
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3399
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3400
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3401
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3402
/******************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3403
/* B 1.4.3 - Declaration & Initialisation */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3404
/******************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3405
input_declarations:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3406
  VAR_INPUT            input_declaration_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3407
	{$$ = new input_declarations_c(NULL, $2, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3408
| VAR_INPUT RETAIN     input_declaration_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3409
	{$$ = new input_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3410
| VAR_INPUT NON_RETAIN input_declaration_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3411
	{$$ = new input_declarations_c(new non_retain_option_c(locloc(@2)), $3, locloc(@$));}
95
b119b1db0a7a Changing format of error reporting.
mario
parents: 94
diff changeset
  3412
/* ERROR_CHECK_BEGIN */
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3413
| VAR_INPUT END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3414
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3415
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3416
	 print_err_msg(current_filename, locf(@1), locl(@2), "no variable declared in input variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3417
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3418
| VAR_INPUT RETAIN END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3419
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3420
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3421
	 print_err_msg(current_filename, locf(@2), locl(@3), "no variable declared in retentive input variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3422
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3423
| VAR_INPUT NON_RETAIN END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3424
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3425
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3426
	 print_err_msg(current_filename, locf(@2), locl(@3), "no variable declared in non-retentive input variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3427
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3428
| VAR_INPUT error input_declaration_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3429
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3430
	 print_err_msg(current_filename, locf(@1), locl(@3), "unexpected token after 'VAR_INPUT' in input variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3431
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3432
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3433
| VAR_INPUT RETAIN error input_declaration_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3434
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3435
	 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'RETAIN' in retentive input variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3436
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3437
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3438
| VAR_INPUT NON_RETAIN error input_declaration_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3439
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3440
	 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'NON_RETAIN' in non-retentive input variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3441
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3442
	}
95
b119b1db0a7a Changing format of error reporting.
mario
parents: 94
diff changeset
  3443
| VAR_INPUT error END_VAR
b119b1db0a7a Changing format of error reporting.
mario
parents: 94
diff changeset
  3444
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3445
	 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in input variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3446
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3447
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3448
| VAR_INPUT RETAIN error END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3449
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3450
	 print_err_msg(current_filename, locf(@2), locl(@4), "unknown error in retentive input variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3451
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3452
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3453
| VAR_INPUT NON_RETAIN error END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3454
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3455
	 print_err_msg(current_filename, locf(@2), locl(@4), "unknown error in non-retentive input variable(s) declaration.");
95
b119b1db0a7a Changing format of error reporting.
mario
parents: 94
diff changeset
  3456
	 yyerrok;
b119b1db0a7a Changing format of error reporting.
mario
parents: 94
diff changeset
  3457
	}
b119b1db0a7a Changing format of error reporting.
mario
parents: 94
diff changeset
  3458
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3459
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3460
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3461
/* helper symbol for input_declarations */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3462
input_declaration_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3463
  input_declaration ';'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3464
	{$$ = new input_declaration_list_c(locloc(@$)); $$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3465
| input_declaration_list input_declaration ';'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3466
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3467
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3468
| input_declaration error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3469
	{$$ = NULL;
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  3470
	 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at end of input variable(s) declaration.");
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3471
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3472
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3473
| input_declaration_list input_declaration error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3474
	{$$ = NULL;
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  3475
	 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at end of input variable(s) declaration.");
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  3476
	 yyerrok;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  3477
	}
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  3478
| input_declaration_list error ';'
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  3479
	{$$ = NULL;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  3480
	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid input variable(s) declaration.");
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3481
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3482
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3483
| input_declaration_list ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3484
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3485
	 yynerrs++;
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  3486
	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after input variable(s) declaration.");
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3487
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3488
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3489
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3490
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3491
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3492
input_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3493
  var_init_decl
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3494
| edge_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3495
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3496
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3497
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3498
edge_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3499
  var1_list ':' BOOL R_EDGE
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3500
	{$$ = new edge_declaration_c(new raising_edge_option_c(locloc(@3)), $1, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3501
| var1_list ':' BOOL F_EDGE
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3502
	{$$ = new edge_declaration_c(new falling_edge_option_c(locloc(@3)), $1, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3503
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3504
| var1_list BOOL R_EDGE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3505
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3506
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3507
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between variable list and specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3508
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3509
| var1_list BOOL F_EDGE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3510
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3511
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3512
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between variable list and specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3513
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3514
| var1_list ':' BOOL R_EDGE F_EDGE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3515
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3516
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3517
	 print_err_msg(current_filename, locf(@4), locl(@4), "'R_EDGE' and 'F_EDGE' can't be present at the same time in edge declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3518
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3519
| var1_list ':' R_EDGE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3520
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3521
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3522
	 print_err_msg(current_filename, locf(@2), locl(@2), "'BOOL' missing in edge declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3523
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3524
| var1_list ':' F_EDGE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3525
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3526
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3527
	 print_err_msg(current_filename, locf(@2), locl(@2), "'BOOL' missing in edge declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3528
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3529
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3530
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3531
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3532
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3533
var_init_decl:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3534
  var1_init_decl
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3535
| array_var_init_decl
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3536
| structured_var_init_decl
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3537
| fb_name_decl
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3538
| string_var_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3539
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3540
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3541
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3542
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3543
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3544
var1_init_decl:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3545
  var1_list ':' simple_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3546
	{$$ = new var1_init_decl_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3547
| var1_list ':' subrange_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3548
	{$$ = new var1_init_decl_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3549
| var1_list ':' enumerated_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3550
	{$$ = new var1_init_decl_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3551
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3552
| var1_list simple_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3553
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3554
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3555
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between variable list and simple specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3556
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3557
| var1_list subrange_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3558
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3559
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3560
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between variable list and subrange specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3561
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3562
| var1_list enumerated_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3563
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3564
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3565
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between variable list and enumerated specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3566
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3567
| var1_list ':' identifier
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3568
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3569
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3570
	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown variable type defined in variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3571
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3572
| var1_list ':' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3573
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3574
	 print_err_msg(current_filename, locf(@2), locl(@2), "no specification defined in variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3575
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3576
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3577
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3578
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3579
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3580
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3581
var1_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3582
  variable_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3583
	{$$ = new var1_list_c(locloc(@$)); $$->add_element($1);
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3584
	 variable_name_symtable.insert($1, prev_declared_variable_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3585
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3586
 | var1_list ',' variable_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3587
	{$$ = $1; $$->add_element($3);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3588
	 variable_name_symtable.insert($3, prev_declared_variable_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3589
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3590
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3591
| var1_list variable_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3592
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3593
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3594
	 print_err_msg(current_filename, locf(@2), locl(@2), "',' missing in variable list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3595
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3596
| var1_list ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3597
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3598
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3599
	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ',' in variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3600
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3601
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3602
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3603
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3604
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3605
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3606
array_var_init_decl:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3607
 var1_list ':' array_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3608
	{$$ = new array_var_init_decl_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3609
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3610
| var1_list array_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3611
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3612
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3613
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between variable list and array specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3614
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3615
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3616
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3617
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3618
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3619
structured_var_init_decl:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3620
  var1_list ':' initialized_structure
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3621
	{$$ = new structured_var_init_decl_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3622
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3623
| var1_list initialized_structure
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3624
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3625
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3626
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between variable list and structured specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3627
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3628
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3629
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3630
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3631
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3632
/* NOTE: see notes above fb_name_list and var1_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3633
 *       for reason why ':' was removed from this rule!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3634
 *       In essence, to remove a shift/reduce conflict,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3635
 *       the ':' was moved to var1_list and fb_name_list!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3636
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3637
fb_name_decl:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3638
/*  fb_name_list ':' function_block_type_name */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3639
  fb_name_list_with_colon function_block_type_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3640
	{$$ = new fb_name_decl_c($1, $2, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3641
/*| fb_name_list ':' function_block_type_name ASSIGN structure_initialization */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3642
| fb_name_list_with_colon function_block_type_name ASSIGN structure_initialization
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3643
	{$$ = new fb_name_decl_c($1, $2, $4, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3644
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3645
| fb_name_list_with_colon ASSIGN structure_initialization
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3646
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3647
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3648
	 print_err_msg(current_filename, locf(@2), locl(@2), "no function block type name defined in function block declaration with initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3649
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3650
| fb_name_list_with_colon function_block_type_name structure_initialization
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3651
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3652
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3653
	 print_err_msg(current_filename, locf(@2), locl(@2), "':=' missing in function block declaration with initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3654
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3655
| fb_name_list_with_colon function_block_type_name ASSIGN error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3656
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3657
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid initialization in function block declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3658
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3659
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3660
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3661
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3662
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3663
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3664
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3665
/* NOTE: In order to remove a reduce/reduce conflict between
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3666
 *       var1_list and fb_name_list, which are identical to each
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3667
 *       other, fb_name_list has been redefined to be a var1_list.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3668
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3669
 *        In order to remove a further shift/reduce conflict, var1_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3670
 *        is imediately transfomred into var1_list_with_colon
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3671
 *        (i.e. it includes the ':' following the list), which
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3672
 *        means that fb_name_list is built from a
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3673
 *        var1_list_with_colon after all!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3674
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3675
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3676
fb_name_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3677
 (*  fb_name *)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3678
  identifier
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3679
	{$$ = new fb_name_list_c($1);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3680
	 variable_name_symtable.insert($1, prev_declared_fb_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3681
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3682
(* | fb_name_list ',' fb_name *)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3683
| fb_name_list ',' identifier
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3684
	{$$ = $1; $$->add_element($3);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3685
	 variable_name_symtable.insert($3, prev_declared_fb_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3686
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3687
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3688
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3689
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3690
fb_name_list_with_colon:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3691
  var1_list_with_colon
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3692
	{$$ = new fb_name_list_c(locloc(@$));
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3693
	 /* fill up the new fb_name_list_c object with the references
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3694
	  * contained in the var1_list_c object.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3695
	  */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3696
	 FOR_EACH_ELEMENT(elem, $1, {$$->add_element(elem);});
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3697
	 delete $1;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3698
	 /* change the tokens associated with the symbols stored in
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3699
	  * the variable name symbol table from prev_declared_variable_name_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3700
	  * to prev_declared_fb_name_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3701
	  */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3702
	 FOR_EACH_ELEMENT(elem, $$, {variable_name_symtable.set(elem, prev_declared_fb_name_token);});
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3703
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3704
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3705
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3706
/* helper symbol for fb_name_list_with_colon */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3707
var1_list_with_colon:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3708
  var1_list ':'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3709
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3710
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3711
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3712
// fb_name: identifier;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3713
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3714
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3715
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3716
output_declarations:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3717
  VAR_OUTPUT var_init_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3718
	{$$ = new output_declarations_c(NULL, $2, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3719
| VAR_OUTPUT RETAIN var_init_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3720
	{$$ = new output_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3721
| VAR_OUTPUT NON_RETAIN var_init_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3722
	{$$ = new output_declarations_c(new non_retain_option_c(locloc(@2)), $3, locloc(@$));}
96
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3723
/* ERROR_CHECK_BEGIN */
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3724
| VAR_OUTPUT END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3725
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3726
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3727
	 print_err_msg(current_filename, locf(@1), locl(@2), "no variable declared in output variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3728
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3729
| VAR_OUTPUT RETAIN END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3730
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3731
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3732
	 print_err_msg(current_filename, locf(@2), locl(@3), "no variable declared in retentive output variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3733
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3734
| VAR_OUTPUT NON_RETAIN END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3735
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3736
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3737
	 print_err_msg(current_filename, locf(@2), locl(@3), "no variable declared in non-retentive output variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3738
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3739
| VAR_OUTPUT error var_init_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3740
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3741
	 print_err_msg(current_filename, locf(@1), locl(@3), "unexpected token after 'VAR_OUPUT' in output variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3742
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3743
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3744
| VAR_OUTPUT RETAIN error var_init_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3745
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3746
	 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'RETAIN' in retentive output variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3747
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3748
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3749
| VAR_OUTPUT NON_RETAIN error var_init_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3750
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3751
	 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'NON_RETAIN' in non-retentive output variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3752
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3753
	}
96
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3754
| VAR_OUTPUT error END_VAR
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3755
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3756
	 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in output variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3757
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3758
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3759
| VAR_OUTPUT RETAIN error END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3760
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3761
	 print_err_msg(current_filename, locf(@2), locl(@4), "unknown error in retentive output variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3762
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3763
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3764
| VAR_OUTPUT NON_RETAIN error END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3765
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3766
	 print_err_msg(current_filename, locf(@2), locl(@4), "unknown error in non-retentive output variable(s) declaration.");
96
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3767
	 yyerrok;
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3768
	}
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3769
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3770
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3771
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3772
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3773
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3774
input_output_declarations:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3775
  VAR_IN_OUT var_declaration_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3776
	{$$ = new input_output_declarations_c($2, locloc(@$));}
96
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3777
/* ERROR_CHECK_BEGIN */
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3778
| VAR_IN_OUT END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3779
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3780
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3781
	 print_err_msg(current_filename, locf(@1), locl(@2), "no variable declared in in_out variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3782
	}
96
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3783
| VAR_IN_OUT error END_VAR
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3784
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3785
	 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in in_out variable(s) declaration.");
96
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3786
	 yyerrok;
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3787
	}
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3788
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3789
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3790
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3791
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3792
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3793
/* helper symbol for input_output_declarations */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3794
var_declaration_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3795
  var_declaration ';'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3796
	{$$ = new var_declaration_list_c(locloc(@$)); $$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3797
| var_declaration_list var_declaration ';'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3798
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3799
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3800
| var_declaration error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3801
	{$$ = NULL;
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  3802
	 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at end of variable(s) declaration.");
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3803
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3804
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3805
| var_declaration_list var_declaration error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3806
	{$$ = NULL;
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  3807
	 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at end of variable(s) declaration.");
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  3808
	 yyerrok;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  3809
	}
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  3810
| var_declaration_list error ';'
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  3811
	{$$ = NULL;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  3812
	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid variable(s) declaration.");
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3813
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3814
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3815
| var_declaration_list ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3816
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3817
	 yynerrs++;
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  3818
	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after variable(s) declaration.");
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3819
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3820
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3821
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3822
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3823
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3824
var_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3825
  temp_var_decl
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3826
| fb_name_decl
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3827
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3828
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3829
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3830
temp_var_decl:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3831
  var1_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3832
| array_var_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3833
| structured_var_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3834
| string_var_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3835
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3836
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3837
var1_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3838
  var1_list  ':' simple_specification
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3839
	{$$ = new var1_init_decl_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3840
| var1_list  ':' subrange_specification
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3841
	{$$ = new var1_init_decl_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3842
| var1_list  ':' enumerated_specification
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3843
	{$$ = new var1_init_decl_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3844
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3845
| var1_list simple_specification
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3846
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3847
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3848
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between variable list and simple specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3849
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3850
| var1_list subrange_specification
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3851
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3852
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3853
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between variable list and subrange specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3854
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3855
| var1_list enumerated_specification
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3856
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3857
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3858
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between variable list and enumerated specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3859
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3860
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3861
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3862
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3863
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3864
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3865
array_var_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3866
  var1_list ':' array_specification
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3867
	{$$ = new array_var_declaration_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3868
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3869
| var1_list array_specification
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3870
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3871
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3872
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between variable list and array specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3873
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3874
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3875
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3876
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3877
structured_var_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3878
  var1_list ':' prev_declared_structure_type_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3879
	{$$ = new structured_var_declaration_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3880
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3881
| var1_list prev_declared_structure_type_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3882
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3883
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3884
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between variable list and structured specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3885
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3886
| var1_list ':' identifier
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3887
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3888
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3889
	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown type name in structured variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3890
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3891
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3892
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3893
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3894
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3895
var_declarations:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3896
  VAR var_init_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3897
	{$$ = new var_declarations_c(NULL, $2, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3898
| VAR CONSTANT var_init_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3899
	{$$ = new var_declarations_c(new constant_option_c(locloc(@2)), $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3900
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3901
| VAR END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3902
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3903
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3904
	 print_err_msg(current_filename, locf(@1), locl(@2), "no variable declared in variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3905
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3906
| VAR CONSTANT END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3907
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3908
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3909
	 print_err_msg(current_filename, locf(@2), locl(@3), "no variable declared in constant variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3910
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3911
| VAR error var_init_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3912
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3913
	 print_err_msg(current_filename, locf(@1), locl(@3), "unexpected token after 'VAR' in variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3914
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3915
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3916
| VAR CONSTANT error var_init_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3917
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3918
	 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'CONSTANT' in constant variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3919
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3920
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3921
| VAR error END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3922
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3923
	 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3924
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3925
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3926
| VAR CONSTANT error END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3927
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3928
	 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in constant variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3929
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3930
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3931
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3932
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3933
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3934
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3935
retentive_var_declarations:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3936
  VAR RETAIN var_init_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3937
	{$$ = new retentive_var_declarations_c($3, locloc(@$));}
96
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3938
/* ERROR_CHECK_BEGIN */
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3939
| VAR RETAIN END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3940
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3941
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3942
	 print_err_msg(current_filename, locf(@2), locl(@3), "no variable declared in retentive variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3943
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3944
| VAR RETAIN error var_init_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3945
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3946
	 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'RETAIN' in retentive variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3947
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3948
	}
96
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3949
| VAR RETAIN error END_VAR
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3950
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3951
	 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in retentive variable(s) declaration.");
96
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3952
	 yyerrok;
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3953
	}
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3954
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3955
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3956
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3957
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3958
located_var_declarations:
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3959
  VAR located_var_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3960
	{$$ = new located_var_declarations_c(NULL, $2, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3961
| VAR CONSTANT located_var_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3962
	{$$ = new located_var_declarations_c(new constant_option_c(locloc(@2)), $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3963
| VAR RETAIN located_var_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3964
	{$$ = new located_var_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3965
| VAR NON_RETAIN located_var_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3966
	{$$ = new located_var_declarations_c(new non_retain_option_c(locloc(@2)), $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3967
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3968
| VAR NON_RETAIN END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3969
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3970
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3971
	 print_err_msg(current_filename, locf(@2), locl(@3), "no variable declared in non-retentive located variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3972
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3973
| VAR error located_var_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3974
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3975
	 print_err_msg(current_filename, locf(@1), locl(@3), "unexpected token after 'VAR' in located variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3976
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3977
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3978
| VAR CONSTANT error located_var_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3979
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3980
	 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'CONSTANT' in constant located variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3981
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3982
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3983
| VAR RETAIN error located_var_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3984
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3985
	 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'RETAIN' in retentive located variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3986
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3987
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3988
| VAR NON_RETAIN error located_var_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3989
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3990
	 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'NON_RETAIN' in non-retentive located variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3991
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3992
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3993
| VAR NON_RETAIN error END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3994
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3995
	 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in non retentive variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3996
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3997
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3998
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3999
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4000
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4001
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4002
/* helper symbol for located_var_declarations */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4003
located_var_decl_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4004
  located_var_decl ';'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4005
	{$$ = new located_var_decl_list_c(locloc(@$)); $$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4006
| located_var_decl_list located_var_decl ';'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4007
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4008
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4009
| located_var_decl error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4010
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4011
	 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at end of located variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4012
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4013
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4014
| located_var_decl_list located_var_decl error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4015
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4016
	 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at end of located variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4017
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4018
	}
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4019
| located_var_decl_list error ';'
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4020
	{$$ = NULL;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4021
	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid located variable declaration.");
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4022
	 yyerrok;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4023
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4024
| located_var_decl_list ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4025
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4026
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4027
	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after located variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4028
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4029
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4030
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4031
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4032
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4033
located_var_decl:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4034
  variable_name location ':' located_var_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4035
	{$$ = new located_var_decl_c($1, $2, $4, locloc(@$));
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4036
	 variable_name_symtable.insert($1, prev_declared_variable_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4037
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4038
| location ':' located_var_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4039
	{$$ = new located_var_decl_c(NULL, $1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4040
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4041
| variable_name location located_var_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4042
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4043
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4044
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between located variable location and specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4045
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4046
| location located_var_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4047
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4048
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4049
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between located variable location and specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4050
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4051
| variable_name location ':' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4052
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4053
	 print_err_msg(current_filename, locf(@2), locl(@2), "no specification defined in located variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4054
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4055
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4056
| location ':' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4057
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4058
	 print_err_msg(current_filename, locf(@2), locl(@2), "no specification defined in located variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4059
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4060
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4061
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4062
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4063
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4064
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4065
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4066
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4067
external_var_declarations:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4068
  VAR_EXTERNAL external_declaration_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4069
	{$$ = new external_var_declarations_c(NULL, $2, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4070
| VAR_EXTERNAL CONSTANT external_declaration_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4071
	{$$ = new external_var_declarations_c(new constant_option_c(locloc(@2)), $3, locloc(@$));}
96
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  4072
/* ERROR_CHECK_BEGIN */
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4073
| VAR_EXTERNAL END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4074
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4075
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4076
	 print_err_msg(current_filename, locf(@1), locl(@2), "no variable declared in external variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4077
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4078
| VAR_EXTERNAL CONSTANT END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4079
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4080
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4081
	 print_err_msg(current_filename, locf(@1), locl(@3), "no variable declared in constant external variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4082
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4083
| VAR_EXTERNAL error external_declaration_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4084
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4085
	 print_err_msg(current_filename, locf(@1), locl(@4), "unexpected token after 'VAR_EXTERNAL' in external variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4086
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4087
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4088
| VAR_EXTERNAL CONSTANT error external_declaration_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4089
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4090
	 print_err_msg(current_filename, locf(@2), locl(@5), "unexpected token after 'CONSTANT' in constant external variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4091
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4092
	}
96
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  4093
| VAR_EXTERNAL error END_VAR
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  4094
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4095
	 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in external variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4096
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4097
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4098
| VAR_EXTERNAL CONSTANT error END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4099
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4100
	 print_err_msg(current_filename, locf(@2), locl(@4), "unknown error in constant external variable(s) declaration.");
96
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  4101
	 yyerrok;
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  4102
	}
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  4103
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4104
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4105
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4106
/* helper symbol for external_var_declarations */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4107
external_declaration_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4108
  external_declaration ';'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4109
	{$$ = new external_declaration_list_c(locloc(@$)); $$->add_element($1);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4110
| external_declaration_list external_declaration ';'
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4111
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4112
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4113
| external_declaration error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4114
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4115
	 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at end of external variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4116
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4117
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4118
| external_declaration_list external_declaration error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4119
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4120
	 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at end of external variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4121
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4122
	}
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4123
| external_declaration_list error ';'
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4124
	{$$ = NULL;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4125
	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid external variable declaration.");
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4126
	 yyerrok;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4127
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4128
| external_declaration_list ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4129
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4130
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4131
	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after external variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4132
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4133
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4134
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4135
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4136
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4137
external_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4138
  global_var_name ':' simple_specification
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4139
	{$$ = new external_declaration_c($1, $3, locloc(@$));
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4140
	 variable_name_symtable.insert($1, prev_declared_variable_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4141
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4142
| global_var_name ':' subrange_specification
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4143
	{$$ = new external_declaration_c($1, $3, locloc(@$));
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4144
	 variable_name_symtable.insert($1, prev_declared_variable_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4145
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4146
| global_var_name ':' enumerated_specification
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4147
	{$$ = new external_declaration_c($1, $3, locloc(@$));
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4148
	 variable_name_symtable.insert($1, prev_declared_variable_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4149
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4150
| global_var_name ':' array_specification
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4151
	{$$ = new external_declaration_c($1, $3, locloc(@$));
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4152
	 variable_name_symtable.insert($1, prev_declared_variable_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4153
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4154
| global_var_name ':' prev_declared_structure_type_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4155
	{$$ = new external_declaration_c($1, $3, locloc(@$));
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4156
	 variable_name_symtable.insert($1, prev_declared_variable_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4157
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4158
| global_var_name ':' function_block_type_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4159
	{$$ = new external_declaration_c($1, $3, locloc(@$));
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4160
	 variable_name_symtable.insert($1, prev_declared_fb_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4161
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4162
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4163
| global_var_name simple_specification
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4164
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4165
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4166
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between external variable name and simple specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4167
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4168
| global_var_name subrange_specification
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4169
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4170
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4171
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between external variable name and subrange specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4172
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4173
| global_var_name enumerated_specification
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4174
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4175
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4176
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between external variable name and enumerated specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4177
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4178
| global_var_name array_specification
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4179
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4180
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4181
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between external variable name and array specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4182
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4183
| global_var_name prev_declared_structure_type_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4184
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4185
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4186
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between external variable name and structured specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4187
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4188
| global_var_name function_block_type_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4189
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4190
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4191
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between external variable name and function block type specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4192
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4193
| global_var_name ':' identifier
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4194
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4195
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4196
	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown type name in external variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4197
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4198
| global_var_name ':' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4199
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4200
	 print_err_msg(current_filename, locf(@2), locl(@2), "no specification defined in external variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4201
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4202
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4203
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4204
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4205
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4206
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4207
global_var_name: identifier;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4208
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4209
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4210
global_var_declarations:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4211
  VAR_GLOBAL global_var_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4212
	{$$ = new global_var_declarations_c(NULL, $2, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4213
| VAR_GLOBAL CONSTANT global_var_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4214
	{$$ = new global_var_declarations_c(new constant_option_c(locloc(@2)), $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4215
| VAR_GLOBAL RETAIN global_var_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4216
	{$$ = new global_var_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));}
96
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  4217
/* ERROR_CHECK_BEGIN */
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4218
| VAR_GLOBAL END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4219
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4220
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4221
	 print_err_msg(current_filename, locf(@1), locl(@2), "no variable declared in global variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4222
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4223
| VAR_GLOBAL CONSTANT END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4224
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4225
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4226
	 print_err_msg(current_filename, locf(@2), locl(@3), "no variable declared in constant global variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4227
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4228
| VAR_GLOBAL RETAIN END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4229
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4230
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4231
	 print_err_msg(current_filename, locf(@2), locl(@3), "no variable declared in retentive global variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4232
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4233
| VAR_GLOBAL error global_var_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4234
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4235
	 print_err_msg(current_filename, locf(@1), locl(@3), "unexpected token after 'VAR_GLOBAL' in global variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4236
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4237
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4238
| VAR_GLOBAL CONSTANT error global_var_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4239
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4240
	 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'CONSTANT' in constant global variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4241
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4242
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4243
| VAR_GLOBAL RETAIN error global_var_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4244
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4245
	 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'RETAIN' in retentive global variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4246
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4247
	}
96
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  4248
| VAR_GLOBAL error END_VAR
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  4249
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4250
	 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in global variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4251
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4252
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4253
| VAR_GLOBAL CONSTANT error END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4254
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4255
	 print_err_msg(current_filename, locf(@2), locl(@4), "unknown error in constant global variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4256
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4257
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4258
| VAR_GLOBAL RETAIN error END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4259
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4260
	 print_err_msg(current_filename, locf(@2), locl(@4), "unknown error in constant global variable(s) declaration.");
96
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  4261
	 yyerrok;
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  4262
	}
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  4263
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4264
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4265
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4266
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4267
/* helper symbol for global_var_declarations */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4268
global_var_decl_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4269
  global_var_decl ';'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4270
	{$$ = new global_var_decl_list_c(locloc(@$)); $$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4271
| global_var_decl_list global_var_decl ';'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4272
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4273
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4274
| global_var_decl error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4275
	{$$ = NULL;
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4276
	 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at end of global variable(s) declaration.");
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4277
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4278
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4279
| global_var_decl_list global_var_decl error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4280
	{$$ = NULL;
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4281
	 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at end of global variable(s) declaration.");
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4282
	 yyerrok;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4283
	}
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4284
| global_var_decl_list error ';'
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4285
	{$$ = NULL;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4286
	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid global variable(s) declaration.");
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4287
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4288
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4289
| global_var_decl_list ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4290
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4291
	 yynerrs++;
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4292
	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after global variable(s) declaration.");
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4293
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4294
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4295
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4296
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4297
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4298
global_var_decl:
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4299
/* NOTE : This possibility defined in standard has no sense and generate a conflict (disabled)
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4300
  global_var_spec ':'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4301
	{$$ = new global_var_decl_c($1, NULL, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4302
*/
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4303
  global_var_spec ':' located_var_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4304
	{$$ = new global_var_decl_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4305
| global_var_spec ':' function_block_type_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4306
	{$$ = new global_var_decl_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4307
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4308
| global_var_list located_var_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4309
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4310
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4311
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between global variable list and type specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4312
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4313
| global_var_name location located_var_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4314
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4315
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4316
	 print_err_msg(current_filename, locf(@3), locl(@3), "':' missing between global variable specification and type specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4317
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4318
| global_var_spec function_block_type_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4319
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4320
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4321
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between global variable specification and function block type specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4322
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4323
| global_var_spec ':' identifier
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4324
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4325
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4326
	 print_err_msg(current_filename, locf(@3), locl(@3), "unknown variable type defined in global variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4327
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4328
| global_var_spec ':' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4329
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4330
	 print_err_msg(current_filename, locf(@2), locl(@2), "no specification defined in global variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4331
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4332
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4333
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4334
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4335
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4336
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4337
global_var_spec:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4338
  global_var_list	{$$ = $1;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4339
| location
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4340
	{$$ = new global_var_spec_c(NULL, $1, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4341
| global_var_name location
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4342
	{$$ = new global_var_spec_c($1, $2, locloc(@$));
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4343
	 variable_name_symtable.insert($1, prev_declared_global_var_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4344
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4345
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4346
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4347
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4348
located_var_spec_init:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4349
  simple_spec_init
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4350
| subrange_spec_init
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4351
| enumerated_spec_init
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4352
| array_spec_init
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4353
| initialized_structure
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4354
| single_byte_string_spec
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4355
| double_byte_string_spec
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4356
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4357
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4358
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4359
location:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4360
  AT direct_variable
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4361
	{$$ = new location_c($2, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4362
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4363
| AT error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4364
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4365
	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid location in location declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4366
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4367
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4368
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4369
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4370
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4371
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4372
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4373
global_var_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4374
  global_var_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4375
	{$$ = new global_var_list_c(locloc(@$)); $$->add_element($1);
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4376
	 variable_name_symtable.insert($1, prev_declared_global_var_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4377
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4378
| global_var_list ',' global_var_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4379
	{$$ = $1; $$->add_element($3);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4380
	 variable_name_symtable.insert($3, prev_declared_global_var_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4381
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4382
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4383
| global_var_list global_var_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4384
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4385
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4386
	 print_err_msg(current_filename, locf(@2), locl(@2), "',' missing in global variable list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4387
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4388
| global_var_list ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4389
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4390
	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ',' in global variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4391
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4392
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4393
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4394
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4395
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4396
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4397
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4398
string_var_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4399
  single_byte_string_var_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4400
| double_byte_string_var_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4401
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4402
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4403
single_byte_string_var_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4404
  var1_list ':' single_byte_string_spec
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4405
	{$$ = new single_byte_string_var_declaration_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4406
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4407
| var1_list single_byte_string_spec
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4408
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4409
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4410
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between variable list and string type specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4411
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4412
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4413
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4414
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4415
/* NOTE: The constructs
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4416
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4417
 *       [W]STRING
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4418
 *       and
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4419
 *       [W]STRING ASSIGN single_byte_character_string
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4420
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4421
 *       were removed as they are already contained
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4422
 *       within a other constructs.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4423
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4424
 *       single_byte_string_spec is used in:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4425
 *        - single_byte_string_var_declaration ->
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4426
 *           -> string_var_declaration ---> var_init_decl
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4427
 *                                     |--> temp_var_decl
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4428
 *                                     |--> var2_init_decl
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4429
 *        - located_var_spec_init
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4430
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4431
 *       STRING [ASSIGN string_constant] -> elementary_string_type_name ->
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4432
 *        -> simple_spec -> simple_specification -> simple_spec_init ->
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4433
 *        -> located_var_spec_init
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4434
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4435
 *       STRING [ASSIGN string_constant] -> elementary_string_type_name ->
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4436
 *        -> simple_spec -> simple_specification -> simple_spec_init ->
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4437
 *        -> var1_init_decl -> var_init_decl
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4438
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4439
 *       STRING [ASSIGN string_constant] -> elementary_string_type_name ->
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4440
 *        -> simple_spec -> simple_specification -> simple_spec_init ->
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4441
 *        -> var1_init_decl -> var2_init_decl
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4442
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4443
 *       STRING [ASSIGN string_constant] -> elementary_string_type_name ->
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4444
 *        -> simple_spec -> simple_specification ->
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4445
 *        -> var1_declaration -> temp_var_decl
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4446
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4447
single_byte_string_spec:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4448
/*  STRING
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4449
	{$$ = new single_byte_string_spec_c(NULL, NULL);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4450
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4451
  STRING '[' integer ']'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4452
	{$$ = new single_byte_string_spec_c($3, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4453
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4454
| STRING ASSIGN single_byte_character_string
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4455
	{$$ = new single_byte_string_spec_c(NULL, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4456
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4457
| STRING '[' integer ']' ASSIGN single_byte_character_string
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4458
	{$$ = new single_byte_string_spec_c($3, $6, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4459
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4460
| STRING '[' error ']'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4461
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4462
	 print_err_msg(current_filename, locf(@2), locl(@4), "invalid length value for limited string type specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4463
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4464
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4465
| STRING '[' error ']' ASSIGN single_byte_character_string
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4466
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4467
	 print_err_msg(current_filename, locf(@2), locl(@4), "invalid length value for limited string type specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4468
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4469
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4470
| STRING '[' ']'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4471
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4472
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4473
	 print_err_msg(current_filename, locf(@2), locl(@3), "missing length value for limited string type specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4474
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4475
| STRING '[' ']' ASSIGN single_byte_character_string
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4476
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4477
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4478
	 print_err_msg(current_filename, locf(@2), locl(@3), "missing length value for limited string type specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4479
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4480
| STRING '[' integer error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4481
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4482
	 print_err_msg(current_filename, locf(@3), locl(@3), "expecting ']' after length definition for limited string type specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4483
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4484
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4485
| STRING '[' integer error ASSIGN single_byte_character_string
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4486
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4487
	 print_err_msg(current_filename, locf(@3), locl(@5), "expecting ']' after length definition for limited string type specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4488
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4489
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4490
| STRING '[' integer ']' single_byte_character_string
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4491
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4492
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4493
	 print_err_msg(current_filename, locf(@4), locl(@5), "':=' missing before limited string type initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4494
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4495
| STRING '[' integer ']' ASSIGN error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4496
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4497
	 print_err_msg(current_filename, locf(@5), locl(@5), "invalid value for limited string type initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4498
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4499
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4500
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4501
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4502
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4503
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4504
double_byte_string_var_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4505
  var1_list ':' double_byte_string_spec
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4506
	{$$ = new double_byte_string_var_declaration_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4507
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4508
| var1_list double_byte_string_spec
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4509
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4510
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4511
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between variable list and double byte string type specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4512
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4513
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4514
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4515
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4516
double_byte_string_spec:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4517
/*  WSTRING
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4518
	{$$ = new double_byte_string_spec_c(NULL, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4519
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4520
  WSTRING '[' integer ']'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4521
	{$$ = new double_byte_string_spec_c($3, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4522
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4523
| WSTRING ASSIGN double_byte_character_string
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4524
	{$$ = new double_byte_string_spec_c(NULL, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4525
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4526
| WSTRING '[' integer ']' ASSIGN double_byte_character_string
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4527
	{$$ = new double_byte_string_spec_c($3, $6, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4528
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4529
| WSTRING '[' error ']'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4530
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4531
	 print_err_msg(current_filename, locf(@2), locl(@4), "invalid length value for limited double byte string type specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4532
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4533
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4534
| WSTRING '[' error ']' ASSIGN single_byte_character_string
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4535
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4536
	 print_err_msg(current_filename, locf(@2), locl(@4), "invalid length value for limited double byte string type specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4537
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4538
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4539
| WSTRING '[' ']'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4540
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4541
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4542
	 print_err_msg(current_filename, locf(@2), locl(@3), "missing length value for limited double byte string type specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4543
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4544
| WSTRING '[' ']' ASSIGN single_byte_character_string
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4545
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4546
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4547
	 print_err_msg(current_filename, locf(@2), locl(@3), "missing length value for limited double byte string type specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4548
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4549
| WSTRING '[' integer error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4550
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4551
	 print_err_msg(current_filename, locf(@3), locl(@3), "expecting ']' after length definition for limited double byte string type specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4552
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4553
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4554
| WSTRING '[' integer error ASSIGN single_byte_character_string
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4555
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4556
	 print_err_msg(current_filename, locf(@3), locl(@5), "expecting ']' after length definition for limited double byte string type specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4557
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4558
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4559
| WSTRING '[' integer ']' single_byte_character_string
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4560
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4561
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4562
	 print_err_msg(current_filename, locf(@4), locl(@5), "':=' missing before limited double byte string type initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4563
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4564
| WSTRING '[' integer ']' ASSIGN error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4565
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4566
	 print_err_msg(current_filename, locf(@5), locl(@5), "invalid value for limited double byte string type initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4567
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4568
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4569
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4570
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4571
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4572
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4573
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4574
incompl_located_var_declarations:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4575
  VAR            incompl_located_var_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4576
	{$$ = new incompl_located_var_declarations_c(NULL, $2, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4577
| VAR     RETAIN incompl_located_var_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4578
	{$$ = new incompl_located_var_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4579
| VAR NON_RETAIN incompl_located_var_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4580
	{$$ = new incompl_located_var_declarations_c(new non_retain_option_c(locloc(@2)), $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4581
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4582
| VAR error incompl_located_var_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4583
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4584
	 print_err_msg(current_filename, locf(@1), locl(@3), "unexpected token after 'VAR' in incomplete located variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4585
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4586
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4587
| VAR RETAIN error incompl_located_var_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4588
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4589
	 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'RETAIN' in retentive located variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4590
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4591
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4592
| VAR NON_RETAIN error incompl_located_var_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4593
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4594
	 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'NON_RETAIN' in non-retentive located variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4595
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4596
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4597
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4598
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4599
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4600
/* helper symbol for incompl_located_var_declarations */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4601
incompl_located_var_decl_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4602
  incompl_located_var_decl ';'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4603
	{$$ = new incompl_located_var_decl_list_c(locloc(@$)); $$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4604
| incompl_located_var_decl_list incompl_located_var_decl ';'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4605
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4606
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4607
| incompl_located_var_decl error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4608
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4609
	 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at end of incomplete located variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4610
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4611
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4612
| incompl_located_var_decl_list incompl_located_var_decl error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4613
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4614
	 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at end of incomplete located variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4615
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4616
	}
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4617
| incompl_located_var_decl_list error ';'
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4618
	{$$ = NULL;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4619
	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid incomplete located variable declaration.");
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4620
	 yyerrok;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4621
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4622
| incompl_located_var_decl_list ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4623
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4624
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4625
	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after incomplete located variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4626
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4627
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4628
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4629
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4630
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4631
incompl_located_var_decl:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4632
  variable_name incompl_location ':' var_spec
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4633
	{$$ = new incompl_located_var_decl_c($1, $2, $4, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4634
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4635
| variable_name incompl_location ':' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4636
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4637
	 print_err_msg(current_filename, locf(@2), locl(@2), "no specification defined in incomplete located variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4638
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4639
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4640
| variable_name incompl_location var_spec
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4641
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4642
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4643
	 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between incomplete located variable and type specification.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4644
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4645
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4646
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4647
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4648
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4649
incompl_location:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4650
  AT incompl_location_token
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4651
	{$$ = new incompl_location_c($2, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4652
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4653
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4654
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4655
var_spec:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4656
  simple_specification
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4657
| subrange_specification
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4658
| enumerated_specification
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4659
| array_specification
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4660
| prev_declared_structure_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4661
| string_spec
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4662
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4663
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4664
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4665
/* helper symbol for var_spec */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4666
/* NOTE: The constructs
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4667
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4668
 *       STRING
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4669
 *       and
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4670
 *       WSTRING
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4671
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4672
 *       were removed as they are already contained
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4673
 *       within a simple_specification.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4674
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4675
string_spec:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4676
/*  STRING
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4677
	{$$ = new single_byte_string_spec_c(NULL, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4678
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4679
  STRING '[' integer ']'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4680
	{$$ = new single_byte_string_spec_c($3, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4681
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4682
| WSTRING
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4683
	{$$ = new double_byte_string_spec_c(NULL, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4684
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4685
| WSTRING '[' integer ']'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4686
	{$$ = new double_byte_string_spec_c($3, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4687
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4688
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4689
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4690
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4691
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4692
/* intermediate helper symbol for:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4693
 *  - non_retentive_var_decls
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4694
 *  - output_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4695
 *  - var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4696
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4697
var_init_decl_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4698
  var_init_decl ';'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4699
	{$$ = new var_init_decl_list_c(locloc(@$)); $$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4700
| var_init_decl_list var_init_decl ';'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4701
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4702
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4703
| var_init_decl_list var_init_decl error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4704
	{$$ = NULL;
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4705
	 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at end of variable(s) declaration.");
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4706
	 yyerrok;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4707
	}
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4708
| var_init_decl_list error ';'
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4709
	{$$ = NULL;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  4710
	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid variable(s) declaration.");
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4711
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4712
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4713
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4714
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4715
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4716
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4717
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4718
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4719
/***********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4720
/* B 1.5.1 - Functions */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4721
/***********************/
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4722
/*
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4723
function_name:
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4724
  prev_declared_derived_function_name
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4725
| standard_function_name 
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4726
;
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4727
*/
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4728
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4729
/* The following rules should be set such as:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4730
 * function_name: function_name_no_clashes | function_name_simpleop_clashes | function_name_expression_clashes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4731
 * function_name: function_name_no_NOT_clashes | function_name_NOT_clashes;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4732
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4733
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4734
function_name_no_clashes: prev_declared_derived_function_name | standard_function_name_no_clashes;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4735
function_name_simpleop_clashes: standard_function_name_simpleop_clashes;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4736
//function_name_expression_clashes: standard_function_name_expression_clashes;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4737
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4738
function_name_no_NOT_clashes: prev_declared_derived_function_name | standard_function_name_no_NOT_clashes;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4739
//function_name_NOT_clashes: standard_function_name_NOT_clashes;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4740
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4741
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4742
/* NOTE: The list of standard function names
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4743
 *       includes the standard functions MOD(), NOT()
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4744
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4745
 *       Strangely enough, MOD and NOT are reserved keywords,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4746
 *       so shouldn't be used for function names.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4747
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4748
 *       The specification contradicts itself!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4749
 *       Our workaround  is to treat MOD as a token,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4750
 *       but to include this token as a
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4751
 *       standard_function_name.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4752
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4753
 *       The names of all other standard functions get
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4754
 *       preloaded into the library_element_symbol_table
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4755
 *       with the token value of
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4756
 *       standard_function_name_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4757
 *       Actually, simply for completeness, MOD is also
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4758
 *       loaded into the library_element_symbol_table, but
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4759
 *       it is irrelevant since flex will catch MOD as a
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4760
 *       token, before it interprets it as an identifier,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4761
 *       and looks in the library_element_symbol_table to check
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4762
 *       whether it has been previously declared.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4763
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4764
 * NOTE: The same as the above also occurs with the IL
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4765
 *       operators NOT AND OR XOR ADD SUB MUL DIV MOD
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4766
 *       GT GE EQ LT LE NE.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4767
 *       Note that MOD is once again in the list!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4768
 *       Anyway, we give these the same treatement as
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4769
 *       MOD, since we are writing a parser for ST and
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4770
 *       IL simultaneously. If this were not the case,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4771
 *       the ST parser would not need the tokens NOT AND ...
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4772
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4773
 * NOTE: Note that 'NOT' is special, as it conflicts
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4774
 *       with two operators: the  IL 'NOT' operator, and
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4775
 *       the unary operator 'NOT' in ST!!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4776
 *
78
aead91ec37cd removing 'identifier' from definition of symbolic_variable
mario
parents: 77
diff changeset
  4777
 * NOTE: The IL language is ambiguous, since using NOT, AND, ...
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4778
 *       may be interpreted as either an IL operator, or
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4779
 *       as a standard function call!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4780
 *       I (Mario) opted to interpret it as an IL operator.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4781
 *       This requires changing the syntax for IL language
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4782
 *       function   calling, to exclude all function with
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4783
 *       names that clash with IL operators. I therefore
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4784
 *       created the constructs
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4785
 *       function_name_without_clashes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4786
 *       standard_function_name_without_clashes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4787
 *       to include all function names, except those that clash
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4788
 *       with IL operators. These constructs are only used
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4789
 *       within the IL language!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4790
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4791
/* The following rules should be set such as:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4792
 * standard_function_name: standard_function_name_no_clashes | standard_function_name_simpleop_clashes | standard_function_name_expression_clashes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4793
 * standard_function_name: standard_function_name_no_NOT_clashes | standard_function_name_NOT_clashes;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4794
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4795
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4796
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4797
standard_function_name:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4798
  standard_function_name_no_clashes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4799
| standard_function_name_expression_clashes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4800
| standard_function_name_NOT_clashes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4801
//| standard_function_name_simpleop_only_clashes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4802
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4803
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4804
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4805
standard_function_name_no_NOT_clashes:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4806
  standard_function_name_no_clashes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4807
| standard_function_name_expression_clashes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4808
//| standard_function_name_simpleop_only_clashes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4809
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4810
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4811
standard_function_name_no_clashes:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4812
  standard_function_name_token
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4813
	{$$ = new identifier_c($1, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4814
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4815
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4816
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4817
standard_function_name_simpleop_clashes:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4818
  standard_function_name_NOT_clashes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4819
//| standard_function_name_simpleop_only_clashes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4820
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4821
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4822
standard_function_name_NOT_clashes:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4823
  NOT
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4824
	{$$ = new identifier_c(strdup("NOT"), locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4825
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4826
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4827
/* Add here any other IL simple operators that collide
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4828
 * with standard function names!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4829
 * Don't forget to uncomment the equivalent lines in
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4830
 *   - standard_function_name_simpleop_clashes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4831
 *   - standard_function_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4832
 *   - standard_function_name_no_NOT_clashes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4833
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4834
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4835
standard_function_name_simpleop_only_clashes:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4836
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4837
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4838
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4839
standard_function_name_expression_clashes:
91
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4840
  AND	{$$ = new identifier_c(strdup("AND"), locloc(@$));}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4841
| OR	{$$ = new identifier_c(strdup("OR"), locloc(@$));}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4842
| XOR	{$$ = new identifier_c(strdup("XOR"), locloc(@$));}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4843
| ADD	{$$ = new identifier_c(strdup("ADD"), locloc(@$));}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4844
| SUB	{$$ = new identifier_c(strdup("SUB"), locloc(@$));}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4845
| MUL	{$$ = new identifier_c(strdup("MUL"), locloc(@$));}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4846
| DIV	{$$ = new identifier_c(strdup("DIV"), locloc(@$));}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4847
| MOD	{$$ = new identifier_c(strdup("MOD"), locloc(@$));}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4848
| GT	{$$ = new identifier_c(strdup("GT"), locloc(@$));}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4849
| GE	{$$ = new identifier_c(strdup("GE"), locloc(@$));}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4850
| EQ	{$$ = new identifier_c(strdup("EQ"), locloc(@$));}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4851
| LT	{$$ = new identifier_c(strdup("LT"), locloc(@$));}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4852
| LE	{$$ = new identifier_c(strdup("LE"), locloc(@$));}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4853
| NE	{$$ = new identifier_c(strdup("NE"), locloc(@$));}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4854
/*
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4855
  AND_operator	{$$ = il_operator_c_2_identifier_c($1);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4856
//NOTE: AND2 (corresponding to the source code string '&') does not clash
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4857
//      with a standard function name, so should be commented out!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4858
//| AND2_operator	{$$ = il_operator_c_2_identifier_c($1);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4859
| OR_operator	{$$ = il_operator_c_2_identifier_c($1);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4860
| XOR_operator	{$$ = il_operator_c_2_identifier_c($1);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4861
| ADD_operator	{$$ = il_operator_c_2_identifier_c($1);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4862
| SUB_operator	{$$ = il_operator_c_2_identifier_c($1);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4863
| MUL_operator	{$$ = il_operator_c_2_identifier_c($1);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4864
| DIV_operator	{$$ = il_operator_c_2_identifier_c($1);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4865
| MOD_operator	{$$ = il_operator_c_2_identifier_c($1);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4866
| GT_operator	{$$ = il_operator_c_2_identifier_c($1);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4867
| GE_operator	{$$ = il_operator_c_2_identifier_c($1);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4868
| EQ_operator	{$$ = il_operator_c_2_identifier_c($1);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4869
| LT_operator	{$$ = il_operator_c_2_identifier_c($1);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4870
| LE_operator	{$$ = il_operator_c_2_identifier_c($1);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4871
| NE_operator	{$$ = il_operator_c_2_identifier_c($1);}
91
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4872
*/
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4873
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4874
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4875
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4876
derived_function_name:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4877
  identifier
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4878
| prev_declared_derived_function_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4879
	{$$ = $1;
77
fe4ecf7efa79 adding some comments.
mario
parents: 75
diff changeset
  4880
	 if (not(allow_function_overloading)) {
fe4ecf7efa79 adding some comments.
mario
parents: 75
diff changeset
  4881
	   fprintf(stderr, "Function overloading not allowed. Invalid identifier %s\n", ((token_c *)($1))->value);
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4882
	   ERROR;
77
fe4ecf7efa79 adding some comments.
mario
parents: 75
diff changeset
  4883
	 }
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4884
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4885
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4886
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4887
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4888
function_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4889
/*  FUNCTION derived_function_name ':' elementary_type_name io_OR_function_var_declarations_list function_body END_FUNCTION */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4890
  function_name_declaration ':' elementary_type_name io_OR_function_var_declarations_list function_body END_FUNCTION
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4891
	{$$ = new function_declaration_c($1, $3, $4, $5, locloc(@$));
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4892
	 variable_name_symtable.pop();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4893
	 if (allow_function_overloading) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4894
	   switch (library_element_symtable.find_value($1)) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4895
	     case prev_declared_derived_function_name_token:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4896
	       /* do nothing, already in map. */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4897
	       break;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4898
	     case BOGUS_TOKEN_ID:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4899
	       /* Not yet in map. Must insert...*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4900
	       library_element_symtable.insert($1, prev_declared_derived_function_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4901
	       break;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4902
	     default:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4903
	       /* Already in map but associated with something else other than a funtion name! */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4904
	       ERROR;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4905
	   }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4906
	 } else {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4907
	   library_element_symtable.insert($1, prev_declared_derived_function_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4908
	 }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4909
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4910
/* | FUNCTION derived_function_name ':' derived_type_name io_OR_function_var_declarations_list function_body END_FUNCTION */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4911
| function_name_declaration ':' derived_type_name io_OR_function_var_declarations_list function_body END_FUNCTION
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4912
	{$$ = new function_declaration_c($1, $3, $4, $5, locloc(@$));
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4913
	 variable_name_symtable.pop();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4914
	 if (allow_function_overloading) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4915
	   switch (library_element_symtable.find_value($1)) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4916
	     case prev_declared_derived_function_name_token: /* do nothing, already in map. */ break;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4917
	     case BOGUS_TOKEN_ID: library_element_symtable.insert($1, prev_declared_derived_function_name_token); break;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4918
	     default: ERROR;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4919
	   }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4920
	 } else {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4921
	   library_element_symtable.insert($1, prev_declared_derived_function_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4922
	 }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4923
	}
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4924
/* ERROR_CHECK_BEGIN */
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4925
| function_name_declaration elementary_type_name io_OR_function_var_declarations_list function_body END_FUNCTION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4926
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4927
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4928
	 print_err_msg(current_filename, locf(@1), locl(@2), "':' missing after function name in function declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4929
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4930
| function_name_declaration derived_type_name io_OR_function_var_declarations_list function_body END_FUNCTION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4931
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4932
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4933
	 print_err_msg(current_filename, locf(@1), locl(@2), "':' missing after function name in function declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4934
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4935
| function_name_declaration error derived_type_name io_OR_function_var_declarations_list function_body END_FUNCTION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4936
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4937
	 print_err_msg(current_filename, locf(@1), locl(@3), "expecting ':' after function name in function declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4938
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4939
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4940
| function_name_declaration ':' io_OR_function_var_declarations_list function_body END_FUNCTION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4941
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4942
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4943
	 print_err_msg(current_filename, locf(@2), locl(@3), "no return type defined in function declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4944
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4945
| function_name_declaration ':' error io_OR_function_var_declarations_list function_body END_FUNCTION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4946
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4947
	 print_err_msg(current_filename, locf(@2), locl(@4), "invalid return type defined in function declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4948
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4949
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4950
| function_name_declaration ':' identifier io_OR_function_var_declarations_list function_body END_FUNCTION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4951
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4952
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4953
	 print_err_msg(current_filename, locf(@2), locl(@4), "unknown return type defined in function declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4954
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4955
| function_name_declaration ':' elementary_type_name function_body END_FUNCTION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4956
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4957
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4958
	 print_err_msg(current_filename, locf(@3), locl(@4), "no variable(s) declared in function declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4959
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4960
| function_name_declaration ':' derived_type_name function_body END_FUNCTION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4961
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4962
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4963
	 print_err_msg(current_filename, locf(@3), locl(@4), "no variable(s) declared in function declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4964
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4965
| function_name_declaration ':' elementary_type_name io_OR_function_var_declarations_list END_FUNCTION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4966
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4967
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4968
	 print_err_msg(current_filename, locf(@4), locl(@5), "no body defined in function declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4969
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4970
| function_name_declaration ':' derived_type_name io_OR_function_var_declarations_list END_FUNCTION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4971
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4972
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4973
	 print_err_msg(current_filename, locf(@4), locl(@5), "no body defined in function declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4974
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4975
| function_name_declaration ':' elementary_type_name END_FUNCTION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4976
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4977
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4978
	 print_err_msg(current_filename, locf(@3), locl(@4), "no variable(s) declared and body defined in function declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4979
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4980
| function_name_declaration ':' derived_type_name END_FUNCTION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4981
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4982
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4983
	 print_err_msg(current_filename, locf(@3), locl(@4), "no variable(s) declared and body defined in function declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4984
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4985
| function_name_declaration error END_FUNCTION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4986
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4987
	 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in function declaration.");
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4988
	 yyerrok;
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4989
	}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4990
/* ERROR_CHECK_END */
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4991
;
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4992
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4993
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4994
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4995
/* helper symbol for function_declaration */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4996
/* NOTE: due to reduce/reduce conflicts between identifiers
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4997
 *       being reduced to either a variable or an enumerator value,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4998
 *       we were forced to keep a symbol table of the names
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4999
 *       of all declared variables. Variables are no longer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5000
 *       created from simple identifier_token, but from
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5001
 *       prev_declared_variable_name_token.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5002
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5003
 *       BUT, in functions the function name itself may be used as
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5004
 *       a variable! In order to be able to parse this correctly,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5005
 *       the token parser (flex) must return a prev_declared_variable_name_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5006
 *       when it comes across the function name, while parsing
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5007
 *       the function itself.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5008
 *       We do this by inserting the function name into the variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5009
 *       symbol table, and having flex return a prev_declared_variable_name_token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5010
 *       whenever it comes across it.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5011
 *       When we finish parsing the function the variable name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5012
 *       symbol table is cleared of all entries, and the function
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5013
 *       name is inserted into the library element symbol table. This
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5014
 *       means that from then onwards flex will return a
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5015
 *       derived_function_name_token whenever it comes across the
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5016
 *       function name.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5017
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5018
 *       In order to insert the function name into the variable_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5019
 *       symbol table BEFORE the function body gets parsed, we
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5020
 *       need the parser to reduce a construct that contains the
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5021
 *       the function name. That is why we created this extra
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5022
 *       construct (function_name_declaration), i.e. to force
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5023
 *       the parser to reduce it, before parsing the function body!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5024
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5025
function_name_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5026
  FUNCTION derived_function_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5027
	{$$ = $2;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5028
	 /* the function name functions as a
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5029
	  * variable within the function itself!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5030
	  *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5031
	  * Remember that the variable_name_symtable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5032
	  * is cleared once the end of the function
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5033
	  * is parsed.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5034
	  */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5035
	 variable_name_symtable.insert($2, prev_declared_variable_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5036
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5037
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5038
| FUNCTION error 
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5039
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5040
	 print_err_msg(current_filename, locf(@1), locl(@1), "no function name defined in function declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5041
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5042
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5043
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5044
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5045
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5046
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5047
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5048
/* intermediate helper symbol for function_declaration */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5049
io_OR_function_var_declarations_list:
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5050
  io_var_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5051
  {$$ = new var_declarations_list_c(locloc(@1));$$->add_element($1);}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5052
| function_var_decls
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5053
	{$$ = new var_declarations_list_c(locloc(@1));$$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5054
| io_OR_function_var_declarations_list io_var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5055
	{$$ = $1; $$->add_element($2);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5056
| io_OR_function_var_declarations_list function_var_decls
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5057
	{$$ = $1; $$->add_element($2);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5058
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5059
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5060
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5061
io_var_declarations:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5062
  input_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5063
| output_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5064
| input_output_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5065
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5066
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5067
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5068
function_var_decls:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5069
  VAR CONSTANT var2_init_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5070
	{$$ = new function_var_decls_c(new constant_option_c(locloc(@2)), $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5071
| VAR var2_init_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5072
	{$$ = new function_var_decls_c(NULL, $2, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5073
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5074
| VAR error var_init_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5075
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5076
	 print_err_msg(current_filename, locf(@1), locl(@3), "unexpected token after 'VAR' in function variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5077
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5078
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5079
| VAR CONSTANT error var_init_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5080
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5081
	 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'CONSTANT' in constant function variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5082
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5083
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5084
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5085
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5086
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5087
/* intermediate helper symbol for function_var_decls */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5088
var2_init_decl_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5089
  var2_init_decl ';'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5090
	{$$ = new var2_init_decl_list_c(locloc(@$)); $$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5091
| var2_init_decl_list var2_init_decl ';'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5092
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5093
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5094
| var2_init_decl error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5095
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5096
	 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at end of function variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5097
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5098
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5099
| var2_init_decl_list var2_init_decl error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5100
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5101
	 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at end of function variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5102
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5103
	}
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  5104
| var2_init_decl_list error ';'
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  5105
	{$$ = NULL;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  5106
	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid function variable(s) declaration.");
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  5107
	 yyerrok;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  5108
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5109
| var2_init_decl_list ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5110
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5111
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5112
	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after function variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5113
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5114
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5115
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5116
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5117
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5118
function_body:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5119
  statement_list	{$$ = $1;} /* if we leave it for the default action we get a type clash! */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5120
| instruction_list	{$$ = $1;} /* if we leave it for the default action we get a type clash! */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5121
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5122
| ladder_diagram
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5123
| function_block_diagram
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5124
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5125
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5126
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5127
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5128
var2_init_decl:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5129
  var1_init_decl
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5130
| array_var_init_decl
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5131
| structured_var_init_decl
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5132
| string_var_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5133
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5134
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5135
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5136
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5137
/*****************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5138
/* B 1.5.2 - Function Blocks */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5139
/*****************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5140
function_block_type_name:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5141
  prev_declared_derived_function_block_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5142
| standard_function_block_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5143
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5144
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5145
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5146
standard_function_block_name: standard_function_block_name_token {$$ = new identifier_c($1, locloc(@$));};
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5147
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5148
derived_function_block_name: identifier;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5149
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5150
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5151
function_block_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5152
  FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations_list function_block_body END_FUNCTION_BLOCK
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5153
	{$$ = new function_block_declaration_c($2, $3, $4, locloc(@$));
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5154
	 library_element_symtable.insert($2, prev_declared_derived_function_block_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5155
	 /* Clear the variable_name_symtable. Since
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5156
	  * we have finished parsing the function block,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5157
	  * the variable names are now out of scope, so
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5158
	  * are no longer valid!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5159
	  */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5160
	 variable_name_symtable.pop();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5161
	}
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5162
/* ERROR_CHECK_BEGIN */
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5163
| FUNCTION_BLOCK io_OR_other_var_declarations_list function_block_body END_FUNCTION_BLOCK
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5164
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5165
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5166
	 print_err_msg(current_filename, locf(@1), locl(@2), "no function block name defined in function block declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5167
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5168
| FUNCTION_BLOCK error io_OR_other_var_declarations_list function_block_body END_FUNCTION_BLOCK
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5169
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5170
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid function block name in function block declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5171
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5172
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5173
| FUNCTION_BLOCK derived_function_block_name function_block_body END_FUNCTION_BLOCK
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5174
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5175
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5176
	 print_err_msg(current_filename, locf(@2), locl(@3), "no variable(s) declared in function declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5177
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5178
| FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations_list END_FUNCTION_BLOCK
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5179
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5180
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5181
	 print_err_msg(current_filename, locf(@3), locl(@4), "no body defined in function block declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5182
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5183
| FUNCTION_BLOCK derived_function_block_name END_FUNCTION_BLOCK
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5184
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5185
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5186
	 print_err_msg(current_filename, locf(@2), locl(@3), "no variable(s) declared and body defined in function block declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5187
	}
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5188
| FUNCTION_BLOCK error END_FUNCTION_BLOCK
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5189
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5190
	 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in function block declaration.");
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5191
	 yyerrok;
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5192
	}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5193
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5194
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5195
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5196
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5197
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5198
/* intermediate helper symbol for function_declaration */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5199
/*  { io_var_declarations | other_var_declarations }   */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5200
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5201
 * NOTE: we re-use the var_declarations_list_c
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5202
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5203
io_OR_other_var_declarations_list:
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5204
  io_var_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5205
  {$$ = new var_declarations_list_c(locloc(@$));$$->add_element($1);}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5206
| other_var_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5207
  {$$ = new var_declarations_list_c(locloc(@$));$$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5208
| io_OR_other_var_declarations_list io_var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5209
	{$$ = $1; $$->add_element($2);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5210
| io_OR_other_var_declarations_list other_var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5211
	{$$ = $1; $$->add_element($2);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5212
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5213
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5214
/* NOTE:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5215
 *  The IEC specification gives the following definition:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5216
 *  other_var_declarations ::=
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5217
 *     external_var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5218
 *   | var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5219
 *   | retentive_var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5220
 *   | non_retentive_var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5221
 *   | temp_var_decls
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5222
 *   | incompl_located_var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5223
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5224
 *  Nvertheless, the symbol non_retentive_var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5225
 *  is not defined in the spec. This seems to me (Mario)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5226
 *  to be a typo, so non_retentive_var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5227
 *  has been replaced with non_retentive_var_decls
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5228
 *  in the following rule!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5229
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5230
other_var_declarations:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5231
  temp_var_decls
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5232
| non_retentive_var_decls
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5233
| external_var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5234
| var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5235
| retentive_var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5236
| incompl_located_var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5237
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5238
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5239
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5240
temp_var_decls:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5241
  VAR_TEMP temp_var_decls_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5242
	{$$ = new temp_var_decls_c($2, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5243
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5244
| VAR_TEMP END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5245
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5246
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5247
	 print_err_msg(current_filename, locf(@1), locl(@2), "no variable declared in temporary variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5248
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5249
| VAR_TEMP error temp_var_decls_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5250
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5251
	 print_err_msg(current_filename, locf(@1), locl(@3), "unexpected token after 'VAR_TEMP' in function variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5252
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5253
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5254
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5255
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5256
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5257
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5258
/* intermediate helper symbol for temp_var_decls */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5259
temp_var_decls_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5260
  temp_var_decl ';'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5261
	{$$ = new temp_var_decls_list_c(locloc(@$)); $$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5262
| temp_var_decls_list temp_var_decl ';'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5263
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5264
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5265
| temp_var_decl error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5266
	{$$ = NULL;
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  5267
	 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at end of temporary variable(s) declaration.");
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5268
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5269
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5270
| temp_var_decls_list temp_var_decl error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5271
	{$$ = NULL;
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  5272
	 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at end of temporary variable(s) declaration.");
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  5273
	 yyerrok;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  5274
	}
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  5275
| temp_var_decls_list error ';'
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  5276
	{$$ = NULL;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  5277
	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid temporary variable(s) declaration.");
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5278
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5279
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5280
| temp_var_decls_list ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5281
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5282
	 yynerrs++;
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  5283
	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after temporary variable(s) declaration.");
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5284
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5285
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5286
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5287
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5288
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5289
non_retentive_var_decls:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5290
  VAR NON_RETAIN var_init_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5291
	{$$ = new non_retentive_var_decls_c($3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5292
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5293
| VAR NON_RETAIN error var_init_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5294
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5295
	 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'NON_RETAIN' in non-retentive temporary variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5296
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5297
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5298
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5299
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5300
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5301
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5302
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5303
function_block_body:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5304
  statement_list	{$$ = $1;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5305
| instruction_list	{$$ = $1;}
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5306
| sequential_function_chart	{$$ = $1;}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5307
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5308
| ladder_diagram
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5309
| function_block_diagram
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5310
| <other languages>
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5311
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5312
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5313
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5314
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5315
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5316
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5317
/**********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5318
/* B 1.5.3 - Programs */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5319
/**********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5320
program_type_name: identifier;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5321
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5322
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5323
program_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5324
  PROGRAM program_type_name program_var_declarations_list function_block_body END_PROGRAM
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5325
	{$$ = new program_declaration_c($2, $3, $4, locloc(@$));
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5326
	 library_element_symtable.insert($2, prev_declared_program_type_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5327
	 /* Clear the variable_name_symtable. Since
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5328
	  * we have finished parsing the program declaration,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5329
	  * the variable names are now out of scope, so
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5330
	  * are no longer valid!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5331
	  */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5332
	 variable_name_symtable.pop();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5333
	}
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5334
/* ERROR_CHECK_BEGIN */
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5335
| PROGRAM program_var_declarations_list function_block_body END_PROGRAM
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5336
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5337
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5338
	 print_err_msg(current_filename, locf(@1), locl(@2), "no program name defined in program declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5339
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5340
| PROGRAM error program_var_declarations_list function_block_body END_PROGRAM
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5341
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5342
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid program name in program declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5343
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5344
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5345
| PROGRAM program_type_name function_block_body END_PROGRAM
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5346
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5347
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5348
	 print_err_msg(current_filename, locf(@2), locl(@3), "no variable(s) declared in program declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5349
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5350
| PROGRAM program_type_name program_var_declarations_list END_PROGRAM
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5351
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5352
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5353
	 print_err_msg(current_filename, locf(@3), locl(@4), "no body defined in program declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5354
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5355
| PROGRAM program_type_name END_PROGRAM
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5356
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5357
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5358
	 print_err_msg(current_filename, locf(@2), locl(@3), "no variable(s) declared and body defined in program declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5359
	}
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5360
| PROGRAM error END_PROGRAM
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5361
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5362
	 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in program declaration.");
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5363
	 yyerrok;
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5364
	}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5365
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5366
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5367
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5368
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5369
/* helper symbol for program_declaration */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5370
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5371
 * NOTE: we re-use the var_declarations_list_c
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5372
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5373
program_var_declarations_list:
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5374
  io_var_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5375
	{$$ = new var_declarations_list_c(locloc(@$)); $$->add_element($1);}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5376
| other_var_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5377
	{$$ = new var_declarations_list_c(locloc(@$)); $$->add_element($1);}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5378
| located_var_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5379
	{$$ = new var_declarations_list_c(locloc(@$)); $$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5380
| program_var_declarations_list io_var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5381
	{$$ = $1; $$->add_element($2);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5382
| program_var_declarations_list other_var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5383
	{$$ = $1; $$->add_element($2);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5384
| program_var_declarations_list located_var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5385
	{$$ = $1; $$->add_element($2);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5386
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5387
| program_var_declarations_list program_access_decls
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5388
	{$$ = $1; $$->add_element($2);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5389
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5390
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5391
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5392
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5393
/* TODO ... */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5394
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5395
program_access_decls:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5396
  VAR_ACCESS program_access_decl_list END_VAR
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5397
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5398
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5399
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5400
/* helper symbol for program_access_decls */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5401
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5402
program_access_decl_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5403
  program_access_decl ';'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5404
| program_access_decl_list program_access_decl ';'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5405
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5406
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5407
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5408
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5409
program_access_decl:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5410
  access_name ':' symbolic_variable ':' non_generic_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5411
| access_name ':' symbolic_variable ':' non_generic_type_name direction
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5412
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5413
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5414
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5415
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5416
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5417
/********************************************/
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5418
/* B 1.6 Sequential Function Chart elements *
3
38850ee685e6 ST and IL parsing added into flex-bison analyser
lbessard
parents: 1
diff changeset
  5419
/********************************************/
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5420
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5421
sequential_function_chart:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5422
  sfc_network
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5423
	{$$ = new sequential_function_chart_c(locloc(@$)); $$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5424
| sequential_function_chart sfc_network
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5425
	{$$ = $1; $$->add_element($2);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5426
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5427
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5428
sfc_network:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5429
  initial_step
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5430
	{$$ = new sfc_network_c(locloc(@$)); $$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5431
| sfc_network step
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5432
	{$$ = $1; $$->add_element($2);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5433
| sfc_network transition
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5434
	{$$ = $1; $$->add_element($2);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5435
| sfc_network action
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5436
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5437
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5438
| sfc_network error 
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5439
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5440
	 print_err_msg(current_filename, locf(@1), locl(@1), "unexpected token after SFC network in sequencial function chart.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5441
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5442
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5443
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5444
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5445
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5446
initial_step:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5447
  INITIAL_STEP step_name ':' action_association_list END_STEP
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  5448
//  INITIAL_STEP identifier ':' action_association_list END_STEP
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5449
	{$$ = new initial_step_c($2, $4, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5450
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5451
| INITIAL_STEP ':' action_association_list END_STEP
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5452
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5453
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5454
	 print_err_msg(current_filename, locf(@1), locl(@2), "no step name defined in initial step declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5455
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5456
| INITIAL_STEP error ':' action_association_list END_STEP
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5457
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5458
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid step name defined in initial step declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5459
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5460
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5461
| INITIAL_STEP step_name action_association_list END_STEP
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5462
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5463
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5464
	 print_err_msg(current_filename, locf(@2), locl(@3), "':' missing after step name in initial step declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5465
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5466
| INITIAL_STEP step_name error action_association_list END_STEP
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5467
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5468
	 print_err_msg(current_filename, locf(@2), locl(@4), "expecting ':' after step name in initial step declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5469
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5470
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5471
| INITIAL_STEP step_name ':' error END_STEP
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5472
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5473
	 print_err_msg(current_filename, locf(@2), locl(@4), "invalid action association list in initial step declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5474
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5475
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5476
| INITIAL_STEP error END_STEP
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5477
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5478
	 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in initial step declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5479
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5480
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5481
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5482
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5483
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5484
step:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5485
  STEP step_name ':' action_association_list END_STEP
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  5486
//  STEP identifier ':' action_association_list END_STEP
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5487
	{$$ = new step_c($2, $4, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5488
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5489
| STEP ':' action_association_list END_STEP
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5490
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5491
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5492
	 print_err_msg(current_filename, locf(@1), locl(@2), "no step name defined in step declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5493
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5494
| STEP error ':' action_association_list END_STEP
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5495
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5496
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid step name defined in step declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5497
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5498
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5499
| STEP step_name action_association_list END_STEP
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5500
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5501
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5502
	 print_err_msg(current_filename, locf(@2), locl(@3), "':' missing after step name in step declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5503
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5504
| STEP step_name error action_association_list END_STEP
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5505
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5506
	 print_err_msg(current_filename, locf(@2), locl(@4), "expecting ':' after step name in step declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5507
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5508
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5509
| STEP step_name ':' error END_STEP
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5510
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5511
	 print_err_msg(current_filename, locf(@2), locl(@4), "invalid action association list in step declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5512
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5513
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5514
| STEP error END_STEP
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5515
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5516
	 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in step declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5517
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5518
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5519
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5520
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5521
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5522
/* helper symbol for:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5523
 *  - initial_step
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5524
 *  - step
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5525
 */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5526
action_association_list:
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5527
  /* empty */
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5528
	{$$ = new action_association_list_c(locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5529
| action_association_list action_association ';'
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5530
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5531
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5532
| action_association_list action_association error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5533
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5534
	 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at end of action association declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5535
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5536
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5537
| action_association_list ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5538
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5539
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5540
	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after action association declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5541
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5542
/* ERROR_CHECK_END */
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5543
;
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5544
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5545
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  5546
// step_name: identifier;
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  5547
step_name: any_identifier;
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5548
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5549
action_association:
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5550
  action_name '(' {cmd_goto_sfc_qualifier_state()} action_qualifier {cmd_pop_state()} indicator_name_list ')'
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5551
	{$$ = new action_association_c($1, $4, $6, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5552
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5553
/*| action_name '(' error indicator_name_list ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5554
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5555
	 print_err_msg(current_filename, locf(@2), locl(@4), "invalid qualifier defined in action association.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5556
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5557
	}*/
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5558
/* ERROR_CHECK_END */
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5559
;
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5560
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5561
/* helper symbol for action_association */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5562
indicator_name_list:
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5563
  /* empty */
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5564
	{$$ = new indicator_name_list_c(locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5565
| indicator_name_list ',' indicator_name
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5566
	{$$ = $1; $$->add_element($3);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5567
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5568
| indicator_name_list indicator_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5569
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5570
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5571
	 print_err_msg(current_filename, locf(@1), locl(@1), "',' missing at end of action association declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5572
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5573
| indicator_name_list ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5574
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5575
	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected token after ',' in indicator list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5576
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5577
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5578
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5579
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5580
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  5581
// action_name: identifier;
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  5582
action_name: any_identifier;
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5583
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5584
action_qualifier:
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5585
  /* empty */
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5586
	{$$ = NULL;}
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5587
| qualifier
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5588
	{$$ = new action_qualifier_c($1, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5589
| timed_qualifier ',' action_time
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5590
	{$$ = new action_qualifier_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5591
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5592
| timed_qualifier action_time
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5593
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5594
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5595
	 print_err_msg(current_filename, locf(@1), locl(@1), "',' missing between timed qualifier and action time in action qualifier.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5596
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5597
| timed_qualifier ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5598
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5599
	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected token after ',' in action qualifier.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5600
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5601
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5602
/* ERROR_CHECK_END */
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5603
;
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5604
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5605
qualifier:
94
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  5606
  N		{$$ = new qualifier_c(strdup("N"), locloc(@$));}
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5607
| R		{$$ = new qualifier_c(strdup("R"), locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5608
| S		{$$ = new qualifier_c(strdup("S"), locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5609
| P		{$$ = new qualifier_c(strdup("P"), locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5610
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5611
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5612
timed_qualifier:
94
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  5613
  L		{$$ = new timed_qualifier_c(strdup("L"), locloc(@$));}
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5614
| D		{$$ = new timed_qualifier_c(strdup("D"), locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5615
| SD		{$$ = new timed_qualifier_c(strdup("SD"), locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5616
| DS		{$$ = new timed_qualifier_c(strdup("DS"), locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5617
| SL		{$$ = new timed_qualifier_c(strdup("SL"), locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5618
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5619
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5620
action_time:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5621
  duration
10
66f4f7f85d0a generate_iec completed
lbessard
parents: 5
diff changeset
  5622
| variable
66f4f7f85d0a generate_iec completed
lbessard
parents: 5
diff changeset
  5623
;
66f4f7f85d0a generate_iec completed
lbessard
parents: 5
diff changeset
  5624
66f4f7f85d0a generate_iec completed
lbessard
parents: 5
diff changeset
  5625
indicator_name: variable;
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5626
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  5627
// transition_name: identifier;
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  5628
transition_name: any_identifier;
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  5629
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5630
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5631
steps:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5632
  step_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5633
	{$$ = new steps_c($1, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5634
| '(' step_name_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5635
	{$$ = new steps_c(NULL, $2, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5636
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5637
| '(' step_name_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5638
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5639
	 print_err_msg(current_filename, locf(@2), locl(@2), "expecting ')' at the end of step list in transition declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5640
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5641
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5642
| '(' error ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5643
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5644
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid step list in transition declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5645
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5646
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5647
/* ERROR_CHECK_END */
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5648
;
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5649
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5650
step_name_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5651
  step_name ',' step_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5652
	{$$ = new step_name_list_c(locloc(@$)); $$->add_element($1); $$->add_element($3);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5653
| step_name_list ',' step_name
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5654
	{$$ = $1; $$->add_element($3);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5655
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5656
| step_name_list step_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5657
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5658
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5659
	 print_err_msg(current_filename, locf(@1), locl(@2), "',' missing in step list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5660
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5661
| step_name_list ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5662
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5663
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid step name in step list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5664
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5665
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5666
/* ERROR_CHECK_END */
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5667
;
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5668
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  5669
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5670
/* NOTE: flex will automatically pop() out of body_state to previous state.
94
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  5671
 *       We do not need to give a command from bison to return to previous flex state,
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  5672
 *       after forcing flex to go to body_state.
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5673
 */
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5674
transition:
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5675
  TRANSITION transition_priority
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5676
    FROM steps TO steps 
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5677
    {cmd_goto_body_state();} transition_condition 
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5678
  END_TRANSITION 
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5679
	{$$ = new transition_c(NULL, $2, $4, $6, $8, locloc(@$));}
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5680
//| TRANSITION identifier FROM steps TO steps ... 
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5681
| TRANSITION transition_name transition_priority
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5682
    FROM steps TO steps 
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5683
    {cmd_goto_body_state();} transition_condition 
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5684
  END_TRANSITION 
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5685
	{$$ = new transition_c($2, $3, $5, $7, $9, locloc(@$));}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5686
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5687
| TRANSITION error transition_priority FROM steps TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5688
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5689
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid transition name defined in transition declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5690
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5691
	} 
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5692
| TRANSITION transition_name error FROM steps TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5693
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5694
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid transition priority defined in transition declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5695
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5696
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5697
| TRANSITION transition_priority FROM TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5698
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5699
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5700
	 print_err_msg(current_filename, locf(@3), locl(@4), "no origin step(s) defined in transition declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5701
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5702
| TRANSITION transition_name transition_priority FROM TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5703
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5704
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5705
	 print_err_msg(current_filename, locf(@4), locl(@5), "no origin step(s) defined in transition declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5706
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5707
| TRANSITION transition_priority FROM error TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5708
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5709
	 print_err_msg(current_filename, locf(@3), locl(@5), "invalid origin step(s) defined in transition declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5710
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5711
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5712
| TRANSITION transition_name transition_priority FROM error TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5713
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5714
	 print_err_msg(current_filename, locf(@4), locl(@6), "invalid origin step(s) defined in transition declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5715
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5716
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5717
| TRANSITION transition_priority FROM steps steps {cmd_goto_body_state();} transition_condition END_TRANSITION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5718
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5719
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5720
	 print_err_msg(current_filename, locf(@4), locl(@5), "'TO' missing between origin step(s) and destination step(s) in transition declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5721
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5722
| TRANSITION transition_name transition_priority FROM steps steps {cmd_goto_body_state();} transition_condition END_TRANSITION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5723
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5724
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5725
	 print_err_msg(current_filename, locf(@5), locl(@6), "'TO' missing between origin step(s) and destination step(s) in transition declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5726
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5727
| TRANSITION transition_priority FROM steps error steps {cmd_goto_body_state();} transition_condition END_TRANSITION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5728
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5729
	 print_err_msg(current_filename, locf(@4), locl(@6), "expecting 'TO' between origin step(s) and destination step(s) in transition declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5730
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5731
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5732
| TRANSITION transition_name transition_priority FROM steps error steps {cmd_goto_body_state();} transition_condition END_TRANSITION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5733
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5734
	 print_err_msg(current_filename, locf(@5), locl(@7), "expecting 'TO' between origin step(s) and destination step(s) in transition declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5735
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5736
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5737
| TRANSITION transition_priority FROM steps TO {cmd_goto_body_state();} transition_condition END_TRANSITION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5738
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5739
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5740
	 print_err_msg(current_filename, locf(@5), locl(@7), "no destination step(s) defined in transition declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5741
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5742
| TRANSITION transition_name transition_priority FROM steps TO {cmd_goto_body_state();} transition_condition END_TRANSITION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5743
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5744
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5745
	 print_err_msg(current_filename, locf(@6), locl(@8), "no destination step(s) defined in transition declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5746
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5747
| TRANSITION transition_priority FROM steps TO error {cmd_goto_body_state();} transition_condition END_TRANSITION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5748
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5749
	 print_err_msg(current_filename, locf(@5), locl(@8), "invalid destination step(s) defined in transition declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5750
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5751
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5752
| TRANSITION transition_name transition_priority FROM steps TO error {cmd_goto_body_state();} transition_condition END_TRANSITION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5753
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5754
	 print_err_msg(current_filename, locf(@6), locl(@9), "invalid destination step(s) defined in transition declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5755
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5756
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5757
| TRANSITION transition_priority {cmd_goto_body_state();} transition_condition END_TRANSITION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5758
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5759
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5760
	 print_err_msg(current_filename, locf(@2), locl(@4), "no origin and destination step(s) defined in transition declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5761
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5762
| TRANSITION transition_name transition_priority {cmd_goto_body_state();} transition_condition END_TRANSITION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5763
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5764
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5765
	 print_err_msg(current_filename, locf(@3), locl(@5), "no origin and destination step(s) defined in transition declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5766
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5767
| TRANSITION error END_TRANSITION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5768
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5769
	 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in transition declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5770
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5771
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5772
/* ERROR_CHECK_END */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5773
;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5774
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5775
transition_priority:
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5776
  /* empty */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5777
  {$$ = NULL;}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5778
| '(' {cmd_goto_sfc_priority_state();} PRIORITY {cmd_pop_state();} ASSIGN integer ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5779
	{$$ = $6;}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5780
;
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5781
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5782
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5783
transition_condition:
10
66f4f7f85d0a generate_iec completed
lbessard
parents: 5
diff changeset
  5784
  ':' eol_list simple_instr_list
88
dab799d3d4a6 Adding location data to new transition_condition_c.
mario
parents: 87
diff changeset
  5785
	{$$ = new transition_condition_c($3, NULL, locloc(@$));}
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5786
| ASSIGN expression ';'
88
dab799d3d4a6 Adding location data to new transition_condition_c.
mario
parents: 87
diff changeset
  5787
	{$$ = new transition_condition_c(NULL, $2, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5788
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5789
| eol_list simple_instr_list
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5790
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5791
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5792
	 print_err_msg(current_filename, locf(@1), locl(@1), "':' missing before IL condition in transition declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5793
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5794
| ':' eol_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5795
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5796
	 print_err_msg(current_filename, locf(@2), locl(@2), "no instructions defined in IL condition of transition declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5797
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5798
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5799
| ASSIGN ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5800
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5801
	 print_err_msg(current_filename, locf(@2), locl(@2), "no expression defined in ST condition of transition declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5802
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5803
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5804
| ASSIGN error ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5805
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5806
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid expression defined in ST condition of transition declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5807
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5808
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5809
| ASSIGN expression error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5810
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5811
	 print_err_msg(current_filename, locf(@2), locl(@2), "expecting ';' after expression defined in ST condition of transition declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5812
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5813
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5814
/* ERROR_CHECK_END */
10
66f4f7f85d0a generate_iec completed
lbessard
parents: 5
diff changeset
  5815
;
3
38850ee685e6 ST and IL parsing added into flex-bison analyser
lbessard
parents: 1
diff changeset
  5816
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5817
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5818
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5819
action:
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5820
//  ACTION identifier ':' ... 
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5821
  ACTION action_name ':' {cmd_goto_body_state();} function_block_body END_ACTION
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5822
	{$$ = new action_c($2, $5, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5823
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5824
| ACTION ':' {cmd_goto_body_state();} function_block_body END_ACTION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5825
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5826
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5827
	 print_err_msg(current_filename, locf(@1), locl(@2), "no action name defined in action declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5828
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5829
| ACTION error ':' {cmd_goto_body_state();} function_block_body END_ACTION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5830
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5831
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid action name defined in action declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5832
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5833
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5834
| ACTION action_name {cmd_goto_body_state();} function_block_body END_ACTION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5835
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5836
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5837
	 print_err_msg(current_filename, locf(@2), locl(@4), "':' missing after action name in action declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5838
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5839
| ACTION action_name ':' END_ACTION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5840
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5841
	 print_err_msg(current_filename, locf(@3), locl(@4), "no body defined in action declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5842
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5843
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5844
| ACTION error END_ACTION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5845
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5846
	 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in action declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5847
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5848
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5849
/* ERROR_CHECK_END */
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5850
;
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5851
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5852
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5853
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5854
/* B 1.7 Configuration elements */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5855
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5856
/* NOTE:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5857
 * It is not clear from reading the specification to which namespace
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5858
 * the names of resources, tasks and programs belong to.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5859
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5860
 * The following syntax assumes that resource and program names belong to the
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5861
 * same namespace as the variables defined within
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5862
 * the resource/configuration (i.e. VAR_GLOBAL).
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5863
 * Task names belong to a namespace all of their own, since they don't
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5864
 * produce conflicts in the syntax parser, so we might just as well
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5865
 * leave them be! ;-)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5866
 * The above decision was made taking into
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5867
 * account that inside a VAR_CONFIG declaration global variables
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5868
 * may be referenced starting off from the resource name as:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5869
 *   resource_name.program_name.variable_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5870
 * Notice how resource names and program names are used in a very similar
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5871
 * manner as are variable names.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5872
 * Using a single namespace for all the above mentioned names
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5873
 * also makes it easier to write the syntax parser!! ;-) Using a private
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5874
 * namespace for each of the name types (resource names, program names,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5875
 * global varaiable names), i.e. letting the names be re-used across
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5876
 * each of the groups (resource, program, global variables), produces
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5877
 * reduce/reduce conflicts in the syntax parser. Actually, it is only
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5878
 * the resource names that need to be distinguished into a 
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5879
 * prev_declared_resource_name so as not to conflict with [gloabl] variable
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5880
 * names in the 'data' construct.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5881
 * The program names are only tracked to make sure that two programs do not
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5882
 * get the same name.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5883
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5884
 * Using a single namespace does have the drawback that the user will
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5885
 * not be able to re-use names for resources or programs if these
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5886
 * have already been used to name a variable!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5887
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5888
 * If it ever becomes necessary to change this interpretation of
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5889
 * the syntax, then this section of the syntax parser must be updated!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5890
 */
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5891
prev_declared_global_var_name: prev_declared_global_var_name_token {$$ = new identifier_c($1, locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5892
prev_declared_resource_name: prev_declared_resource_name_token {$$ = new identifier_c($1, locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5893
prev_declared_program_name: prev_declared_program_name_token {$$ = new identifier_c($1, locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5894
// prev_declared_task_name: prev_declared_task_name_token {$$ = new identifier_c($1, locloc(@$));};
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5895
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5896
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5897
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5898
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5899
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5900
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5901
configuration_name: identifier;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5902
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5903
/* NOTE: The specification states that valid resource type names
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5904
 *       are implementation defined, i.e. each implementaion will define
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5905
 *       what resource types it supports.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5906
 *       We are implementing this syntax parser to be used by any
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5907
 *       implementation, so at the moment we accept any identifier
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5908
 *       as a resource type name.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5909
 *       This implementation should probably be changed in the future. We
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5910
 *       should probably have a resource_type_name_token, and let the
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5911
 *       implementation load the global symbol library with the
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5912
 *       accepted resource type names before parsing the code.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5913
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5914
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5915
resource_type_name: any_identifier;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5916
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5917
configuration_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5918
  CONFIGURATION configuration_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5919
   optional_global_var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5920
   single_resource_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5921
   {variable_name_symtable.pop();}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5922
   optional_access_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5923
   optional_instance_specific_initializations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5924
  END_CONFIGURATION
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5925
	{$$ = new configuration_declaration_c($2, $3, $4, $6, $7, locloc(@$));
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5926
	 library_element_symtable.insert($2, prev_declared_configuration_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5927
	 variable_name_symtable.pop();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5928
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5929
| CONFIGURATION configuration_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5930
   optional_global_var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5931
   resource_declaration_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5932
   optional_access_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5933
   optional_instance_specific_initializations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5934
 END_CONFIGURATION
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5935
	{$$ = new configuration_declaration_c($2, $3, $4, $5, $6, locloc(@$));
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5936
	 library_element_symtable.insert($2, prev_declared_configuration_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5937
	 variable_name_symtable.pop();
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5938
}
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5939
/* ERROR_CHECK_BEGIN */
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5940
| CONFIGURATION 
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5941
   optional_global_var_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5942
   single_resource_declaration
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5943
   {variable_name_symtable.pop();}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5944
   optional_access_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5945
   optional_instance_specific_initializations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5946
  END_CONFIGURATION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5947
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5948
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5949
	 print_err_msg(current_filename, locf(@1), locl(@2), "no configuration name defined in configuration declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5950
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5951
| CONFIGURATION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5952
   optional_global_var_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5953
   resource_declaration_list
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5954
   optional_access_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5955
   optional_instance_specific_initializations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5956
  END_CONFIGURATION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5957
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5958
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5959
	 print_err_msg(current_filename, locf(@1), locl(@2), "no configuration name defined in configuration declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5960
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5961
| CONFIGURATION error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5962
   optional_global_var_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5963
   single_resource_declaration
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5964
   {variable_name_symtable.pop();}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5965
   optional_access_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5966
   optional_instance_specific_initializations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5967
  END_CONFIGURATION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5968
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5969
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid configuration name defined in configuration declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5970
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5971
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5972
| CONFIGURATION error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5973
   optional_global_var_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5974
   resource_declaration_list
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5975
   optional_access_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5976
   optional_instance_specific_initializations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5977
  END_CONFIGURATION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5978
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5979
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid configuration name defined in configuration declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5980
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5981
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5982
| CONFIGURATION configuration_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5983
   optional_global_var_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5984
   optional_access_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5985
   optional_instance_specific_initializations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5986
  END_CONFIGURATION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5987
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5988
	 print_err_msg(current_filename, locf(@1), locl(@2), "no resource(s) defined in configuration declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5989
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5990
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5991
| CONFIGURATION configuration_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5992
   optional_global_var_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5993
   error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5994
   optional_access_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5995
   optional_instance_specific_initializations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5996
  END_CONFIGURATION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5997
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5998
	 print_err_msg(current_filename, locf(@1), locl(@2), "invalid resource(s) defined in configuration declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5999
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6000
	}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6001
| CONFIGURATION error END_CONFIGURATION
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6002
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6003
	 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in configuration declaration.");
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6004
	 yyerrok;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6005
	}
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6006
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6007
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6008
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6009
// helper symbol for
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6010
//  - configuration_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6011
//  - resource_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6012
//
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6013
optional_global_var_declarations:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6014
  // empty
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6015
	{$$ = NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6016
| global_var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6017
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6018
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6019
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6020
// helper symbol for configuration_declaration //
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6021
optional_access_declarations:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6022
  // empty
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6023
	{$$ = NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6024
//| access_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6025
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6026
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6027
// helper symbol for configuration_declaration //
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6028
optional_instance_specific_initializations:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6029
  // empty
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6030
	{$$ = NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6031
| instance_specific_initializations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6032
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6033
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6034
// helper symbol for configuration_declaration //
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6035
resource_declaration_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6036
  resource_declaration
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6037
	{$$ = new resource_declaration_list_c(locloc(@$)); $$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6038
| resource_declaration_list resource_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6039
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6040
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6041
| resource_declaration_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6042
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6043
	 print_err_msg(current_filename, locf(@1), locl(@1), "unexpected token after resource declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6044
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6045
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6046
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6047
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6048
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6049
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6050
resource_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6051
  RESOURCE {variable_name_symtable.push();} resource_name ON resource_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6052
   optional_global_var_declarations
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6053
   single_resource_declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6054
  END_RESOURCE
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6055
	{$$ = new resource_declaration_c($3, $5, $6, $7, locloc(@$));
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  6056
	 variable_name_symtable.pop();
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6057
	 variable_name_symtable.insert($3, prev_declared_resource_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6058
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6059
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6060
| RESOURCE {variable_name_symtable.push();} ON resource_type_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6061
   optional_global_var_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6062
   single_resource_declaration
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6063
  END_RESOURCE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6064
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6065
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6066
	 print_err_msg(current_filename, locf(@1), locl(@3), "no resource name defined in resource declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6067
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6068
| RESOURCE error END_RESOURCE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6069
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6070
	 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in resource declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6071
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6072
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6073
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6074
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6075
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6076
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6077
single_resource_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6078
 task_configuration_list program_configuration_list
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6079
	{$$ = new single_resource_declaration_c($1, $2, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6080
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6081
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6082
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6083
// helper symbol for single_resource_declaration //
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6084
task_configuration_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6085
  // empty
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6086
	{$$ = new task_configuration_list_c(locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6087
| task_configuration_list task_configuration ';'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6088
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6089
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6090
| task_configuration_list task_configuration error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6091
  {$$ = NULL;
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  6092
	 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at the end of task configuration in resource declaration.");
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6093
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6094
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6095
| task_configuration_list ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6096
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6097
	 yynerrs++;
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  6098
	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after task configuration in resource declaration.");
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6099
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6100
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6101
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6102
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6103
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6104
// helper symbol for single_resource_declaration //
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6105
program_configuration_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6106
  program_configuration ';'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6107
	{$$ = new program_configuration_list_c(locloc(@$)); $$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6108
| program_configuration_list program_configuration ';'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6109
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6110
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6111
| program_configuration error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6112
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6113
	 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at the end of program configuration in resource declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6114
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6115
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6116
| program_configuration_list program_configuration error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6117
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6118
	 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at the end of program configuration in resource declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6119
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6120
	}
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  6121
| program_configuration_list error ';'
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  6122
  {$$ = NULL;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  6123
	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid program configuration in resource declaration.");
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  6124
	 yyerrok;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  6125
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6126
| program_configuration_list ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6127
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6128
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6129
	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after program configuration in resource declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6130
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6131
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6132
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6133
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6134
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6135
resource_name: identifier;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6136
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6137
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6138
access_declarations:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6139
 VAR_ACCESS access_declaration_list END_VAR
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6140
	{$$ = NULL;}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6141
// ERROR_CHECK_BEGIN //
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6142
| VAR_ACCESS END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6143
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6144
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6145
	 print_err_msg(current_filename, locf(@1), locl(@2), "no variable declared in access variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6146
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6147
| VAR_ACCESS error access_declaration_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6148
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6149
	 print_err_msg(current_filename, locf(@1), locl(@3), "unexpected token after 'VAR_ACCESS' in access variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6150
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6151
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6152
| VAR_ACCESS error END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6153
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6154
	 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in access variable(s) declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6155
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6156
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6157
// ERROR_CHECK_END //
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6158
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6159
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6160
// helper symbol for access_declarations //
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6161
access_declaration_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6162
  access_declaration ';'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6163
| access_declaration_list access_declaration ';'
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6164
// ERROR_CHECK_BEGIN //
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6165
| access_declaration error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6166
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6167
	 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at the end of access variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6168
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6169
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6170
| access_declaration_list access_declaration error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6171
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6172
	 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at the end of access variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6173
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6174
	}
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  6175
| access_declaration_list error ';'
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  6176
  {$$ = NULL;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  6177
	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid access variable declaration.");
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  6178
	 yyerrok;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  6179
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6180
| access_declaration_list ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6181
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6182
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6183
	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after access variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6184
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6185
// ERROR_CHECK_END //
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6186
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6187
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6188
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6189
access_declaration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6190
  access_name ':' access_path ':' non_generic_type_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6191
| access_name ':' access_path ':' non_generic_type_name direction
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6192
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6193
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6194
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6195
access_path:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6196
  direct_variable
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6197
| prev_declared_resource_name '.' direct_variable
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6198
| any_fb_name_list symbolic_variable
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6199
| prev_declared_resource_name '.' any_fb_name_list symbolic_variable
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6200
| prev_declared_program_name '.'  any_fb_name_list symbolic_variable
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6201
| prev_declared_resource_name '.' prev_declared_program_name '.' any_fb_name_list symbolic_variable
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6202
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6203
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6204
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6205
// helper symbol for
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6206
//  - access_path
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6207
//  - instance_specific_init
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6208
//
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6209
/* NOTE: The fb_name_list refers to funtion block variables
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6210
 *       that have been declared in a scope outside the one we are
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6211
 *       currently parsing, so we must accept them to be any_identifier!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6212
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6213
 *       Beware that other locations of this syntax parser also require
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6214
 *       a fb_name_list. In those locations the function blocks are being declared,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6215
 *       so only currently un-used identifiers (i.e. identifier) may be accepted.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6216
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6217
 *       In order to distinguish the two, here we use any_fb_name_list, while
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6218
 *       in the the locations we simply use fb_name_list!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6219
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6220
any_fb_name_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6221
  // empty
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6222
	{$$ = new any_fb_name_list_c(locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6223
//| fb_name_list fb_name '.'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6224
| any_fb_name_list any_identifier '.'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6225
	{$$ = $1; $$->add_element($2);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6226
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6227
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6228
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6229
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6230
global_var_reference:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6231
//  [resource_name '.'] global_var_name ['.' structure_element_name] //
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6232
                                  prev_declared_global_var_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6233
	{$$ = new global_var_reference_c(NULL, $1, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6234
|                                 prev_declared_global_var_name '.' structure_element_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6235
	{$$ = new global_var_reference_c(NULL, $1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6236
| prev_declared_resource_name '.' prev_declared_global_var_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6237
	{$$ = new global_var_reference_c($1, $3, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6238
| prev_declared_resource_name '.' prev_declared_global_var_name '.' structure_element_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6239
	{$$ = new global_var_reference_c($1, $3, $5, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6240
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6241
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6242
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6243
//access_name: identifier;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6244
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6245
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6246
program_output_reference:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6247
/* NOTE:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6248
 * program_output_reference is merely used within data_source.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6249
 * data_source is merely used within task_initialization
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6250
 * task_initialization appears in a configuration declaration
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6251
 * _before_ the programs are declared, so we cannot use
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6252
 * prev_declared_program_name, as what might seem correct at first.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6253
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6254
 * The semantic checker must later check whether the identifier
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6255
 * used really refers to a program declared after the task
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6256
 * initialization!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6257
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6258
//  prev_declared_program_name '.' symbolic_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6259
  program_name '.' symbolic_variable
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6260
	{$$ = new program_output_reference_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6261
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6262
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6263
program_name: identifier;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6264
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6265
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6266
direction:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6267
  READ_WRITE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6268
	{$$ = NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6269
| READ_ONLY
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6270
	{$$ = NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6271
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6272
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6273
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6274
task_configuration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6275
  TASK task_name task_initialization
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6276
	{$$ = new task_configuration_c($2, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6277
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6278
| TASK task_initialization
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6279
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6280
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6281
	 print_err_msg(current_filename, locf(@1), locl(@2), "no task name defined in task declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6282
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6283
| TASK error task_initialization
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6284
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6285
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid task name defined in task declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6286
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6287
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6288
| TASK task_name error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6289
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6290
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid task initialization in task declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6291
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6292
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6293
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6294
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6295
75
0e381bdb8888 Fixing handling of task initialisation.
mario
parents: 74
diff changeset
  6296
/* NOTE: The specification does not mention the namespace to which task names
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6297
 *       should belong to. Unlike resource and program names, for the moment we
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6298
 *       let the task names belong to their own private namespace, as they do not
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6299
 *       produce any conflicts in the syntax parser.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6300
 *       If in the future our interpretation of the spec. turns out to be incorrect,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6301
 *       the definition of task_name may have to be changed!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6302
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6303
task_name: any_identifier;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6304
74
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6305
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6306
task_initialization:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6307
//  '(' [SINGLE ASSIGN data_source ','] [INTERVAL ASSIGN data_source ','] PRIORITY ASSIGN integer ')' //
75
0e381bdb8888 Fixing handling of task initialisation.
mario
parents: 74
diff changeset
  6308
  '(' {cmd_goto_task_init_state();} task_initialization_single task_initialization_interval task_initialization_priority ')'
0e381bdb8888 Fixing handling of task initialisation.
mario
parents: 74
diff changeset
  6309
	{$$ = new task_initialization_c($3, $4, $5, locloc(@$));}
74
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6310
;
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6311
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6312
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6313
task_initialization_single:
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6314
// [SINGLE ASSIGN data_source ',']
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6315
  /* empty */
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6316
	{$$ = NULL;}
75
0e381bdb8888 Fixing handling of task initialisation.
mario
parents: 74
diff changeset
  6317
| SINGLE ASSIGN {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();} 
0e381bdb8888 Fixing handling of task initialisation.
mario
parents: 74
diff changeset
  6318
	{$$ = $4;}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6319
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6320
| SINGLE {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6321
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6322
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6323
	 print_err_msg(current_filename, locf(@1), locl(@3), "':=' missing after 'SINGLE' in task initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6324
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6325
| SINGLE error {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6326
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6327
	 print_err_msg(current_filename, locf(@1), locl(@4), "expecteing ':=' after 'SINGLE' in task initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6328
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6329
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6330
| SINGLE ASSIGN {cmd_pop_state();} ',' {cmd_goto_task_init_state();}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6331
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6332
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6333
	 print_err_msg(current_filename, locf(@2), locl(@4), "no data source defined in 'SINGLE' statement of task initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6334
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6335
| SINGLE ASSIGN {cmd_pop_state();} error ',' {cmd_goto_task_init_state();}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6336
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6337
	 print_err_msg(current_filename, locf(@2), locl(@5), "invalid data source defined in 'SINGLE' statement of task initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6338
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6339
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6340
/* ERROR_CHECK_END */
74
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6341
;
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6342
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6343
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6344
task_initialization_interval:
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6345
// [INTERVAL ASSIGN data_source ','] 
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6346
  /* empty */
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6347
	{$$ = NULL;}
75
0e381bdb8888 Fixing handling of task initialisation.
mario
parents: 74
diff changeset
  6348
| INTERVAL ASSIGN {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();}
0e381bdb8888 Fixing handling of task initialisation.
mario
parents: 74
diff changeset
  6349
	{$$ = $4;}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6350
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6351
| INTERVAL {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6352
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6353
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6354
	 print_err_msg(current_filename, locf(@1), locl(@3), "':=' missing after 'INTERVAL' in task initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6355
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6356
| INTERVAL error {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6357
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6358
	 print_err_msg(current_filename, locf(@1), locl(@4), "expecting ':=' after 'INTERVAL' in task initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6359
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6360
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6361
| INTERVAL ASSIGN {cmd_pop_state();} ',' {cmd_goto_task_init_state();}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6362
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6363
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6364
	 print_err_msg(current_filename, locf(@2), locl(@4), "no data source defined in 'INTERVAL' statement of task initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6365
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6366
| INTERVAL ASSIGN {cmd_pop_state();} error ',' {cmd_goto_task_init_state();}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6367
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6368
	 print_err_msg(current_filename, locf(@2), locl(@5), "invalid data source defined in 'INTERVAL' statement of task initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6369
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6370
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6371
/* ERROR_CHECK_END */
75
0e381bdb8888 Fixing handling of task initialisation.
mario
parents: 74
diff changeset
  6372
;
0e381bdb8888 Fixing handling of task initialisation.
mario
parents: 74
diff changeset
  6373
74
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6374
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6375
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6376
task_initialization_priority:
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6377
// PRIORITY ASSIGN integer
75
0e381bdb8888 Fixing handling of task initialisation.
mario
parents: 74
diff changeset
  6378
  PRIORITY ASSIGN {cmd_pop_state();} integer 
0e381bdb8888 Fixing handling of task initialisation.
mario
parents: 74
diff changeset
  6379
	{$$ = $4;}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6380
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6381
| PRIORITY {cmd_pop_state();} integer
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6382
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6383
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6384
	 print_err_msg(current_filename, locf(@1), locl(@3), "':=' missing after 'PRIORITY' in task initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6385
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6386
| PRIORITY error {cmd_pop_state();} integer 
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6387
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6388
	 print_err_msg(current_filename, locf(@1), locl(@4), "expecting ':=' after 'PRIORITY' in task initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6389
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6390
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6391
| PRIORITY ASSIGN {cmd_pop_state();} error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6392
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6393
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6394
	 print_err_msg(current_filename, locf(@2), locl(@2), "no priority number defined in 'PRIORITY' statement of task initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6395
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6396
/* ERROR_CHECK_END */
75
0e381bdb8888 Fixing handling of task initialisation.
mario
parents: 74
diff changeset
  6397
;
0e381bdb8888 Fixing handling of task initialisation.
mario
parents: 74
diff changeset
  6398
74
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6399
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6400
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6401
data_source:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6402
  constant
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6403
| global_var_reference
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6404
| program_output_reference
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6405
| direct_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6406
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6407
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6408
program_configuration:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6409
//  PROGRAM [RETAIN | NON_RETAIN] program_name [WITH task_name] ':' program_type_name ['(' prog_conf_elements ')'] //
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6410
  PROGRAM program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6411
	{$$ = new program_configuration_c(NULL, $2, $3, $5, $6, locloc(@$));
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6412
	 variable_name_symtable.insert($2, prev_declared_program_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6413
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6414
| PROGRAM RETAIN program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6415
	{$$ = new program_configuration_c(new retain_option_c(locloc(@2)), $3, $4, $6, $7, locloc(@$));
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6416
	 variable_name_symtable.insert($3, prev_declared_program_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6417
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6418
| PROGRAM NON_RETAIN program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6419
	{$$ = new program_configuration_c(new non_retain_option_c(locloc(@2)), $3, $4, $6, $7, locloc(@$));
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6420
	 variable_name_symtable.insert($3, prev_declared_program_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6421
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6422
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6423
| PROGRAM program_name optional_task_name ':' identifier optional_prog_conf_elements
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6424
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6425
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6426
	 print_err_msg(current_filename, locf(@1), locl(@3), "unknown program type name after ':' in program configuration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6427
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6428
| PROGRAM RETAIN program_name optional_task_name ':' identifier optional_prog_conf_elements
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6429
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6430
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6431
	 print_err_msg(current_filename, locf(@2), locl(@4), "unknown program type name after ':' in program configuration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6432
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6433
| PROGRAM NON_RETAIN program_name optional_task_name ':' identifier optional_prog_conf_elements
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6434
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6435
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6436
	 print_err_msg(current_filename, locf(@2), locl(@4), "unknown program type name after ':' in program configuration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6437
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6438
| PROGRAM error program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6439
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6440
	 print_err_msg(current_filename, locf(@1), locl(@3), "unexpected token after 'PROGRAM' in program configuration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6441
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6442
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6443
| PROGRAM RETAIN error program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6444
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6445
	 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'RETAIN' in retentive program configuration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6446
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6447
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6448
| PROGRAM NON_RETAIN error program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6449
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6450
	 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'NON_RETAIN' in non-retentive program configuration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6451
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6452
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6453
| PROGRAM optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6454
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6455
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6456
	 print_err_msg(current_filename, locf(@1), locl(@2), "no program name defined in program configuration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6457
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6458
| PROGRAM RETAIN optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6459
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6460
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6461
	 print_err_msg(current_filename, locf(@2), locl(@3), "no program name defined in retentive program configuration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6462
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6463
| PROGRAM NON_RETAIN optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6464
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6465
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6466
	 print_err_msg(current_filename, locf(@2), locl(@3), "no program name defined in non-retentive program configuration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6467
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6468
| PROGRAM error optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6469
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6470
	 print_err_msg(current_filename, locf(@1), locl(@3), "no program name defined in program configuration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6471
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6472
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6473
| PROGRAM RETAIN error optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6474
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6475
	 print_err_msg(current_filename, locf(@2), locl(@4), "no program name defined in retentive program configuration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6476
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6477
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6478
| PROGRAM NON_RETAIN error optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6479
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6480
	 print_err_msg(current_filename, locf(@2), locl(@4), "no program name defined in non-retentive program configuration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6481
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6482
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6483
| PROGRAM program_name optional_task_name prev_declared_program_type_name optional_prog_conf_elements
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6484
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6485
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6486
	 print_err_msg(current_filename, locf(@3), locl(@4), "':' missing after program name or optional task name in program configuration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6487
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6488
| PROGRAM RETAIN program_name optional_task_name prev_declared_program_type_name optional_prog_conf_elements
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6489
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6490
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6491
	 print_err_msg(current_filename, locf(@4), locl(@5), "':' missing after program name or optional task name in program configuration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6492
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6493
| PROGRAM NON_RETAIN program_name optional_task_name prev_declared_program_type_name optional_prog_conf_elements
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6494
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6495
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6496
	 print_err_msg(current_filename, locf(@4), locl(@5), "':' missing after program name or optional task name in program configuration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6497
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6498
| PROGRAM program_name optional_task_name error prev_declared_program_type_name optional_prog_conf_elements
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6499
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6500
	 print_err_msg(current_filename, locf(@3), locl(@5), "expecting ':' after program name or optional task name in program configuration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6501
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6502
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6503
| PROGRAM RETAIN program_name optional_task_name error prev_declared_program_type_name optional_prog_conf_elements
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6504
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6505
	 print_err_msg(current_filename, locf(@4), locl(@6), "expecting ':' after program name or optional task name in program configuration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6506
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6507
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6508
| PROGRAM NON_RETAIN program_name optional_task_name error prev_declared_program_type_name optional_prog_conf_elements
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6509
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6510
	 print_err_msg(current_filename, locf(@4), locl(@6), "expecting ':' after program name or optional task name in program configuration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6511
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6512
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6513
| PROGRAM program_name optional_task_name ':' optional_prog_conf_elements
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6514
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6515
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6516
	 print_err_msg(current_filename, locf(@4), locl(@5), "no program type defined in program configuration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6517
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6518
| PROGRAM RETAIN program_name optional_task_name ':' optional_prog_conf_elements
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6519
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6520
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6521
	 print_err_msg(current_filename, locf(@5), locl(@6), "no program type defined in program configuration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6522
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6523
| PROGRAM NON_RETAIN program_name optional_task_name ':' optional_prog_conf_elements
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6524
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6525
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6526
	 print_err_msg(current_filename, locf(@5), locl(@6), "no program type defined in program configuration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6527
  }
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6528
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6529
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6530
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6531
// helper symbol for program_configuration //
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6532
optional_task_name:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6533
  // empty //
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6534
	{$$ = NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6535
| WITH task_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6536
	{$$ = $2;}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6537
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6538
| WITH error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6539
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6540
	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid tack name in optional task name of program configuration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6541
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6542
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6543
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6544
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6545
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6546
// helper symbol for program_configuration //
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6547
optional_prog_conf_elements:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6548
  // empty //
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6549
	{$$ = NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6550
| '(' prog_conf_elements ')'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6551
	{$$ = $2;}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6552
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6553
| '(' error ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6554
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6555
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid program configuration elements in program configuration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6556
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6557
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6558
| '(' prog_conf_elements error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6559
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6560
	 print_err_msg(current_filename, locf(@2), locl(@2), "')' missing at the end of program configuration elements in program configuration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6561
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6562
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6563
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6564
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6565
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6566
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6567
prog_conf_elements:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6568
  prog_conf_element
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6569
	{$$ = new prog_conf_elements_c(locloc(@$)); $$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6570
| prog_conf_elements ',' prog_conf_element
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6571
	{$$ = $1; $$->add_element($3);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6572
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6573
| prog_conf_elements prog_conf_element
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6574
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6575
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6576
	 print_err_msg(current_filename, locf(@1), locl(@2), "',' missing in program configuration elements list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6577
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6578
| prog_conf_elements ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6579
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6580
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid value for program configuration element in program configuration list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6581
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6582
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6583
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6584
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6585
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6586
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6587
prog_conf_element:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6588
  fb_task
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6589
| prog_cnxn
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6590
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6591
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6592
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6593
fb_task:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6594
  // fb_name WITH task_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6595
/* NOTE: The fb_name refers to funtion block variables
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6596
 *       that have been declared in a scope outside the one we are
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6597
 *       currently parsing, so we must accept them to be any_identifier!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6598
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6599
  any_identifier WITH task_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6600
	{$$ = new fb_task_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6601
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6602
| any_identifier WITH error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6603
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6604
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid task name in function block configuration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6605
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6606
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6607
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6608
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6609
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6610
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6611
/* NOTE:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6612
 *  The semantics of configuring a program are rather confusing, so here is
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6613
 *  my (Mario) understanding on the issue...
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6614
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6615
 *  A function/program may have as its input variables a simple variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6616
 *  (BYTE, WORD, etc...), an array (ARRAY [1 .. 3] OF BYTE, ...) , or a structure.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6617
 *  Nevertheless, when calling this function from within a st or il language statement
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6618
 *  it is not possible to allocate a value to a single element of the array or structure
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6619
 *  typed input variable, as the accepted syntax is simply '(' variable_name ':=' variable ')'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6620
 *  Notice how the variable_name does not include things such as 'a.elem1' or 'a[1]'!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6621
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6622
 *  Nevertheless, when configuring a program from within a configuration,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6623
 *  it becomes possible to allocate values to individual elements 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
  6624
 *  array or structured type input variable, as the syntax is now
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6625
 *  '(' symbolic_variable ':=' data_sink|prog_data_source ')'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6626
 *  Notice how the symbolic_variable _does_ include things such as 'a.elem1' or 'a[1]'!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6627
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6628
 *  Conclusion: Unlike other locations in the syntax where SENDTO appears,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6629
 *  here it is not valid to replace symbolic_variable with any_identifier!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6630
 *  Nevertheless, it is also not correct to leave symbolic_variable as it is,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6631
 *  as we have defined it to only include previously declared variables,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6632
 *  which is not the case in this situation. Here symbolic_variable is refering
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6633
 *  to variables that were defined within the scope of the program that is being
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6634
 *  called, and _not_ within the scope of the configuration that is calling the
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6635
 *  program, so the variables in question are not declared in the current scope!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6636
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6637
 *  We therefore need to define a new symbolic_variable, that accepts any_identifier
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6638
 *  instead of previosuly declared variable names, to be used in the definition of
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6639
 *  prog_cnxn!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6640
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6641
prog_cnxn:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6642
  any_symbolic_variable ASSIGN prog_data_source
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6643
	{$$ = new prog_cnxn_assign_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6644
| any_symbolic_variable SENDTO data_sink
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6645
	{$$ = new prog_cnxn_sendto_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6646
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6647
| any_symbolic_variable constant
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6648
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6649
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6650
	 print_err_msg(current_filename, locf(@2), locl(@2), "':=' missing between parameter and value in program configuration element.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6651
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6652
| any_symbolic_variable enumerated_value
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6653
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6654
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6655
	 print_err_msg(current_filename, locf(@2), locl(@2), "':=' missing between parameter and value in program configuration element.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6656
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6657
| any_symbolic_variable data_sink
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6658
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6659
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6660
	 print_err_msg(current_filename, locf(@2), locl(@2), "':=' or '=>' missing between parameter and variable in program configuration element.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6661
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6662
| any_symbolic_variable error prog_data_source
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6663
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6664
	 print_err_msg(current_filename, locf(@2), locl(@2), "expecting ':=' or '=>' after parameter in program configuration element.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6665
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6666
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6667
| any_symbolic_variable ASSIGN error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6668
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6669
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid value or variable in program configuration assignment element.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6670
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6671
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6672
| any_symbolic_variable SENDTO error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6673
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6674
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid variable in program configuration sendto element.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6675
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6676
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6677
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6678
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6679
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6680
prog_data_source:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6681
  constant
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6682
| enumerated_value
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6683
| global_var_reference
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6684
| direct_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6685
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6686
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6687
data_sink:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6688
  global_var_reference
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6689
| direct_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6690
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6691
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6692
instance_specific_initializations:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6693
 VAR_CONFIG instance_specific_init_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6694
	{$$ = new instance_specific_initializations_c($2, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6695
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6696
| VAR_CONFIG END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6697
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6698
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6699
	 print_err_msg(current_filename, locf(@1), locl(@2), "no variable declared in configuration variable(s) initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6700
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6701
| VAR_CONFIG error instance_specific_init_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6702
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6703
	 print_err_msg(current_filename, locf(@1), locl(@3), "unexpected token after 'VAR_CONFIG' in configuration variable(s) initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6704
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6705
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6706
| VAR_CONFIG error END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6707
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6708
	 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in configuration variable(s) initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6709
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6710
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6711
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6712
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6713
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6714
// helper symbol for instance_specific_initializations //
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6715
instance_specific_init_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6716
  instance_specific_init ';'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6717
	{$$ = new instance_specific_init_list_c(locloc(@$)); $$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6718
| instance_specific_init_list instance_specific_init ';'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6719
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6720
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6721
| instance_specific_init error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6722
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6723
	 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at the end of configuration variable initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6724
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6725
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6726
| instance_specific_init_list instance_specific_init error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6727
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6728
	 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at the end of configuration variable initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6729
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6730
	}
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  6731
| instance_specific_init_list error ';'
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  6732
  {$$ = NULL;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  6733
	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid configuration variable initialization.");
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  6734
	 yyerrok;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  6735
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6736
| instance_specific_init_list ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6737
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6738
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6739
	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after configuration variable initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6740
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6741
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6742
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6743
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6744
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6745
instance_specific_init:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6746
//
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6747
//  resource_name '.' program_name '.' {fb_name '.'}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6748
//  ((variable_name [location] ':' located_var_spec_init) | (fb_name ':' function_block_type_name ':=' structure_initialization))
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6749
//
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6750
//  prev_declared_resource_name '.' prev_declared_program_name '.' any_fb_name_list variable_name ':' located_var_spec_init
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6751
/* NOTE: variable_name has been changed to any_identifier (and not simply identifier) because the
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6752
 *       variables being referenced have been declared outside the scope currently being parsed!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6753
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6754
/* NOTE: program_name has not been changed to prev_declared_program_name because the
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6755
 *       programs being referenced have been declared outside the scope currently being parsed!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6756
 *       The programs are only kept inside the scope of the resource in which they are defined.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6757
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6758
  prev_declared_resource_name '.' program_name '.' any_fb_name_list any_identifier ':' located_var_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6759
	{$$ = new instance_specific_init_c($1, $3, $5, $6, NULL, $8, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6760
| prev_declared_resource_name '.' program_name '.' any_fb_name_list any_identifier location ':' located_var_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6761
	{$$ = new instance_specific_init_c($1, $3, $5, $6, $7, $9, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6762
| prev_declared_resource_name '.' program_name '.' any_fb_name_list any_identifier ':' fb_initialization
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6763
	{$5->add_element($6); $$ = new instance_specific_init_c($1, $3, $5, NULL, NULL, $8, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6764
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6765
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6766
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6767
/* helper symbol for instance_specific_init */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6768
fb_initialization:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6769
  function_block_type_name ASSIGN structure_initialization
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6770
	{$$ = new fb_initialization_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6771
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6772
| function_block_type_name structure_initialization
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6773
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6774
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6775
	 print_err_msg(current_filename, locf(@2), locl(@2), "':=' missing between function block name and initialization in function block initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6776
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6777
| function_block_type_name error structure_initialization
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6778
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6779
	 print_err_msg(current_filename, locf(@2), locl(@2), "expecting ':=' after function block name in function block initialization.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6780
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6781
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6782
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6783
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6784
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6785
/***********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6786
/* B 2.1 Instructions and Operands */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6787
/***********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6788
/* helper symbol for many IL instructions, etc... */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6789
/* eat up any extra EOL tokens... */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6790
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6791
eol_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6792
  EOL
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6793
| eol_list EOL
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6794
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6795
94
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  6796
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6797
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6798
instruction_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6799
  il_instruction
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6800
	{$$ = new instruction_list_c(locloc(@$)); $$->add_element($1);}
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  6801
| pragma eol_list
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6802
	{$$ = new instruction_list_c(locloc(@$)); $$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6803
| instruction_list il_instruction
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6804
	{$$ = $1; $$->add_element($2);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6805
| instruction_list pragma
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6806
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6807
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6808
| instruction_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6809
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6810
	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid IL instruction.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6811
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6812
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6813
/* ERROR_CHECK_END */
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6814
;
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6815
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6816
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6817
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6818
il_instruction:
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6819
  il_incomplete_instruction eol_list
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6820
	{$$ = new il_instruction_c(NULL, $1, locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6821
| label ':' il_incomplete_instruction eol_list
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6822
	{$$ = new il_instruction_c($1, $3, locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6823
/* ERROR_CHECK_BEGIN */
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6824
| error eol_list
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6825
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6826
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid IL instruction.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6827
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6828
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6829
| il_incomplete_instruction error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6830
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6831
	 print_err_msg(current_filename, locf(@1), locl(@1), "EOL missing at the end of IL instruction.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6832
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6833
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6834
| error ':' il_incomplete_instruction eol_list
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6835
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6836
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid label in IL instruction.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6837
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6838
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6839
| label il_incomplete_instruction eol_list
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6840
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6841
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6842
	 print_err_msg(current_filename, locf(@1), locl(@2), "':' missing after label in IL instruction.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6843
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6844
| label error il_incomplete_instruction eol_list
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6845
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6846
	 print_err_msg(current_filename, locf(@1), locl(@3), "expecting ':' after label in IL instruction.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6847
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6848
	}
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6849
| label ':' error eol_list
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6850
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6851
	 print_err_msg(current_filename, locf(@2), locl(@4), "invalid IL instruction.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6852
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6853
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6854
| label ':' il_incomplete_instruction error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6855
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6856
	 print_err_msg(current_filename, locf(@1), locl(@1), "EOL missing at the end of IL instruction.");
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6857
	 yyerrok;
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6858
	}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6859
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6860
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6861
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6862
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6863
/* helper symbol for il_instruction */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6864
il_incomplete_instruction:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6865
  il_simple_operation
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6866
| il_expression
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6867
| il_jump_operation
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6868
| il_fb_call
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6869
| il_formal_funct_call
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6870
| il_return_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6871
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6872
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6873
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6874
label: identifier;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6875
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6876
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6877
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6878
il_simple_operation:
94
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  6879
// (il_simple_operator [il_operand]) | (function_name [il_operand_list])
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6880
  il_simple_operator
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6881
	{$$ = new il_simple_operation_c($1, NULL, locloc(@$));}
93
284ef59bb133 Cleaning up comments.
mario
parents: 92
diff changeset
  6882
/*
284ef59bb133 Cleaning up comments.
mario
parents: 92
diff changeset
  6883
 * Note: Bison is getting confused with the following rule,
94
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  6884
 *       i.e. it is finding conflicts where there seemingly are really none.
93
284ef59bb133 Cleaning up comments.
mario
parents: 92
diff changeset
  6885
 *       The rule was therefore replaced by the equivalent following
284ef59bb133 Cleaning up comments.
mario
parents: 92
diff changeset
  6886
 *       two rules.
284ef59bb133 Cleaning up comments.
mario
parents: 92
diff changeset
  6887
 */
284ef59bb133 Cleaning up comments.
mario
parents: 92
diff changeset
  6888
/*
284ef59bb133 Cleaning up comments.
mario
parents: 92
diff changeset
  6889
| il_simple_operator il_operand
284ef59bb133 Cleaning up comments.
mario
parents: 92
diff changeset
  6890
	{$$ = new il_simple_operation_c($1, $2, locloc(@$));}
284ef59bb133 Cleaning up comments.
mario
parents: 92
diff changeset
  6891
*/
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6892
| il_simple_operator_noclash il_operand
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6893
	{$$ = new il_simple_operation_c($1, $2, locloc(@$));}
91
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  6894
| il_simple_operator_clash il_operand
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  6895
	{$$ = new il_simple_operation_c($1, $2, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6896
/* NOTE: the line
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6897
 *         | il_simple_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6898
 *       already contains the 'NOT' operator, as well as all the
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6899
 *       expression operators ('MOD', 'AND', etc...), all of which
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6900
 *       may also be a function name! This means that these operators/functions,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6901
 *       without any operands, could be reduced to either an operator or a
89
5b2ec5c057fa Cleaning up comments.
mario
parents: 88
diff changeset
  6902
 *       function call. 
5b2ec5c057fa Cleaning up comments.
mario
parents: 88
diff changeset
  6903
 *
5b2ec5c057fa Cleaning up comments.
mario
parents: 88
diff changeset
  6904
 *       I (Mario) have chosen to reduce it to an operator.
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6905
 *       In order to do this, we must remove from the syntax that defines
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6906
 *       function calls all the functions whose names clash with the IL operators.
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6907
 *
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6908
 *       The line
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6909
 *         | function_name
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6910
 *       has been replaced with the lines
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6911
 *         | function_name_no_clashes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6912
 *       in order to include all possible function names except
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6913
 *       those whose names coincide with operators !!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6914
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6915
| function_name_no_clashes
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6916
	{$$ = new il_function_call_c($1, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6917
/* NOTE: the line
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6918
 *         | il_simple_operator il_operand
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6919
 *       already contains the 'NOT', 'MOD', etc. operators, followed by a single il_operand.
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6920
 *       However, this same code (MOD x) may also be reduced to a function call to the MOD
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6921
 *       function. This means that (MOD, AND,...) could be interpret as a function name
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6922
 *       or as an IL operator! This would lead us to a reduce/reduce conflict!
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6923
 *
89
5b2ec5c057fa Cleaning up comments.
mario
parents: 88
diff changeset
  6924
 *       I (Mario) have chosen to reduce it to an operand, rather than a function call.
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6925
 *       In order to do this, we must remove from the syntax that defines
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6926
 *       function calls all the functions whose names clash with the IL operators.
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6927
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6928
 *       The line
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6929
 *         | function_name il_operand_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6930
 *       has been replaced with the line
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6931
 *         | function_name_no_clashes il_operand_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6932
 *       in order to include all possible function names except
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6933
 *       for the function names which clash with expression and simple operators.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6934
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6935
 *       Note that:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6936
 *       this alternative syntax does not cover the possibility of
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6937
 *       the function 'NOT', 'MOD', etc... being called with more than one il_operand,
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6938
 *       in which case it is always a function call, and not an IL instruction.
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6939
 *       We therefore need to include an extra rule where the
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6940
 *       function_name_expression_clashes and function_name_simpleop_clashes
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6941
 *       are followed by a il_operand_list with __two__ or more il_operands!!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6942
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6943
| function_name_no_clashes il_operand_list
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6944
	{$$ = new il_function_call_c($1, $2, locloc(@$));}
91
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  6945
| il_simple_operator_clash il_operand_list2
93
284ef59bb133 Cleaning up comments.
mario
parents: 92
diff changeset
  6946
	{$$ = new il_function_call_c(il_operator_c_2_identifier_c($1), $2, locloc(@$));}
284ef59bb133 Cleaning up comments.
mario
parents: 92
diff changeset
  6947
;
284ef59bb133 Cleaning up comments.
mario
parents: 92
diff changeset
  6948
91
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  6949
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6950
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6951
il_expression:
94
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  6952
// il_expr_operator '(' [il_operand] EOL {EOL} [simple_instr_list] ')'
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  6953
/*
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  6954
 * Note: Bison is getting confused with the use of il_expr_operator,
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  6955
 *       i.e. it is finding conflicts where there seemingly are really none.
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  6956
 *       il_expr_operator was therefore replaced by the equivalent 
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  6957
 *       il_expr_operator_noclash | il_expr_operator_clash.
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  6958
 */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6959
  il_expr_operator_noclash '(' eol_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6960
	{$$ = new il_expression_c($1, NULL, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6961
| il_expr_operator_noclash '(' il_operand eol_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6962
	{$$ = new il_expression_c($1, $3, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6963
| il_expr_operator_noclash '(' eol_list simple_instr_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6964
	{$$ = new il_expression_c($1, NULL, $4, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6965
| il_expr_operator_noclash '(' il_operand eol_list simple_instr_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6966
	{$$ = new il_expression_c($1, $3, $5, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6967
| il_expr_operator_clash '(' eol_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6968
	{$$ = new il_expression_c($1, NULL, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6969
| il_expr_operator_clash '(' il_operand eol_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6970
	{$$ = new il_expression_c($1, $3, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6971
| il_expr_operator_clash '(' il_operand eol_list simple_instr_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6972
	{$$ = new il_expression_c($1, $3, $5, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6973
| il_expr_operator_clash_eol_list simple_instr_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6974
	{$$ = new il_expression_c($1, NULL, $2, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6975
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6976
| il_expr_operator_noclash '(' eol_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6977
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6978
	 print_err_msg(current_filename, locf(@3), locl(@3), "')' missing at the end of IL expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6979
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6980
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6981
| il_expr_operator_noclash '(' il_operand eol_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6982
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6983
	 print_err_msg(current_filename, locf(@4), locl(@4), "')' missing at the end of IL expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6984
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6985
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6986
| il_expr_operator_noclash '(' eol_list simple_instr_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6987
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6988
	 print_err_msg(current_filename, locf(@4), locl(@4), "')' missing at the end of IL expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6989
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6990
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6991
| il_expr_operator_noclash '(' il_operand eol_list simple_instr_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6992
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6993
	 print_err_msg(current_filename, locf(@5), locl(@5), "')' missing at the end of IL expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6994
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6995
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6996
| il_expr_operator_clash '(' il_operand eol_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6997
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6998
	 print_err_msg(current_filename, locf(@4), locl(@4), "')' missing at the end of IL expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6999
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7000
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7001
| il_expr_operator_clash '(' il_operand eol_list simple_instr_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7002
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7003
	 print_err_msg(current_filename, locf(@5), locl(@5), "')' missing at the end of IL expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7004
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7005
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7006
| il_expr_operator_clash_eol_list simple_instr_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7007
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7008
	 print_err_msg(current_filename, locf(@2), locl(@2), "')' missing at the end of IL expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7009
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7010
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7011
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7012
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7013
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7014
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7015
il_jump_operation:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7016
  il_jump_operator label
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7017
	{$$ = new il_jump_operation_c($1, $2, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7018
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7019
| il_jump_operator error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7020
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7021
	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid label defined in IL jump operation.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7022
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7023
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7024
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7025
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7026
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7027
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7028
il_fb_call:
94
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  7029
// il_call_operator fb_name ['(' (EOL {EOL} [il_param_list]) | [il_operand_list] ')']
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7030
  il_call_operator prev_declared_fb_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7031
	{$$ = new il_fb_call_c($1, $2, NULL, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7032
| il_call_operator prev_declared_fb_name '(' ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7033
	{$$ = new il_fb_call_c($1, $2, NULL, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7034
| il_call_operator prev_declared_fb_name '(' eol_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7035
	{$$ = new il_fb_call_c($1, $2, NULL, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7036
| il_call_operator prev_declared_fb_name '(' il_operand_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7037
	{$$ = new il_fb_call_c($1, $2, $4, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7038
| il_call_operator prev_declared_fb_name '(' eol_list il_param_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7039
	{$$ = new il_fb_call_c($1, $2, NULL, $5, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7040
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7041
| il_call_operator error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7042
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7043
	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid function block name defined in IL function block call.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7044
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7045
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7046
| il_call_operator '(' ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7047
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7048
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7049
	 print_err_msg(current_filename, locf(@1), locl(@2), "no function block name defined in IL function block call.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7050
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7051
| il_call_operator '(' eol_list ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7052
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7053
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7054
	 print_err_msg(current_filename, locf(@1), locl(@2), "no function block name defined in IL function block call.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7055
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7056
| il_call_operator '(' il_operand_list ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7057
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7058
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7059
	 print_err_msg(current_filename, locf(@1), locl(@2), "no function block name defined in IL function block call.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7060
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7061
| il_call_operator '(' eol_list il_param_list ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7062
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7063
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7064
	 print_err_msg(current_filename, locf(@1), locl(@2), "no function block name defined in IL function block call.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7065
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7066
| il_call_operator error '(' ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7067
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7068
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid function block name defined in IL function block call.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7069
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7070
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7071
| il_call_operator error '(' eol_list ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7072
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7073
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid function block name defined in IL function block call.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7074
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7075
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7076
| il_call_operator error '(' il_operand_list ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7077
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7078
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid function block name defined in IL function block call.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7079
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7080
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7081
| il_call_operator error '(' eol_list il_param_list ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7082
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7083
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid function block name defined in IL function block call.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7084
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7085
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7086
| il_call_operator prev_declared_fb_name ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7087
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7088
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7089
	 print_err_msg(current_filename, locf(@2), locl(@3), "'(' missing after function block name defined in IL function block call.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7090
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7091
| il_call_operator prev_declared_fb_name il_operand_list ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7092
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7093
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7094
	 print_err_msg(current_filename, locf(@2), locl(@3), "'(' missing after function block name defined in IL function block call.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7095
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7096
| il_call_operator prev_declared_fb_name '(' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7097
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7098
	 print_err_msg(current_filename, locf(@1), locl(@3), "')' missing at the end of IL function block call.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7099
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7100
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7101
| il_call_operator prev_declared_fb_name '(' eol_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7102
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7103
	 print_err_msg(current_filename, locf(@1), locl(@3), "')' missing at the end of IL function block call.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7104
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7105
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7106
| il_call_operator prev_declared_fb_name '(' il_operand_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7107
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7108
	 print_err_msg(current_filename, locf(@1), locl(@3), "')' missing at the end of IL function block call.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7109
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7110
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7111
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7112
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7113
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7114
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7115
/* NOTE: Please read note above the definition of function_name_without_clashes */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7116
il_formal_funct_call:
94
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  7117
// function_name '(' EOL {EOL} [il_param_list] ')'
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7118
/*  function_name '(' eol_list ')'  */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7119
/* NOTE: il_formal_funct_call is only used in the definition of
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7120
 *         - il_incomplete_instruction
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7121
 *         - il_simple_instruction
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7122
 *       In both of the above, il_expression also
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7123
 *       shows up as another option. This means that the functions whose
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7124
 *       names clash with expressions, followed by '(' eol_list ')', are
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7125
 *       already included. We must therefore leave them out in this
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7126
 *       definition in order to remove reduce/reduce conflicts.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7127
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7128
 *       In summary: 'MOD' '(' eol_list ')', and all other functions whose
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7129
 *       names clash with expressions may be interpreted by the syntax by
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7130
 *       two different routes. I (Mario) chose to interpret them
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7131
 *       as operators, rather than as function calls!
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7132
 *       (AND MOD OR XOR ADD DIV EQ GT GE LT LE MUL NE SUB)
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7133
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7134
  function_name_no_clashes '(' eol_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7135
	{$$ = new il_formal_funct_call_c($1, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7136
| function_name_simpleop_clashes '(' eol_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7137
	{$$ = new il_formal_funct_call_c($1, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7138
/* | function_name '(' eol_list il_param_list ')' */
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7139
/* For the above syntax, we no longer have two ways of interpreting the
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7140
 * same syntax. The above is always a function call!
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7141
 * However, some of the functions that we may be calling
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7142
 * may have the same name as an IL operator. This means that
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7143
 * flex will be parsing them and handing them over to bison as
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7144
 * IL operator tokens, and not as function name tokens.
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7145
 * (when parsing ST, flex no longer recognizes IL operators,
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7146
 * so will always return the correct function name, unless that
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7147
 * name also coincides with an operator used in ST -> XOR, OR, MOD, AND, NOT)
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7148
 *
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7149
 * We must therefore interpret the IL operators as function names!
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7150
 */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7151
| function_name_no_clashes '(' eol_list il_param_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7152
	{$$ = new il_formal_funct_call_c($1, $4, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7153
| function_name_simpleop_clashes '(' eol_list il_param_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7154
	{$$ = new il_formal_funct_call_c($1, $4, locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7155
/* The following line should read:
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7156
 *
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7157
 * | function_name_expression_clashes '(' eol_list il_param_list ')'
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7158
 *
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7159
 * but the function_name_expression_clashes had to be first reduced to
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7160
 * an intermediary symbol in order to remove a reduce/reduce conflict.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7161
 * In essence, the syntax requires more than one look ahead token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7162
 * in order to be parsed. We resolve this by reducing a collection of
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7163
 * symbols into a temporary symbol (il_expr_operator_clash_eol_list), that
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7164
 * will later be replaced by the correct symbol. The correct symbol will
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7165
 * now be determined by a single look ahead token, as all the common
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7166
 * symbols have been reduced to the temporary symbol
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7167
 * il_expr_operator_clash_eol_list !
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7168
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7169
 * Unfortunately, this work around results in the wrong symbol
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7170
 * being created for the abstract syntax tree.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7171
 * We need to figure out which symbol was created, destroy it,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7172
 * and create the correct symbol for our case.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7173
 * This is a lot of work, so I put it in a function
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7174
 * at the end of this file... il_operator_c_2_identifier_c()
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7175
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7176
| il_expr_operator_clash_eol_list il_param_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7177
	{$$ = new il_formal_funct_call_c(il_operator_c_2_identifier_c($1), $2, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7178
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7179
| function_name_no_clashes '(' eol_list error ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7180
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7181
	 print_err_msg(current_filename, locf(@3), locl(@5), "invalid parameter list defined in IL formal function call.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7182
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7183
	} 
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7184
| function_name_simpleop_clashes '(' eol_list error ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7185
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7186
	 print_err_msg(current_filename, locf(@3), locl(@5), "invalid parameter list defined in IL formal function call.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7187
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7188
	} 
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7189
| il_expr_operator_clash_eol_list error ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7190
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7191
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid parameter list defined in IL formal function call.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7192
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7193
	} 
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7194
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7195
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7196
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7197
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7198
il_expr_operator_clash_eol_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7199
  il_expr_operator_clash '(' eol_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7200
	{$$ = $1;}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7201
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7202
| il_expr_operator_clash '(' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7203
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7204
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7205
	 print_err_msg(current_filename, locf(@1), locl(@2), "EOL missing after '(' in IL instruction.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7206
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7207
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7208
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7209
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7210
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7211
il_operand:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7212
  variable
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  7213
| enumerated_value
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7214
| constant
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7215
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7216
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7217
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7218
il_operand_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7219
  il_operand
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7220
	{$$ = new il_operand_list_c(locloc(@$)); $$->add_element($1);}
91
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  7221
| il_operand_list2
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  7222
;
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  7223
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  7224
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  7225
/* List with 2 or more il_operands */ 
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  7226
il_operand_list2:
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  7227
  il_operand ',' il_operand 
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  7228
	{$$ = new il_operand_list_c(locloc(@$)); $$->add_element($1); $$->add_element($3);}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  7229
| il_operand_list2 ',' il_operand
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7230
	{$$ = $1; $$->add_element($3);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7231
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7232
| il_operand_list2 il_operand
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7233
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7234
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7235
	 print_err_msg(current_filename, locf(@1), locl(@2), "',' missing in IL operand list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7236
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7237
| il_formal_funct_call error il_operand
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7238
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7239
	 print_err_msg(current_filename, locf(@1), locl(@3), "expecting ',' in IL operand list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7240
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7241
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7242
| il_formal_funct_call ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7243
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7244
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid operand in IL operand list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7245
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7246
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7247
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7248
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7249
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7250
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7251
simple_instr_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7252
  il_simple_instruction
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7253
	{$$ = new simple_instr_list_c(locloc(@$)); $$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7254
| simple_instr_list il_simple_instruction
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7255
	{$$ = $1; $$->add_element($2);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7256
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7257
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7258
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7259
il_simple_instruction:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7260
  il_simple_operation eol_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7261
| il_expression eol_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7262
| il_formal_funct_call eol_list
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7263
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7264
| il_expression error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7265
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7266
	 print_err_msg(current_filename, locf(@1), locl(@1), "EOL missing after expression IL instruction.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7267
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7268
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7269
| il_formal_funct_call error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7270
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7271
	 print_err_msg(current_filename, locf(@1), locl(@1), "EOL missing after formal function call IL instruction.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7272
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7273
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7274
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7275
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7276
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7277
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7278
/* NOTE: the correct definition of il_param_list is
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7279
 * il_param_list ::= {il_param_instruction} il_param_last_instruction
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7280
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7281
 * where {...} denotes zero or many il_param_instruction's.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7282
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7283
 * We could do this by defining the following:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7284
 * il_param_list: il_param_instruction_list il_param_last_instruction;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7285
 * il_param_instruction_list : ** empty ** | il_param_instruction_list il_param_instruction;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7286
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7287
 * Unfortunately, the above leads to reduce/reduce conflicts.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7288
 * The chosen alternative (as follows) does not have any conflicts!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7289
 * il_param_list: il_param_last_instruction | il_param_instruction_list il_param_last_instruction;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7290
 * il_param_instruction_list : il_param_instruction_list | il_param_instruction_list il_param_instruction;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7291
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7292
il_param_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7293
  il_param_instruction_list il_param_last_instruction
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7294
	{$$ = $1; $$->add_element($2);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7295
| il_param_last_instruction
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7296
	{$$ = new il_param_list_c(locloc(@$)); $$->add_element($1);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7297
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7298
| il_param_instruction_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7299
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7300
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid parameter assignment in parameter assignment list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7301
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7302
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7303
| il_param_last_instruction il_param_last_instruction
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7304
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7305
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7306
	 print_err_msg(current_filename, locf(@1), locl(@1), "',' missing at the end of parameter assignment in parameter assignment list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7307
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7308
| il_param_instruction_list il_param_last_instruction il_param_last_instruction
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7309
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7310
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7311
	 print_err_msg(current_filename, locf(@2), locl(@2), "',' missing at the end of parameter assignment in parameter assignment list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7312
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7313
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7314
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7315
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7316
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7317
/* Helper symbol for il_param_list */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7318
il_param_instruction_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7319
  il_param_instruction
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7320
	{$$ = new il_param_list_c(locloc(@$)); $$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7321
| il_param_instruction_list il_param_instruction
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7322
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7323
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7324
| il_param_last_instruction il_param_instruction
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7325
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7326
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7327
	 print_err_msg(current_filename, locf(@1), locl(@1), "',' missing at the end of parameter assignment in parameter assignment list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7328
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7329
| il_param_instruction_list il_param_last_instruction il_param_instruction
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7330
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7331
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7332
	 print_err_msg(current_filename, locf(@2), locl(@2), "',' missing at the end of parameter assignment in parameter assignment list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7333
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7334
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7335
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7336
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7337
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7338
il_param_instruction:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7339
  il_param_assignment ',' eol_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7340
| il_param_out_assignment ',' eol_list
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7341
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7342
| il_param_assignment ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7343
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7344
	 print_err_msg(current_filename, locf(@2), locl(@2), "EOL missing at the end of parameter assignment in parameter assignment list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7345
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7346
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7347
| il_param_out_assignment ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7348
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7349
	 print_err_msg(current_filename, locf(@2), locl(@2), "EOL missing at the end of parameter out assignment in parameter assignment list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7350
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7351
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7352
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7353
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7354
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7355
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7356
il_param_last_instruction:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7357
  il_param_assignment eol_list
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7358
| il_param_out_assignment eol_list
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7359
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7360
| il_param_assignment error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7361
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7362
	 print_err_msg(current_filename, locf(@1), locl(@1), "EOL missing at the end of last parameter assignment in parameter assignment list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7363
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7364
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7365
| il_param_out_assignment error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7366
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7367
	 print_err_msg(current_filename, locf(@1), locl(@1), "EOL missing at the end of last parameter out assignment in parameter assignment list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7368
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7369
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7370
/* ERROR_CHECK_END */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7371
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7372
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7373
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7374
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7375
il_param_assignment:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7376
  il_assign_operator il_operand
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7377
	{$$ = new il_param_assignment_c($1, $2, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7378
| il_assign_operator '(' eol_list simple_instr_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7379
	{$$ = new il_param_assignment_c($1, NULL, $4, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7380
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7381
| error il_operand
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7382
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7383
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid operator in parameter assignment.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7384
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7385
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7386
| error '(' eol_list simple_instr_list ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7387
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7388
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid operator in parameter assignment.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7389
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7390
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7391
| il_assign_operator error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7392
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7393
	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid operand defined in parameter assignment.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7394
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7395
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7396
| il_assign_operator '(' ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7397
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7398
	 print_err_msg(current_filename, locf(@1), locl(@1), "no instruction list defined in parameter assignment.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7399
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7400
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7401
| il_assign_operator '(' error ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7402
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7403
	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid instruction list defined in parameter assignment.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7404
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7405
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7406
| il_assign_operator '(' eol_list simple_instr_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7407
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7408
	 print_err_msg(current_filename, locf(@1), locl(@1), "')' missing at the end of instruction list defined in parameter assignment.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7409
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7410
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7411
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7412
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7413
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7414
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7415
il_param_out_assignment:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7416
  il_assign_out_operator variable
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7417
	{$$ = new il_param_out_assignment_c($1, $2, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7418
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7419
| il_assign_out_operator error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7420
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7421
	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid variable defined in parameter out assignment.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7422
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7423
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7424
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7425
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7426
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7427
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7428
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7429
/*******************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7430
/* B 2.2 Operators */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7431
/*******************/
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7432
sendto_identifier: sendto_identifier_token {$$ = new identifier_c($1, locloc(@$));};
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7433
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7434
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7435
/* NOTE:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7436
 *  The spec includes the operator 'EQ '
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7437
 * Note that EQ is followed by a space.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7438
 * I am considering this a typo, and defining the operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7439
 * as 'EQ'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7440
 * (Mario)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7441
 */
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7442
LD_operator: 		LD 	{$$ = new LD_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7443
LDN_operator: 		LDN 	{$$ = new LDN_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7444
ST_operator: 		ST 	{$$ = new ST_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7445
STN_operator: 		STN 	{$$ = new STN_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7446
NOT_operator: 		NOT 	{$$ = new NOT_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7447
S_operator: 		S 	{$$ = new S_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7448
R_operator: 		R 	{$$ = new R_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7449
S1_operator: 		S1 	{$$ = new S1_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7450
R1_operator: 		R1 	{$$ = new R1_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7451
CLK_operator: 		CLK 	{$$ = new CLK_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7452
CU_operator: 		CU 	{$$ = new CU_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7453
CD_operator: 		CD 	{$$ = new CD_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7454
PV_operator: 		PV 	{$$ = new PV_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7455
IN_operator: 		IN 	{$$ = new IN_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7456
PT_operator: 		PT 	{$$ = new PT_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7457
AND_operator: 		AND 	{$$ = new AND_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7458
AND2_operator: 		AND2 	{$$ = new AND_operator_c(locloc(@$));}; /* '&' in the source code! */
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7459
OR_operator: 		OR 	{$$ = new OR_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7460
XOR_operator: 		XOR 	{$$ = new XOR_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7461
ANDN_operator: 		ANDN 	{$$ = new ANDN_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7462
ANDN2_operator:		ANDN2 	{$$ = new ANDN_operator_c(locloc(@$));}; /* '&N' in the source code! */
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7463
ORN_operator: 		ORN 	{$$ = new ORN_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7464
XORN_operator: 		XORN 	{$$ = new XORN_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7465
ADD_operator: 		ADD 	{$$ = new ADD_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7466
SUB_operator: 		SUB 	{$$ = new SUB_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7467
MUL_operator: 		MUL 	{$$ = new MUL_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7468
DIV_operator: 		DIV 	{$$ = new DIV_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7469
MOD_operator: 		MOD 	{$$ = new MOD_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7470
GT_operator: 		GT 	{$$ = new GT_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7471
GE_operator: 		GE 	{$$ = new GE_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7472
EQ_operator: 		EQ 	{$$ = new EQ_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7473
LT_operator: 		LT 	{$$ = new LT_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7474
LE_operator: 		LE 	{$$ = new LE_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7475
NE_operator: 		NE 	{$$ = new NE_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7476
CAL_operator: 		CAL 	{$$ = new CAL_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7477
CALC_operator: 		CALC 	{$$ = new CALC_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7478
CALCN_operator: 	CALCN 	{$$ = new CALCN_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7479
RET_operator: 		RET 	{$$ = new RET_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7480
RETC_operator: 		RETC 	{$$ = new RETC_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7481
RETCN_operator: 	RETCN 	{$$ = new RETCN_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7482
JMP_operator: 		JMP 	{$$ = new JMP_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7483
JMPC_operator: 		JMPC 	{$$ = new JMPC_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7484
JMPCN_operator: 	JMPCN 	{$$ = new JMPCN_operator_c(locloc(@$));};
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7485
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7486
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7487
il_simple_operator:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7488
  il_simple_operator_clash
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7489
| il_simple_operator_noclash
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7490
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7491
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7492
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7493
il_simple_operator_noclash:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7494
  LD_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7495
| LDN_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7496
| ST_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7497
| STN_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7498
| S_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7499
| R_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7500
| S1_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7501
| R1_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7502
| CLK_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7503
| CU_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7504
| CD_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7505
| PV_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7506
| IN_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7507
| PT_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7508
| il_expr_operator_noclash
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7509
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7510
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7511
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7512
il_simple_operator_clash:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7513
  il_simple_operator_clash1
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7514
| il_simple_operator_clash2
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7515
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7516
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7517
il_simple_operator_clash1:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7518
  NOT_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7519
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7520
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7521
il_simple_operator_clash2:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7522
  il_expr_operator_clash
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7523
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7524
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7525
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7526
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7527
il_expr_operator:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7528
  il_expr_operator_noclash
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7529
| il_expr_operator_clash
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7530
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7531
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7532
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7533
il_expr_operator_clash:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7534
  AND_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7535
| OR_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7536
| XOR_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7537
| ADD_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7538
| SUB_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7539
| MUL_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7540
| DIV_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7541
| MOD_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7542
| GT_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7543
| GE_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7544
| EQ_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7545
| LT_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7546
| LE_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7547
| NE_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7548
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7549
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7550
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7551
il_expr_operator_noclash:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7552
  ANDN_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7553
| ANDN2_operator  /* string '&N' in source code! */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7554
| AND2_operator  /* string '&' in source code! */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7555
| ORN_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7556
| XORN_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7557
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7558
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7559
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7560
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7561
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7562
il_assign_operator:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7563
/*  variable_name ASSIGN */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7564
  any_identifier ASSIGN
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7565
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7566
| error ASSIGN
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7567
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7568
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid parameter defined in parameter assignment.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7569
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7570
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7571
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7572
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7573
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7574
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7575
il_assign_out_operator:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7576
/*  variable_name SENDTO */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7577
/*  any_identifier SENDTO */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7578
  sendto_identifier SENDTO
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7579
	{$$ = new il_assign_out_operator_c(NULL, $1, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7580
/*| NOT variable_name SENDTO */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7581
| NOT sendto_identifier SENDTO
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7582
	{$$ = new il_assign_out_operator_c(new not_paramassign_c(locloc(@1)), $2, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7583
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7584
| error SENDTO
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7585
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7586
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid parameter defined in parameter out assignment.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7587
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7588
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7589
| NOT SENDTO
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7590
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7591
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7592
	 print_err_msg(current_filename, locf(@1), locl(@2), "no paramter defined in parameter out assignment.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7593
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7594
| NOT error SENDTO
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7595
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7596
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid parameter defined in parameter out assignment.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7597
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7598
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7599
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7600
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7601
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7602
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7603
il_call_operator:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7604
  CAL_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7605
| CALC_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7606
| CALCN_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7607
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7608
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7609
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7610
il_return_operator:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7611
  RET_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7612
| RETC_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7613
| RETCN_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7614
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7615
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7616
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7617
il_jump_operator:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7618
  JMP_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7619
| JMPC_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7620
| JMPCN_operator
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7621
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7622
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7623
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7624
/***********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7625
/* B 3.1 - Expressions */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7626
/***********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7627
expression:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7628
  xor_expression
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7629
| expression OR xor_expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7630
	{$$ = new or_expression_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7631
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7632
| expression OR error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7633
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7634
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid expression after 'OR' in ST expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7635
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7636
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7637
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7638
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7639
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7640
xor_expression:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7641
  and_expression
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7642
| xor_expression XOR and_expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7643
	{$$ = new xor_expression_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7644
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7645
| xor_expression XOR error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7646
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7647
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid expression after 'XOR' in ST expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7648
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7649
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7650
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7651
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7652
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7653
and_expression:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7654
  comparison
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7655
| and_expression '&' comparison
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7656
	{$$ = new and_expression_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7657
| and_expression AND comparison
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7658
	{$$ = new and_expression_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7659
/* NOTE: The lexical parser never returns the token '&'.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7660
 *       The '&' string is interpreted by the lexcial parser as the token
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7661
 *       AND2!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7662
 *       This means that the first rule with '&' is actually not required,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7663
 *       but we leave it in nevertheless just in case we later decide
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7664
 *       to remove theh AND2 token...
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7665
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7666
| and_expression AND2 comparison
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7667
	{$$ = new and_expression_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7668
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7669
| and_expression '&' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7670
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7671
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid expression after '&' in ST expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7672
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7673
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7674
| and_expression AND error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7675
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7676
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid expression after 'AND' in ST expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7677
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7678
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7679
| and_expression AND2 error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7680
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7681
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid expression after '&' in ST expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7682
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7683
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7684
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7685
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7686
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7687
comparison:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7688
  equ_expression
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7689
| comparison '=' equ_expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7690
	{$$ = new equ_expression_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7691
| comparison OPER_NE equ_expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7692
	{$$ = new notequ_expression_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7693
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7694
| comparison '=' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7695
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7696
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid expression after '=' in ST expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7697
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7698
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7699
| comparison OPER_NE error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7700
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7701
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid expression after '<>' in ST expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7702
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7703
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7704
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7705
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7706
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7707
equ_expression:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7708
  add_expression
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7709
| equ_expression '<' add_expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7710
	{$$ = new lt_expression_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7711
| equ_expression '>' add_expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7712
	{$$ = new gt_expression_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7713
| equ_expression OPER_LE add_expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7714
	{$$ = new le_expression_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7715
| equ_expression OPER_GE add_expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7716
	{$$ = new ge_expression_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7717
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7718
| equ_expression '<' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7719
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7720
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid expression after '<' in ST expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7721
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7722
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7723
| equ_expression '>' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7724
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7725
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid expression after '>' in ST expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7726
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7727
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7728
| equ_expression OPER_LE error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7729
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7730
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid expression after '<=' in ST expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7731
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7732
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7733
| equ_expression OPER_GE error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7734
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7735
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid expression after '>=' in ST expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7736
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7737
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7738
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7739
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7740
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7741
/* Not required...
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7742
comparison_operator: '<' | '>' | '>=' '<='
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7743
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7744
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7745
add_expression:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7746
  term
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7747
| add_expression '+' term
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7748
	{$$ = new add_expression_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7749
| add_expression '-' term
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7750
	{$$ = new sub_expression_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7751
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7752
| add_expression '+' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7753
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7754
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid expression after '+' in ST expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7755
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7756
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7757
| add_expression '-' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7758
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7759
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid expression after '-' in ST expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7760
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7761
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7762
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7763
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7764
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7765
/* Not required...
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7766
add_operator: '+' | '-'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7767
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7768
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7769
term:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7770
  power_expression
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7771
| term '*' power_expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7772
	{$$ = new mul_expression_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7773
| term '/' power_expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7774
	{$$ = new div_expression_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7775
| term MOD power_expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7776
	{$$ = new mod_expression_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7777
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7778
| term '*' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7779
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7780
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid expression after '*' in ST expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7781
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7782
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7783
| term '/' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7784
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7785
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid expression after '/' in ST expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7786
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7787
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7788
| term MOD error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7789
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7790
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid expression after 'MOD' in ST expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7791
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7792
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7793
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7794
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7795
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7796
/* Not required...
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7797
multiply_operator: '*' | '/' | 'MOD'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7798
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7799
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7800
power_expression:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7801
  unary_expression
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7802
| power_expression OPER_EXP unary_expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7803
	{$$ = new power_expression_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7804
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7805
| power_expression OPER_EXP error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7806
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7807
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid expression after '**' in ST expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7808
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7809
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7810
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7811
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7812
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7813
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7814
unary_expression:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7815
  primary_expression
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7816
| '-' primary_expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7817
	{$$ = new neg_expression_c($2, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7818
| NOT primary_expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7819
	{$$ = new not_expression_c($2, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7820
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7821
| '-' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7822
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7823
	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid expression after '-' in ST expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7824
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7825
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7826
| NOT error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7827
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7828
	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid expression after 'NOT' in ST expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7829
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7830
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7831
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7832
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7833
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7834
/* Not required...
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7835
unary_operator: '-' | 'NOT'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7836
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7837
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7838
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7839
/* NOTE: using constant as a possible symbol for primary_expression
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7840
 *       leads to a reduce/reduce conflict.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7841
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7842
 *       The text '-9' may be parsed as either a
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7843
 *       expression<-primary_expression<-constant<-signed_integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7844
 *       (i.e. the constant 9 negative)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7845
 *       OR
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7846
 *       expression<-unary_expression<-constant<-integer
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7847
 *       (i.e. the constant 9, preceded by a unary negation)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7848
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7849
 *       To remove the conlfict, we only allow constants without
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7850
 *       a preceding '-' to be used in primary_expression
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7851
 */
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  7852
/* NOTE: We use enumerated_value_without_identifier instead of enumerated_value
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  7853
 *       in order to remove a reduce/reduce conflict between reducing an
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  7854
 *       identifier to a variable or an enumerated_value.
78
aead91ec37cd removing 'identifier' from definition of symbolic_variable
mario
parents: 77
diff changeset
  7855
 *
aead91ec37cd removing 'identifier' from definition of symbolic_variable
mario
parents: 77
diff changeset
  7856
 *       This change follows the IEC specification. The specification seems to
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  7857
 *       imply (by introducing syntax that allows to unambiguosly reference an
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  7858
 *       enumerated value - enum_type#enum_value) that in case the same identifier is used
78
aead91ec37cd removing 'identifier' from definition of symbolic_variable
mario
parents: 77
diff changeset
  7859
 *       for a variable and an enumerated value, then the variable shall be
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  7860
 *       considered.
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  7861
 */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7862
primary_expression:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7863
/* constant */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7864
  non_negative_constant
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  7865
//| enumerated_value_without_identifier
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  7866
| enumerated_value
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7867
| variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7868
| '(' expression ')'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7869
	{$$ = $2;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7870
|  function_invocation
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7871
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7872
| '(' expression error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7873
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7874
	 print_err_msg(current_filename, locf(@2), locl(@2), "')' missing at the end of expression in ST expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7875
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7876
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7877
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7878
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7879
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7880
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7881
/* intermediate helper symbol for primary_expression */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7882
/* NOTE: function_name includes the standard function name 'NOT' !
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7883
 *       This introduces a reduce/reduce conflict, as NOT(var)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7884
 *       may be parsed as either a function_invocation, or a
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7885
 *       unary_expression.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7886
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7887
 *       I (Mario) have opted to remove the possible reduction
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7888
 *       to function invocation, which means replacing the rule
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7889
 *           function_name '(' param_assignment_list ')'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7890
 *       with
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7891
 *           function_name_no_NOT_clashes '(' param_assignment_list ')'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7892
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7893
 *       Notice how the new rule does not include the situation where
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7894
 *       the function NOT is called with more than one parameter, which
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7895
 *       the original rule does include! Callinf the NOT function with more
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7896
 *       than one argument is probably a semantic error anyway, so it
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7897
 *       doesn't make much sense to take it into account.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7898
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7899
 *       Nevertheless, if we were to to it entirely correctly,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7900
 *       leaving the semantic checks for the next compiler stage,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7901
 *       this syntax parser would need to include such a possibility.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7902
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7903
 *       We will leave this out for now. No need to complicate the syntax
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7904
 *       more than the specification does by contradicting itself, and
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7905
 *       letting names clash!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7906
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7907
function_invocation:
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  7908
/*  function_name '(' [param_assignment_list] ')' */
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  7909
  function_name_no_NOT_clashes '(' param_assignment_formal_list ')'
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  7910
	{$$ = new function_invocation_c($1, $3, locloc(@$));}
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  7911
| function_name_no_NOT_clashes '(' param_assignment_nonformal_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7912
	{$$ = new function_invocation_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7913
/* ERROR_CHECK_BEGIN */ 
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7914
| function_name_no_NOT_clashes param_assignment_formal_list ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7915
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7916
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7917
	 print_err_msg(current_filename, locf(@1), locl(@2), "'(' missing after function name in ST expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7918
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7919
| function_name_no_NOT_clashes error param_assignment_formal_list ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7920
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7921
	 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '(' after function name in ST expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7922
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7923
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7924
| function_name_no_NOT_clashes error param_assignment_nonformal_list ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7925
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7926
	 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '(' after function name in ST expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7927
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7928
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7929
| function_name_no_NOT_clashes '(' ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7930
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7931
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7932
	 print_err_msg(current_filename, locf(@1), locl(@3), "no parameter defined in function invocation of ST expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7933
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7934
| function_name_no_NOT_clashes '(' error ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7935
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7936
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid parameter(s) defined in function invocation of ST expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7937
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7938
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7939
| function_name_no_NOT_clashes '(' param_assignment_formal_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7940
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7941
	 print_err_msg(current_filename, locf(@1), locl(@3), "')' missing at the end of function invocation in ST expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7942
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7943
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7944
| function_name_no_NOT_clashes '(' param_assignment_nonformal_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7945
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7946
	 print_err_msg(current_filename, locf(@1), locl(@3), "')' missing at the end of function invocation in ST expression.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7947
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7948
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7949
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7950
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7951
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7952
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7953
/********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7954
/* B 3.2 Statements */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7955
/********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7956
statement_list:
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  7957
  statement ';'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7958
	{$$ = new statement_list_c(locloc(@$)); $$->add_element($1);}
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  7959
| pragma
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7960
	{$$ = new statement_list_c(locloc(@$)); $$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7961
| statement_list statement ';'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7962
	{$$ = $1; $$->add_element($2);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7963
| statement_list pragma
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7964
	{$$ = $1; $$->add_element($2);}
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7965
/* ERROR_CHECK_BEGIN */
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  7966
| statement error
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  7967
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7968
	 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at the end of statement in ST statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7969
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7970
	}
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  7971
| statement_list statement error
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  7972
	{$$ = NULL;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  7973
	 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at the end of statement in ST statement.");
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  7974
	 yyerrok;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  7975
	}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7976
| statement_list error ';'
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  7977
	{$$ = NULL;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  7978
	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid statement in ST statement.");
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  7979
	 yyerrok;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  7980
	}
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  7981
| statement_list ';'
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  7982
	{$$ = NULL;
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  7983
	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after statement in ST statement.");
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7984
	 yyerrok;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7985
	}
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7986
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7987
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7988
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7989
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7990
statement:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7991
  assignment_statement
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7992
| subprogram_control_statement
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7993
| selection_statement
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7994
| iteration_statement
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7995
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7996
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7997
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7998
/*********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7999
/* B 3.2.1 Assignment Statements */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8000
/*********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8001
assignment_statement:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8002
  variable ASSIGN expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8003
	{$$ = new assignment_statement_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8004
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8005
| variable ASSIGN error
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  8006
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8007
	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid expression after ':=' in ST assignment statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8008
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8009
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8010
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8011
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8012
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8013
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8014
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8015
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8016
/*****************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8017
/* B 3.2.2 Subprogram Control Statements */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8018
/*****************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8019
subprogram_control_statement:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8020
  fb_invocation
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8021
| return_statement
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8022
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8023
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8024
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8025
return_statement:
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8026
  RETURN	{$$ = new return_statement_c(locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8027
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8028
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8029
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8030
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8031
fb_invocation:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8032
  prev_declared_fb_name '(' ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8033
	{$$ = new fb_invocation_c($1, NULL, locloc(@$));	}
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8034
| prev_declared_fb_name '(' param_assignment_formal_list ')'
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8035
	{$$ = new fb_invocation_c($1, $3, locloc(@$));}
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8036
| prev_declared_fb_name '(' param_assignment_nonformal_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8037
	{$$ = new fb_invocation_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8038
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8039
| prev_declared_fb_name ')'
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  8040
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8041
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8042
	 print_err_msg(current_filename, locf(@1), locl(@1), "'(' missing after function block name in ST statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8043
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8044
| prev_declared_fb_name param_assignment_formal_list ')'
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  8045
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8046
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8047
	 print_err_msg(current_filename, locf(@1), locl(@1), "'(' missing after function block name in ST statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8048
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8049
| prev_declared_fb_name error ')'
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  8050
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8051
	 print_err_msg(current_filename, locf(@1), locl(@1), "expecting '(' after function block name in ST statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8052
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8053
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8054
| prev_declared_fb_name error param_assignment_formal_list ')'
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  8055
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8056
	 print_err_msg(current_filename, locf(@1), locl(@1), "expecting '(' after function block name in ST statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8057
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8058
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8059
| prev_declared_fb_name error param_assignment_nonformal_list ')'
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  8060
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8061
	 print_err_msg(current_filename, locf(@1), locl(@1), "expecting '(' after function block name in ST statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8062
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8063
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8064
| prev_declared_fb_name '(' error ')'
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  8065
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8066
	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid parameter list in function block invocation in ST statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8067
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8068
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8069
| prev_declared_fb_name '(' error
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  8070
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8071
	 print_err_msg(current_filename, locf(@1), locl(@1), "')' missing after parameter list of function block invocation in ST statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8072
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8073
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8074
| prev_declared_fb_name '(' param_assignment_formal_list error
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  8075
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8076
	 print_err_msg(current_filename, locf(@1), locl(@1), "')' missing after parameter list of function block invocation in ST statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8077
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8078
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8079
| prev_declared_fb_name '(' param_assignment_nonformal_list error
133
fff75b8283be Some bugs on syntax checking tests fixed
lbessard
parents: 131
diff changeset
  8080
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8081
	 print_err_msg(current_filename, locf(@1), locl(@1), "')' missing after parameter list of function block invocation in ST statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8082
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8083
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8084
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8085
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8086
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8087
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8088
/* helper symbol for
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8089
 * - fb_invocation
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8090
 * - function_invocation
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8091
 */
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8092
param_assignment_formal_list:
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8093
  param_assignment_formal
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8094
	{$$ = new param_assignment_list_c(locloc(@$)); $$->add_element($1);}
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8095
| param_assignment_formal_list ',' param_assignment_formal
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8096
	{$$ = $1; $$->add_element($3);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8097
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8098
| param_assignment_formal_list error param_assignment_formal
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8099
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8100
	 print_err_msg(current_filename, locf(@1), locl(@3), "expecting ',' in ST parameter assignment list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8101
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8102
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8103
| param_assignment_formal_list ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8104
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8105
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid parameter assignment in ST parameter assignment list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8106
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8107
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8108
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8109
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8110
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8111
/* helper symbol for
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8112
 * - fb_invocation
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8113
 * - function_invocation
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8114
 */
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8115
param_assignment_nonformal_list:
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8116
  param_assignment_nonformal
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8117
	{$$ = new param_assignment_list_c(locloc(@$)); $$->add_element($1);}
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8118
| param_assignment_nonformal_list ',' param_assignment_nonformal
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8119
	{$$ = $1; $$->add_element($3);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8120
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8121
| param_assignment_nonformal_list ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8122
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8123
	 print_err_msg(current_filename, locf(@1), locl(@2), "invalid parameter assignment in ST parameter assignment list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8124
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8125
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8126
/* ERROR_CHECK_END */
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8127
;
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8128
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8129
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8130
/* NOTE: According to the IEC 61131-3 standard, there are two possible
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8131
 *       syntaxes for calling function blocks within ST.
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8132
 *       The formal method has the form:
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8133
 *        fb ( invar := x, inoutvar := var1, outvar => var2);
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8134
 *       The non-formal method has the form:
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8135
 *        fb (x, var1, var2);
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8136
 *       In the text of IEC 61131-3 (where the semantics are defined),
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8137
 *       it is obvious that mixing the two syntaxes is considered incorrect.
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8138
 *       The following should therefore be incorrect: 
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8139
 *        fb ( invar := x, var1, var2);
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8140
 *       However, according to the syntax definition, as defined in IEC 61131-3,
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8141
 *       mixing the formal and non-formal methods of invocation is allowed.
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8142
 *       We have two alternatives:
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8143
 *        (a) implement the syntax here in iec.y according to the standard,
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8144
 *            and leave it to the semantic analyser stage to find this error
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8145
 *        (b) or implement the syntax in iec.y correctly, not allowing 
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8146
 *            the mixing of formal and non-formal invocation syntaxes.
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8147
 *       Considering that this is a syntax issue, and not semantic issue,
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8148
 *       I (Mario) have decided to go with alternative (a).
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8149
 *       In other words, in iec.y we do not follow the syntax as defined in
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8150
 *       Annex B of the IEC 61131-3 standard, but rather implement
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8151
 *       the syntax also taking into account the textual part of the standard too.
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8152
 */
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8153
/*
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8154
param_assignment:
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8155
  variable_name ASSIGN expression 
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8156
*/
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8157
param_assignment_nonformal:
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8158
  expression
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8159
;
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8160
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8161
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8162
param_assignment_formal:
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8163
  any_identifier ASSIGN expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8164
	{$$ = new input_variable_param_assignment_c($1, $3, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8165
/*| variable_name SENDTO variable */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8166
/*| any_identifier SENDTO variable */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8167
| sendto_identifier SENDTO variable
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8168
	{$$ = new output_variable_param_assignment_c(NULL,$1, $3, locloc(@$));}
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8169
/*| NOT variable_name SENDTO variable */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8170
/*| NOT any_identifier SENDTO variable*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8171
| NOT sendto_identifier SENDTO variable
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8172
	{$$ = new output_variable_param_assignment_c(new not_paramassign_c(locloc(@$)),$2, $4, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8173
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8174
| any_identifier ASSIGN error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8175
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8176
	 print_err_msg(current_filename, locf(@1), locl(@2), "invalid expression in ST formal parameter assignment.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8177
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8178
	} 
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8179
| sendto_identifier SENDTO error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8180
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8181
	 print_err_msg(current_filename, locf(@1), locl(@2), "invalid expression in ST formal parameter out assignment.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8182
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8183
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8184
| NOT SENDTO variable
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8185
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8186
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8187
	 print_err_msg(current_filename, locf(@1), locl(@2), "no parameter name defined in ST formal parameter out negated assignment.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8188
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8189
| NOT error SENDTO variable
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8190
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8191
	 print_err_msg(current_filename, locf(@1), locl(@2), "invalid parameter name defined in ST formal parameter out negated assignment.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8192
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8193
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8194
| NOT sendto_identifier SENDTO error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8195
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8196
	 print_err_msg(current_filename, locf(@1), locl(@2), "invalid expression in ST formal parameter out negated assignment.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8197
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8198
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8199
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8200
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8201
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8202
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8203
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8204
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8205
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8206
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8207
/* B 3.2.3 Selection Statements */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8208
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8209
selection_statement:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8210
  if_statement
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8211
| case_statement
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8212
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8213
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8214
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8215
if_statement:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8216
  IF expression THEN statement_list elseif_statement_list END_IF
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8217
	{$$ = new if_statement_c($2, $4, $5, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8218
| IF expression THEN statement_list elseif_statement_list ELSE statement_list END_IF
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8219
	{$$ = new if_statement_c($2, $4, $5, $7, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8220
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8221
| IF THEN statement_list elseif_statement_list END_IF
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8222
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8223
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8224
	 print_err_msg(current_filename, locf(@1), locl(@2), "no test expression defined in ST 'IF' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8225
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8226
| IF THEN statement_list elseif_statement_list ELSE statement_list END_IF
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8227
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8228
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8229
	 print_err_msg(current_filename, locf(@1), locl(@2), "no test expression defined in ST 'IF' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8230
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8231
| IF error THEN statement_list elseif_statement_list END_IF
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8232
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8233
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid test expression defined for ST 'IF' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8234
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8235
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8236
| IF error THEN statement_list elseif_statement_list ELSE statement_list END_IF
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8237
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8238
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid test expression defined for ST 'IF' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8239
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8240
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8241
| IF expression error statement_list elseif_statement_list END_IF
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8242
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8243
	 print_err_msg(current_filename, locf(@2), locl(@4), "expecting 'THEN' after test expression in ST 'IF' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8244
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8245
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8246
| IF expression error statement_list elseif_statement_list ELSE statement_list END_IF
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8247
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8248
	 print_err_msg(current_filename, locf(@2), locl(@4), "expecting 'THEN' after test expression in ST 'IF' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8249
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8250
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8251
| IF expression THEN elseif_statement_list END_IF
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8252
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8253
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8254
	 print_err_msg(current_filename, locf(@3), locl(@4), "no statement defined after 'THEN' in ST 'IF' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8255
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8256
| IF expression THEN elseif_statement_list ELSE statement_list END_IF
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8257
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8258
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8259
	 print_err_msg(current_filename, locf(@3), locl(@4), "no statement defined after 'THEN' in ST 'IF' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8260
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8261
| IF expression THEN statement_list elseif_statement_list ELSE END_IF
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8262
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8263
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8264
	 print_err_msg(current_filename, locf(@6), locl(@7), "no statement defined after 'ELSE' in ST 'IF' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8265
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8266
| IF expression THEN statement_list elseif_statement_list ELSE error END_IF
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8267
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8268
	 print_err_msg(current_filename, locf(@6), locl(@8), "invalid statement defined after 'ELSE' in ST 'IF' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8269
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8270
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8271
| IF error END_IF
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8272
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8273
	 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in ST 'IF' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8274
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8275
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8276
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8277
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8278
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8279
/* helper symbol for if_statement */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8280
elseif_statement_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8281
  /* empty */
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8282
	{$$ = new elseif_statement_list_c(locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8283
| elseif_statement_list elseif_statement
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8284
	{$$ = $1; $$->add_element($2);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8285
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8286
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8287
/* helper symbol for elseif_statement_list */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8288
elseif_statement:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8289
  ELSIF expression THEN statement_list
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8290
	{$$ = new elseif_statement_c($2, $4, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8291
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8292
| ELSIF THEN statement_list
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8293
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8294
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8295
	 print_err_msg(current_filename, locf(@1), locl(@2), "no test expression defined for 'ELSEIF' statement in ST 'IF' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8296
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8297
| ELSIF error THEN statement_list
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8298
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8299
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid test expression defined for 'ELSEIF' statement in ST 'IF' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8300
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8301
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8302
| ELSIF expression error statement_list
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8303
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8304
	 print_err_msg(current_filename, locf(@2), locl(@4), "expecting 'THEN' after test expression in 'ELSEIF' statement of ST 'IF' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8305
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8306
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8307
| ELSIF expression THEN error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8308
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8309
	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid statement list in 'ELSEIF' statement of ST 'IF' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8310
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8311
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8312
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8313
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8314
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8315
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8316
case_statement:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8317
  CASE expression OF case_element_list END_CASE
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8318
	{$$ = new case_statement_c($2, $4, NULL, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8319
| CASE expression OF case_element_list ELSE statement_list END_CASE
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8320
	{$$ = new case_statement_c($2, $4, $6, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8321
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8322
| CASE OF case_element_list END_CASE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8323
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8324
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8325
	 print_err_msg(current_filename, locf(@1), locl(@2), "no test expression defined in ST 'CASE' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8326
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8327
| CASE OF case_element_list ELSE statement_list END_CASE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8328
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8329
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8330
	 print_err_msg(current_filename, locf(@1), locl(@2), "no test expression defined in ST 'CASE' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8331
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8332
| CASE error OF case_element_list END_CASE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8333
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8334
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid test expression defined for ST 'CASE' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8335
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8336
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8337
| CASE error OF case_element_list ELSE statement_list END_CASE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8338
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8339
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid test expression defined for ST 'CASE' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8340
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8341
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8342
| CASE expression error case_element_list END_CASE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8343
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8344
	 print_err_msg(current_filename, locf(@2), locl(@4), "expecting 'OF' after test expression in ST 'CASE' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8345
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8346
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8347
| CASE expression error case_element_list ELSE statement_list END_CASE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8348
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8349
	 print_err_msg(current_filename, locf(@2), locl(@4), "expecting 'OF' after test expression in ST 'CASE' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8350
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8351
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8352
| CASE expression OF END_CASE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8353
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8354
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8355
	 print_err_msg(current_filename, locf(@3), locl(@4), "no case element(s) defined after 'OF' in ST 'CASE' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8356
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8357
| CASE expression OF ELSE statement_list END_CASE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8358
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8359
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8360
	 print_err_msg(current_filename, locf(@3), locl(@4), "no case element(s) defined after 'OF' in ST 'CASE' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8361
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8362
| CASE expression OF error END_CASE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8363
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8364
	 print_err_msg(current_filename, locf(@3), locl(@5), "invalid case element(s) defined after 'OF' in ST 'CASE' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8365
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8366
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8367
| CASE expression OF error ELSE statement_list END_CASE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8368
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8369
	 print_err_msg(current_filename, locf(@3), locl(@5), "invalid case element(s) defined after 'OF' in ST 'CASE' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8370
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8371
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8372
| CASE expression OF case_element_list ELSE END_CASE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8373
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8374
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8375
	 print_err_msg(current_filename, locf(@5), locl(@6), "no statement defined after 'ELSE' in ST 'CASE' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8376
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8377
| CASE expression OF case_element_list ELSE error END_CASE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8378
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8379
	 print_err_msg(current_filename, locf(@5), locl(@7), "invalid statement defined after 'ELSE' in ST 'CASE' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8380
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8381
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8382
| CASE error END_CASE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8383
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8384
	 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in ST 'CASE' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8385
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8386
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8387
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8388
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8389
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8390
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8391
/* helper symbol for case_statement */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8392
case_element_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8393
  case_element
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8394
	{$$ = new case_element_list_c(locloc(@$)); $$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8395
| case_element_list case_element
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8396
	{$$ = $1; $$->add_element($2);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8397
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8398
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8399
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8400
case_element:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8401
  case_list ':' statement_list
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8402
	{$$ = new case_element_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8403
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8404
| case_list statement_list
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8405
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8406
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8407
	 print_err_msg(current_filename, locf(@1), locl(@2), "':' missing after case list in ST 'CASE' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8408
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8409
| case_list ':' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8410
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8411
	 print_err_msg(current_filename, locf(@1), locl(@2), "invalid statement in case element of ST 'CASE' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8412
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8413
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8414
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8415
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8416
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8417
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8418
case_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8419
  case_list_element
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8420
	{$$ = new case_list_c(locloc(@$)); $$->add_element($1);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8421
| case_list ',' case_list_element
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8422
	{$$ = $1; $$->add_element($3);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8423
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8424
| case_list ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8425
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8426
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid case in case list of ST parameter assignment list.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8427
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8428
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8429
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8430
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8431
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8432
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8433
case_list_element:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8434
  signed_integer
78
aead91ec37cd removing 'identifier' from definition of symbolic_variable
mario
parents: 77
diff changeset
  8435
| subrange
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8436
| enumerated_value
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8437
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8438
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8439
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8440
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8441
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8442
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8443
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8444
/* B 3.2.4 Iteration Statements */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8445
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8446
iteration_statement:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8447
  for_statement
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8448
| while_statement
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8449
| repeat_statement
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8450
| exit_statement
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8451
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8452
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8453
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8454
for_statement:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8455
  FOR control_variable ASSIGN expression TO expression BY expression DO statement_list END_FOR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8456
	{$$ = new for_statement_c($2, $4, $6, $8, $10, locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8457
| FOR control_variable ASSIGN expression TO expression DO statement_list END_FOR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8458
	{$$ = new for_statement_c($2, $4, $6, NULL, $8, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8459
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8460
| FOR ASSIGN expression TO expression BY expression DO statement_list END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8461
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8462
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8463
	 print_err_msg(current_filename, locf(@1), locl(@2), "no control variable defined in ST 'FOR' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8464
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8465
| FOR ASSIGN expression TO expression DO statement_list END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8466
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8467
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8468
	 print_err_msg(current_filename, locf(@1), locl(@2), "no control variable defined in ST 'FOR' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8469
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8470
| FOR error ASSIGN expression TO expression BY expression DO statement_list END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8471
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8472
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid control variable defined for ST 'FOR' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8473
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8474
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8475
| FOR error ASSIGN expression TO expression DO statement_list END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8476
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8477
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid control variable defined for ST 'FOR' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8478
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8479
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8480
| FOR control_variable expression TO expression BY expression DO statement_list END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8481
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8482
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8483
	 print_err_msg(current_filename, locf(@2), locl(@3), "':=' missing between control variable and start expression in ST 'FOR' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8484
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8485
| FOR control_variable expression TO expression DO statement_list END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8486
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8487
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8488
	 print_err_msg(current_filename, locf(@2), locl(@3), "':=' missing between control variable and start expression in ST 'FOR' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8489
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8490
| FOR control_variable error expression TO expression BY expression DO statement_list END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8491
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8492
	 print_err_msg(current_filename, locf(@2), locl(@4), "expecting ':=' between control variable and start expression in ST 'FOR' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8493
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8494
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8495
| FOR control_variable error expression TO expression DO statement_list END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8496
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8497
	 print_err_msg(current_filename, locf(@2), locl(@4), "expecting ':=' between control variable and start expression in ST 'FOR' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8498
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8499
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8500
| FOR control_variable ASSIGN TO expression BY expression DO statement_list END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8501
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8502
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8503
	 print_err_msg(current_filename, locf(@3), locl(@4), "no start expression defined in ST 'FOR' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8504
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8505
| FOR control_variable ASSIGN TO expression DO statement_list END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8506
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8507
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8508
	 print_err_msg(current_filename, locf(@3), locl(@4), "no start expression defined in ST 'FOR' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8509
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8510
| FOR control_variable ASSIGN error TO expression BY expression DO statement_list END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8511
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8512
	 print_err_msg(current_filename, locf(@3), locl(@5), "invalid start expression defined in ST 'FOR' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8513
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8514
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8515
| FOR control_variable ASSIGN error TO expression DO statement_list END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8516
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8517
	 print_err_msg(current_filename, locf(@3), locl(@5), "invalid start expression in ST 'FOR' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8518
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8519
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8520
| FOR control_variable ASSIGN expression error expression BY expression DO statement_list END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8521
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8522
	 print_err_msg(current_filename, locf(@4), locl(@6), "expecting 'TO' between start expression and end expression in ST 'FOR' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8523
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8524
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8525
| FOR control_variable ASSIGN expression error expression DO statement_list END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8526
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8527
	 print_err_msg(current_filename, locf(@4), locl(@6), "expecting 'TO' between start expression and end expression in ST 'FOR' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8528
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8529
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8530
| FOR control_variable ASSIGN expression TO expression error expression DO statement_list END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8531
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8532
	 print_err_msg(current_filename, locf(@6), locl(@8), "expecting 'BY' between end expression and step expression in ST 'FOR' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8533
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8534
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8535
| FOR control_variable ASSIGN expression TO expression BY expression error statement_list END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8536
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8537
	 print_err_msg(current_filename, locf(@8), locl(@10), "expecting 'DO' after step expression in ST 'FOR' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8538
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8539
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8540
| FOR control_variable ASSIGN expression TO expression error statement_list END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8541
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8542
	 print_err_msg(current_filename, locf(@6), locl(@8), "expecting 'DO' after end expression in ST 'FOR' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8543
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8544
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8545
| FOR control_variable ASSIGN expression TO expression BY expression DO END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8546
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8547
	 print_err_msg(current_filename, locf(@9), locl(@10), "no statement(s) defined after 'DO' in ST 'FOR' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8548
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8549
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8550
| FOR control_variable ASSIGN expression TO expression DO END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8551
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8552
	 print_err_msg(current_filename, locf(@7), locl(@8), "no statement(s) defined after 'DO' in ST 'FOR' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8553
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8554
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8555
| FOR control_variable ASSIGN expression TO expression BY expression DO error END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8556
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8557
	 print_err_msg(current_filename, locf(@9), locl(@11), "invalid statement(s) defined after 'DO' in ST 'FOR' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8558
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8559
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8560
| FOR control_variable ASSIGN expression TO expression DO error END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8561
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8562
	 print_err_msg(current_filename, locf(@7), locl(@9), "invalid statement(s) defined after 'DO' in ST 'FOR' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8563
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8564
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8565
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8566
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8567
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8568
/* The spec has the syntax
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8569
 * control_variable: identifier;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8570
 * but then defines the semantics of control_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8571
 * (Section 3.3.2.4) as being of an integer type
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8572
 * (e.g., SINT, INT, or DINT).
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8573
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8574
 * Obviously this presuposes that the control_variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8575
 * must have been declared in some VAR .. END_VAR
79
7417b346e5a3 fixing buf in FOR control variable.
mario
parents: 78
diff changeset
  8576
 * We must therefore change the syntax to read
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8577
 * control_variable: prev_declared_variable_name;
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  8578
 * 
79
7417b346e5a3 fixing buf in FOR control variable.
mario
parents: 78
diff changeset
  8579
 * If we don't, then the correct use of any previosuly declared 
7417b346e5a3 fixing buf in FOR control variable.
mario
parents: 78
diff changeset
  8580
 * variable would result in an incorrect syntax error
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8581
*/
79
7417b346e5a3 fixing buf in FOR control variable.
mario
parents: 78
diff changeset
  8582
control_variable: prev_declared_variable_name {$$ = $1;};
7417b346e5a3 fixing buf in FOR control variable.
mario
parents: 78
diff changeset
  8583
// control_variable: identifier {$$ = $1;};
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8584
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8585
/* Integrated directly into for_statement */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8586
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8587
for_list:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8588
  expression TO expression [BY expression]
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8589
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8590
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8591
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8592
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8593
while_statement:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8594
  WHILE expression DO statement_list END_WHILE
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8595
	{$$ = new while_statement_c($2, $4, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8596
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8597
| WHILE DO statement_list END_WHILE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8598
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8599
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8600
	 print_err_msg(current_filename, locf(@1), locl(@2), "no test expression defined in ST 'WHILE' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8601
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8602
| WHILE error DO statement_list END_WHILE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8603
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8604
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid test expression defined for ST 'WHILE' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8605
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8606
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8607
| WHILE expression error statement_list END_WHILE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8608
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8609
	 print_err_msg(current_filename, locf(@2), locl(@4), "expecting 'DO' after test expression in ST 'WHILE' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8610
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8611
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8612
| WHILE expression DO END_WHILE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8613
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8614
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8615
	 print_err_msg(current_filename, locf(@3), locl(@4), "no statement(s) defined after 'DO' in ST 'WHILE' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8616
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8617
| WHILE expression DO error END_WHILE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8618
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8619
	 print_err_msg(current_filename, locf(@3), locl(@5), "invalid statement(s) defined after 'DO' in ST 'WHILE' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8620
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8621
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8622
| WHILE error END_WHILE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8623
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8624
	 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in ST 'WHILE' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8625
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8626
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8627
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8628
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8629
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8630
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8631
repeat_statement:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8632
  REPEAT statement_list UNTIL expression END_REPEAT
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8633
	{$$ = new repeat_statement_c($2, $4, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8634
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8635
| REPEAT UNTIL expression END_REPEAT
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8636
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8637
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8638
	 print_err_msg(current_filename, locf(@1), locl(@2), "no statement(s) defined after 'REPEAT' in ST 'REPEAT' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8639
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8640
| REPEAT error UNTIL expression END_REPEAT
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8641
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8642
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid statement(s) defined after 'REPEAT' for ST 'REPEAT' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8643
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8644
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8645
| REPEAT statement_list UNTIL END_REPEAT
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8646
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8647
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8648
	 print_err_msg(current_filename, locf(@3), locl(@4), "no test expression defined after 'UNTIL' in ST 'REPEAT' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8649
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8650
| REPEAT statement_list UNTIL error END_REPEAT
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8651
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8652
	 print_err_msg(current_filename, locf(@3), locl(@5), "invalid test expression defined after 'UNTIL' in ST 'REPEAT' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8653
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8654
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8655
| REPEAT error END_REPEAT
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8656
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8657
	 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in ST 'REPEAT' statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8658
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8659
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8660
/* ERROR_CHECK_END */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8661
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8662
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8663
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8664
exit_statement:
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8665
  EXIT	{$$ = new exit_statement_c(locloc(@$));}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8666
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8667
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8668
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8669
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8670
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8671
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8672
%%
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8673
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8674
#include <stdio.h>	/* required for printf() */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8675
#include <errno.h>
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8676
#include "../util/symtable.hh"
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8677
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8678
/* variables defined in code generated by flex... */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8679
extern FILE *yyin;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8680
extern int yylineno;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8681
15
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8682
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8683
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8684
/* A global flag used to tell the parser if overloaded funtions should be allowed.
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8685
 * The IEC 61131-3 standard allows overloaded funtions in the standard library,
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8686
 * but disallows them in user code...
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8687
 */
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8688
bool allow_function_overloading = false;
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8689
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8690
/* A pointer to the root of the parsing tree that will be generated 
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8691
 * by bison.
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8692
 */
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8693
symbol_c *tree_root;
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8694
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8695
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8696
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8697
/* The following function is called automatically by bison whenever it comes across
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8698
 * an error. Unfortunately it calls this function before executing the code that handles
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8699
 * the error itself, so we cannot print out the correct line numbers of the error location
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8700
 * over here.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8701
 * Our solution is to store the current error message in a global variable, and have all
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8702
 * error action handlers call the function print_err_msg() after setting the location
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8703
 * (line number) variable correctly.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8704
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8705
const char *current_error_msg;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8706
void yyerror (const char *error_msg) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8707
  current_error_msg = error_msg;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8708
/* fprintf(stderr, "error %d: %s\n", yynerrs // global variable //, error_msg); */
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8709
/*  print_include_stack(); */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8710
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8711
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8712
95
b119b1db0a7a Changing format of error reporting.
mario
parents: 94
diff changeset
  8713
void print_err_msg(const char *filename,
b119b1db0a7a Changing format of error reporting.
mario
parents: 94
diff changeset
  8714
                   int first_line,
b119b1db0a7a Changing format of error reporting.
mario
parents: 94
diff changeset
  8715
                   int first_column,
b119b1db0a7a Changing format of error reporting.
mario
parents: 94
diff changeset
  8716
                   int last_line,
b119b1db0a7a Changing format of error reporting.
mario
parents: 94
diff changeset
  8717
                   int last_column,
b119b1db0a7a Changing format of error reporting.
mario
parents: 94
diff changeset
  8718
                   const char *additional_error_msg) {
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8719
  fprintf(stderr, "%s:%d: error : %s\n", filename, first_line, additional_error_msg);
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8720
  //fprintf(stderr, "error %d: %s\n", yynerrs /* a global variable */, additional_error_msg);
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8721
  print_include_stack();
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8722
  //fprintf(stderr, "%s(%d-%d): %s\n", filename, first_line, last_line, current_error_msg);
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8723
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8724
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8725
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8726
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8727
/* convert between an il_operator to a function name */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8728
/* This a kludge!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8729
 * It is required because our language requires more than one
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8730
 * look ahead token, and bison only works with one!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8731
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8732
#define op_2_str(op, str) {\
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8733
  op ## _operator_c *ptr = dynamic_cast<op ## _operator_c *>(il_operator); \
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8734
  if (ptr != NULL) name = str; \
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8735
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8736
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8737
/* NOTE: this code is very ugly and un-eficient, but I (Mario) have many
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8738
 *       more things to worry about right now, so just let it be...
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8739
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8740
symbol_c *il_operator_c_2_identifier_c(symbol_c *il_operator) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8741
  const char *name = NULL;
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8742
  identifier_c *res;
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8743
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8744
  op_2_str(NOT, "NOT");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8745
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8746
  op_2_str(AND, "AND");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8747
  op_2_str(OR, "OR");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8748
  op_2_str(XOR, "XOR");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8749
  op_2_str(ADD, "ADD");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8750
  op_2_str(SUB, "SUB");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8751
  op_2_str(MUL, "MUL");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8752
  op_2_str(DIV, "DIV");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8753
  op_2_str(MOD, "MOD");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8754
  op_2_str(GT, "GT");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8755
  op_2_str(GE, "GE");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8756
  op_2_str(EQ, "EQ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8757
  op_2_str(LT, "LT");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8758
  op_2_str(LE, "LE");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8759
  op_2_str(NE, "NE");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8760
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8761
  op_2_str(LD, "LD");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8762
  op_2_str(LDN, "LDN");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8763
  op_2_str(ST, "ST");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8764
  op_2_str(STN, "STN");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8765
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8766
  op_2_str(S, "S");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8767
  op_2_str(R, "R");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8768
  op_2_str(S1, "S1");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8769
  op_2_str(R1, "R1");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8770
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8771
  op_2_str(CLK, "CLK");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8772
  op_2_str(CU, "CU");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8773
  op_2_str(CD, "CD");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8774
  op_2_str(PV, "PV");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8775
  op_2_str(IN, "IN");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8776
  op_2_str(PT, "PT");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8777
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8778
  op_2_str(ANDN, "ANDN");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8779
  op_2_str(ORN, "ORN");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8780
  op_2_str(XORN, "XORN");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8781
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8782
  op_2_str(ADD, "ADD");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8783
  op_2_str(SUB, "SUB");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8784
  op_2_str(MUL, "MUL");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8785
  op_2_str(DIV, "DIV");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8786
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8787
  op_2_str(GT, "GT");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8788
  op_2_str(GE, "GE");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8789
  op_2_str(EQ, "EQ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8790
  op_2_str(LT, "LT");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8791
  op_2_str(LE, "LE");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8792
  op_2_str(NE, "NE");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8793
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8794
  op_2_str(CAL, "CAL");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8795
  op_2_str(CALC, "CALC");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8796
  op_2_str(CALCN, "CALCN");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8797
  op_2_str(RET, "RET");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8798
  op_2_str(RETC, "RETC");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8799
  op_2_str(RETCN, "RETCN");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8800
  op_2_str(JMP, "JMP");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8801
  op_2_str(JMPC, "JMPC");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8802
  op_2_str(JMPCN, "JMPCN");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8803
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8804
  if (name == NULL)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8805
    ERROR;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8806
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8807
  res = new identifier_c(strdup(name), 
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8808
                         il_operator->first_line,
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8809
                         il_operator->first_column,
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8810
                         il_operator->last_line,
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8811
                         il_operator->last_column
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8812
                        );
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8813
  free(il_operator);
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8814
  return res;
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8815
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8816
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8817
40
873a5b60a7ea Fixed -I library include path behavior + removed old lib implementation + added generated lib func names to stage 1_2 + added Makefile.Linux
etisserant
parents: 28
diff changeset
  8818
#include "standard_function_names.c"
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8819
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8820
const char *standard_function_block_names[] = {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8821
// 2.5.2.3.1  Bistable elements
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8822
//   Table 34 - Standard bistable function blocks
73
0e623bbdee95 fixing infinite error loops at library level, and ...
mario
parents: 68
diff changeset
  8823
"SR","RS",
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8824
// 2.5.2.3.2  Edge detection
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8825
//   Table 35 - Standard edge detection function blocks
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8826
"R_TRIG","F_TRIG",
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8827
// 2.5.2.3.3  Counters
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8828
//   Table 36 - Standard counter function blocks
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8829
"CTU","CTU_DINT","CTU_LINT","CTU_UDINT","CTU_ULINT",
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8830
"CTD","CTD_DINT","CTD_LINT","CTD_UDINT","CTD_ULINT",
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8831
"CTUD","CTUD_DINT","CTUD_LINT","CTUD_ULINT",
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8832
// 2.5.2.3.4  Timers
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8833
//   Table 37 - Standard timer function blocks
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8834
"TP","TON","TOF",
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8835
/* end of array marker! Do not remove! */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8836
NULL
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8837
};
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8838
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8839
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8840
#define LIBFILE "ieclib.txt"
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8841
#define DEF_LIBFILENAME LIBDIRECTORY "/" LIBFILE
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8842
40
873a5b60a7ea Fixed -I library include path behavior + removed old lib implementation + added generated lib func names to stage 1_2 + added Makefile.Linux
etisserant
parents: 28
diff changeset
  8843
extern const char *INCLUDE_DIRECTORIES[];
873a5b60a7ea Fixed -I library include path behavior + removed old lib implementation + added generated lib func names to stage 1_2 + added Makefile.Linux
etisserant
parents: 28
diff changeset
  8844
15
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8845
int stage1_2__(const char *filename, const char *includedir, symbol_c **tree_root_ref) {
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8846
  FILE *in_file = NULL, *lib_file = NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8847
  char *libfilename = NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8848
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8849
  if((in_file = fopen(filename, "r")) == NULL) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8850
    char *errmsg = strdup2("Error opening main file ", filename);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8851
    perror(errmsg);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8852
    free(errmsg);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8853
    return -1;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8854
  }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8855
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8856
  if (includedir != NULL) {
40
873a5b60a7ea Fixed -I library include path behavior + removed old lib implementation + added generated lib func names to stage 1_2 + added Makefile.Linux
etisserant
parents: 28
diff changeset
  8857
    INCLUDE_DIRECTORIES[0] = includedir;
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8858
  }
40
873a5b60a7ea Fixed -I library include path behavior + removed old lib implementation + added generated lib func names to stage 1_2 + added Makefile.Linux
etisserant
parents: 28
diff changeset
  8859
  if ((libfilename = strdup3(INCLUDE_DIRECTORIES[0], "/", LIBFILE)) == NULL) {
873a5b60a7ea Fixed -I library include path behavior + removed old lib implementation + added generated lib func names to stage 1_2 + added Makefile.Linux
etisserant
parents: 28
diff changeset
  8860
    fprintf (stderr, "Out of memory. Bailing out!\n");
873a5b60a7ea Fixed -I library include path behavior + removed old lib implementation + added generated lib func names to stage 1_2 + added Makefile.Linux
etisserant
parents: 28
diff changeset
  8861
    return -1;
873a5b60a7ea Fixed -I library include path behavior + removed old lib implementation + added generated lib func names to stage 1_2 + added Makefile.Linux
etisserant
parents: 28
diff changeset
  8862
  }
873a5b60a7ea Fixed -I library include path behavior + removed old lib implementation + added generated lib func names to stage 1_2 + added Makefile.Linux
etisserant
parents: 28
diff changeset
  8863
873a5b60a7ea Fixed -I library include path behavior + removed old lib implementation + added generated lib func names to stage 1_2 + added Makefile.Linux
etisserant
parents: 28
diff changeset
  8864
  if((lib_file = fopen(libfilename, "r")) == NULL) {
873a5b60a7ea Fixed -I library include path behavior + removed old lib implementation + added generated lib func names to stage 1_2 + added Makefile.Linux
etisserant
parents: 28
diff changeset
  8865
    char *errmsg = strdup2("Error opening library file ", libfilename);
873a5b60a7ea Fixed -I library include path behavior + removed old lib implementation + added generated lib func names to stage 1_2 + added Makefile.Linux
etisserant
parents: 28
diff changeset
  8866
    perror(errmsg);
873a5b60a7ea Fixed -I library include path behavior + removed old lib implementation + added generated lib func names to stage 1_2 + added Makefile.Linux
etisserant
parents: 28
diff changeset
  8867
    free(errmsg);
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8868
  }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8869
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8870
  if (lib_file == NULL) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8871
    /* we give up... */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8872
    free(libfilename);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8873
    fclose(in_file);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8874
    return -1;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8875
  }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8876
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8877
  /* first parse the standard library file... */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8878
  yyin = lib_file;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8879
  yylineno = 1;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8880
  allow_function_overloading = true;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8881
  current_filename = libfilename;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8882
  if (yyparse() != 0)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8883
      ERROR;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8884
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8885
  if (yynerrs > 0) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8886
    fprintf (stderr, "\nFound %d error(s) in %s. Bailing out!\n", yynerrs /* global variable */, libfilename);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8887
    ERROR;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8888
  }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8889
  free(libfilename);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8890
  fclose(lib_file);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8891
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8892
  /* if by any chance the library is not complete, we
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8893
   * now add the missing reserved keywords to the list!!!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8894
   */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8895
  for(int i = 0; standard_function_names[i] != NULL; i++)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8896
    if (library_element_symtable.find_value(standard_function_names[i]) ==
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8897
        library_element_symtable.end_value())
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8898
      library_element_symtable.insert(standard_function_names[i], standard_function_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8899
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8900
  for(int i = 0; standard_function_block_names[i] != NULL; i++)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8901
    if (library_element_symtable.find_value(standard_function_block_names[i]) ==
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8902
        library_element_symtable.end_value())
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8903
      library_element_symtable.insert(standard_function_block_names[i], standard_function_block_name_token);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8904
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8905
#if YYDEBUG
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8906
  yydebug = 1;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8907
#endif
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8908
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8909
  /* now parse the input file... */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8910
  yyin = in_file;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8911
  yylineno = 1;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8912
  allow_function_overloading = false;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8913
  current_filename = filename;
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8914
  {int res;
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8915
    if ((res = yyparse()) != 0) {
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8916
      fprintf (stderr, "\nInternal error while parsing file - yyparse() returned %d. Bailing out!\n", res);
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8917
      ERROR;
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8918
    }
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8919
  }
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8920
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8921
  if (yynerrs > 0) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8922
    fprintf (stderr, "\nFound %d error(s). Bailing out!\n", yynerrs /* global variable */);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8923
    exit(EXIT_FAILURE);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8924
  }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8925
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8926
  if (tree_root_ref != NULL)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8927
    *tree_root_ref = tree_root;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8928
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8929
  fclose(in_file);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8930
  return 0;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8931
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8932
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8933
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8934