stage1_2/iec.y
author lbessard
Thu, 17 Jul 2008 19:07:28 +0200
changeset 131 f55ef301e14c
parent 121 9e8ce092e169
child 133 fff75b8283be
permissions -rwxr-xr-x
Adding some human-readable error messages
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
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2514
| type_declaration_list ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2515
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2516
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2517
	 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
  2518
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2519
/* 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
  2520
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2521
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2522
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
  2523
  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
  2524
| 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
  2525
| 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
  2526
| 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
  2527
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2528
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2529
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
  2530
  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
  2531
| 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
  2532
| 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
  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
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
/*  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
  2537
  identifier ':' simple_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2538
	{$$ = 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
  2539
	 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
  2540
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2541
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2542
| identifier simple_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2543
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2544
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2545
	 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
  2546
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2547
| identifier ':' identifier
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(@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
  2551
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2552
| identifier ':' error
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
	 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
  2555
	 yyerrok;
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
/* 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
  2558
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2559
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2560
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2561
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
  2562
  simple_specification
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2563
  /* The following commented line was changed to the 
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2564
   * 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
  2565
   * 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
  2566
   * 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
  2567
   */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2568
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2569
| 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
  2570
	{$$ = 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
  2571
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2572
| elementary_type_name ASSIGN constant
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2573
	{$$ = 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
  2574
| prev_declared_simple_type_name ASSIGN constant
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2575
	{$$ = new simple_spec_init_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2576
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2577
| elementary_type_name constant
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2578
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2579
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2580
	 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
  2581
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2582
| prev_declared_simple_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
| identifier ASSIGN 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(@1), "unknown type defined in specification.");
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
/* 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
  2593
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2594
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2595
/* 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
  2596
 * 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
  2597
 * 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
  2598
 * 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
  2599
 * 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
  2600
 * 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
  2601
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2602
 * 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
  2603
 * 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
  2604
 * 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
  2605
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2606
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
  2607
// 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
  2608
  elementary_type_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2609
	{$$ = 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
  2610
| prev_declared_simple_type_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2611
	{$$ = 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
  2612
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2613
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2614
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2615
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
  2616
/*  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
  2617
  identifier ':' subrange_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2618
	{$$ = 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
  2619
	 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
  2620
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2621
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2622
| identifier subrange_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2623
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2624
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2625
	 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
  2626
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2627
/* 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
  2628
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2629
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2630
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
  2631
  subrange_specification
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2632
	{$$ = 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
  2633
| subrange_specification ASSIGN signed_integer
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2634
	{$$ = new subrange_spec_init_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2635
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2636
| subrange_specification signed_integer
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2637
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2638
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2639
	 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
  2640
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2641
/* 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
  2642
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2643
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2644
subrange_specification:
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2645
  integer_type_name '(' subrange ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2646
	{$$ = new subrange_specification_c($1, $3, locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2647
| prev_declared_subrange_type_name
98
d0cdf1d00b74 Adding support for derived data types.
lbessard
parents: 96
diff changeset
  2648
  {$$ = new subrange_specification_c($1, NULL, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2649
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2650
| integer_type_name '(' ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2651
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2652
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2653
	 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
  2654
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2655
| integer_type_name '(' error ')'
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
	 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
  2658
	 yyerrok;
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 '(' subrange 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(@3), locl(@3), "')' missing after 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
/* 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
  2666
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2667
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2668
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2669
subrange:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2670
  signed_integer DOTDOT signed_integer
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2671
	{$$ = new subrange_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2672
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2673
| signed_integer signed_integer
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2674
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2675
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2676
	 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
  2677
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2678
| signed_integer error 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), "expecting '..' 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 DOTDOT error
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), "invalid value for upper bound 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
/* 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
  2689
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2690
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2691
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
  2692
/*  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
  2693
  identifier ':' enumerated_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2694
	{$$ = 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
  2695
	 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
  2696
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2697
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2698
| identifier enumerated_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2699
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2700
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2701
	 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
  2702
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2703
/* 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
  2704
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2705
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2706
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2707
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
  2708
  enumerated_specification
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2709
	{$$ = 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
  2710
| enumerated_specification ASSIGN enumerated_value
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2711
	{$$ = new enumerated_spec_init_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2712
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2713
| enumerated_specification enumerated_value
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2714
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2715
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2716
	 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
  2717
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2718
/* 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
  2719
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2720
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2721
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
  2722
  '(' 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
  2723
	{$$ = $2;}
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2724
| prev_declared_enumerated_type_name
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2725
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2726
| '(' ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2727
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2728
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2729
	 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
  2730
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2731
| '(' error ')'
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
	 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
  2734
	 yyerrok;
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
| '(' enumerated_value_list 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(@2), locl(@2), "')' missing at the end of 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
/* 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
  2742
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2743
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2744
/* 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
  2745
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
  2746
  enumerated_value
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2747
	{$$ = 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
  2748
| 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
  2749
	{$$ = $1; $$->add_element($3);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2750
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2751
| enumerated_value_list enumerated_value
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2752
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2753
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2754
	 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
  2755
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2756
| enumerated_value_list ',' error
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
	 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
  2759
	 yyerrok;
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
/* 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
  2762
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2763
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2764
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2765
enumerated_value:
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  2766
  identifier 
121
9e8ce092e169 Adding support for POU struct definition in POUS.h
lbessard
parents: 118
diff changeset
  2767
  {$$ = 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
  2768
| prev_declared_enumerated_type_name '#' any_identifier
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2769
	{$$ = new enumerated_value_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2770
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2771
| prev_declared_enumerated_type_name any_identifier
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2772
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2773
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2774
	 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
  2775
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2776
| prev_declared_enumerated_type_name error 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
	 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
  2779
	 yyerrok;
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
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(@2), locl(@2), "invalid value for 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
| identifier '#' any_identifier
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
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2789
	 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
  2790
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2791
/* 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
  2792
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2793
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2794
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  2795
/*
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  2796
enumerated_value_without_identifier:
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  2797
  prev_declared_enumerated_type_name '#' any_identifier
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2798
	{$$ = new enumerated_value_c($1, $3, locloc(@$));}
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
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
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2802
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2803
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
  2804
/*  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
  2805
  identifier ':' array_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2806
	{$$ = 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
  2807
	 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
  2808
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2809
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2810
| identifier array_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2811
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2812
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2813
	 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
  2814
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2815
/* 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
  2816
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2817
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2818
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
  2819
  array_specification
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2820
	{$$ = 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
  2821
| array_specification ASSIGN array_initialization
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2822
	{$$ = new array_spec_init_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2823
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2824
| array_specification array_initialization
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2825
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2826
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2827
	 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
  2828
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2829
/* 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
  2830
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2831
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2832
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2833
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
  2834
  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
  2835
| ARRAY '[' array_subrange_list ']' OF non_generic_type_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2836
	{$$ = new array_specification_c($3, $6, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2837
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2838
| ARRAY array_subrange_list ']' OF non_generic_type_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2839
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2840
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2841
	 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
  2842
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2843
| ARRAY error 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
	 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
  2846
	 yyerrok;
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 '[' ']' 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
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2851
	 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
  2852
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2853
| ARRAY '[' error ']' 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
	 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
  2856
	 yyerrok;
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 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
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2861
	 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
  2862
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2863
| ARRAY error 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
	 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
  2866
	 yyerrok;
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 '[' array_subrange_list 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
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2871
	 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
  2872
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2873
| ARRAY '[' array_subrange_list error 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(@5), "expecting '[' 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 ']' 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(@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
  2882
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2883
| ARRAY '[' array_subrange_list ']' error 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
	 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
  2886
	 yyerrok;
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 ']' OF error
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(@1), locl(@3), "no itme data type defined 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
/* 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
  2894
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2895
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2896
/* 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
  2897
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
  2898
  subrange
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2899
	{$$ = 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
  2900
| array_subrange_list ',' subrange
98
d0cdf1d00b74 Adding support for derived data types.
lbessard
parents: 96
diff changeset
  2901
	{$$ = $1; $$->add_element($3);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2902
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2903
| array_subrange_list subrange
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2904
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2905
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2906
	 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
  2907
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2908
| array_subrange_list ',' error
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
	 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
  2911
	 yyerrok;
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
/* 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
  2914
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2915
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2916
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2917
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
  2918
  '[' 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
  2919
	{$$ = $2;}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2920
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2921
| '[' ']'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2922
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2923
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2924
	 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
  2925
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2926
| '[' error ']'
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
	 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
  2929
	 yyerrok;
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
| '[' array_initial_elements_list 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), "']' missing at the end of 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
/* 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
  2937
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2938
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2939
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2940
/* 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
  2941
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
  2942
  array_initial_elements
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2943
	{$$ = 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
  2944
| 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
  2945
	{$$ = $1; $$->add_element($3);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2946
/* ERROR_CHECK_BEGIN 
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2947
| array_initial_elements_list ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2948
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2949
	 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
  2950
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2951
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2952
/* 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
  2953
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2954
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2955
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2956
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
  2957
  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
  2958
| integer '(' ')'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2959
| integer '(' array_initial_element ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2960
	{$$ = new array_initial_elements_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2961
/* ERROR_CHECK_BEGIN 
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2962
| integer '(' error ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2963
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2964
	 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
  2965
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2966
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2967
| integer '(' array_initial_element 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), "')' 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
  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
/* 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
  2973
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2974
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2975
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2976
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
  2977
  constant
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2978
| 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
  2979
| 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
  2980
| 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
  2981
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2982
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2983
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2984
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2985
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
  2986
/*  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
  2987
  identifier ':' structure_specification
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  2988
	{$$ = 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
  2989
	 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
  2990
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2991
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2992
| identifier structure_specification
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2993
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2994
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2995
	 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
  2996
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  2997
/* 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
  2998
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2999
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3000
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3001
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
  3002
  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
  3003
| 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
  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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3007
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
  3008
  prev_declared_structure_type_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3009
	{$$ = 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
  3010
| prev_declared_structure_type_name ASSIGN structure_initialization
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3011
	{$$ = new initialized_structure_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3012
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3013
| prev_declared_structure_type_name structure_initialization
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3014
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3015
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3016
	 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
  3017
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3018
| identifier ASSIGN 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), "unknown type name for 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
/* 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
  3024
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3025
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3026
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3027
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
  3028
  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
  3029
	{$$ = $2;}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3030
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3031
| STRUCT END_STRUCT
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3032
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3033
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3034
	 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
  3035
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3036
| STRUCT error structure_element_declaration_list 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
	 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
  3039
	 yyerrok;
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 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), "unknown error 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
/* 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
  3047
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3048
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3049
/* 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
  3050
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
  3051
  structure_element_declaration ';'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3052
	{$$ = 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
  3053
| 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
  3054
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3055
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3056
| structure_element_declaration error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3057
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3058
	 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
  3059
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3060
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3061
| structure_element_declaration_list 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(@2), locl(@2), "';' 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 ';'
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
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3069
	 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
  3070
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3071
/* 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
  3072
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3073
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3074
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3075
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
  3076
  structure_element_name ':' simple_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3077
	{$$ = 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
  3078
| structure_element_name ':' subrange_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3079
	{$$ = 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
  3080
| structure_element_name ':' enumerated_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3081
	{$$ = 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
  3082
| structure_element_name ':' array_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3083
	{$$ = 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
  3084
| structure_element_name ':' initialized_structure
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3085
	{$$ = new structure_element_declaration_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3086
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3087
| structure_element_name simple_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3088
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3089
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3090
	 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
  3091
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3092
| structure_element_name subrange_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3093
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3094
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3095
	 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
  3096
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3097
| structure_element_name enumerated_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 enumerated 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 array_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 array 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 initialized_structure
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 structure 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 ':' identifier
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), "unknown variable type defined in structure element declaration.");
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 ':' error
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
	 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
  3120
	 yyerrok;
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
/* 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
  3123
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3124
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3125
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3126
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
  3127
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3128
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3129
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
  3130
  '(' 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
  3131
	{$$ = $2;}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3132
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3133
| '(' error ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3134
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3135
	 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
  3136
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3137
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3138
| '(' structure_element_initialization_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3139
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3140
	 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
  3141
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3142
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3143
/* 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
  3144
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3145
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3146
/* 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
  3147
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
  3148
  structure_element_initialization
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3149
	{$$ = 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
  3150
| 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
  3151
	{$$ = $1; $$->add_element($3);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3152
/* ERROR_CHECK_BEGIN 
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3153
| structure_element_initialization_list structure_element_initialization
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3154
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3155
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3156
	 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
  3157
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3158
| structure_element_initialization_list ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3159
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3160
	 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
  3161
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3162
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3163
/* 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
  3164
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3165
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3166
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3167
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
  3168
  structure_element_name ASSIGN constant
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3169
	{$$ = 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
  3170
| structure_element_name ASSIGN enumerated_value
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3171
	{$$ = 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
  3172
| structure_element_name ASSIGN array_initialization
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3173
	{$$ = 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
  3174
| structure_element_name ASSIGN structure_initialization
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3175
	{$$ = new structure_element_initialization_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3176
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3177
| structure_element_name constant
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3178
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3179
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3180
	 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
  3181
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3182
| structure_element_name enumerated_value
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3183
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3184
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3185
	 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
  3186
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3187
| structure_element_name array_initialization
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 array 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 structure_initialization
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 structured 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
/* 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
  3198
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3199
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3200
/* 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
  3201
 *       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
  3202
 *       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
  3203
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3204
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3205
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
  3206
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3207
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3208
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
  3209
/*  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
  3210
  identifier ':' elementary_string_type_name string_type_declaration_size string_type_declaration_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3211
	{$$ = 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
  3212
	 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
  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
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
/* 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
  3218
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
  3219
  '[' integer ']'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3220
	{$$ = $2;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3221
/* REMOVED !! */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3222
//|  /* empty */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3223
//	{$$ = NULL;}
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
/* 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
  3226
 * 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
  3227
 * 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
  3228
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3229
 * 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
  3230
 *  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
  3231
 * 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
  3232
 * 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
  3233
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3234
 * 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
  3235
 * 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
  3236
 * 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
  3237
 * 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
  3238
 * 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
  3239
 * 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
  3240
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3241
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3242
/* 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
  3243
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
  3244
  /* empty */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3245
	{$$ = NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3246
| 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
  3247
	{$$ = $2;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3248
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3249
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
/*********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3253
/* 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
  3254
/*********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3255
variable:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3256
  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
  3257
| 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
  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
symbolic_variable:
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3262
/* 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
  3263
 *         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
  3264
 */
78
aead91ec37cd removing 'identifier' from definition of symbolic_variable
mario
parents: 77
diff changeset
  3265
  prev_declared_fb_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3266
	{$$ = 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
  3267
| prev_declared_global_var_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3268
	{$$ = new symbolic_variable_c($1, locloc(@$));}
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  3269
| prev_declared_variable_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3270
	{$$ = 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
  3271
| multi_element_variable
78
aead91ec37cd removing 'identifier' from definition of symbolic_variable
mario
parents: 77
diff changeset
  3272
/*
aead91ec37cd removing 'identifier' from definition of symbolic_variable
mario
parents: 77
diff changeset
  3273
| identifier
aead91ec37cd removing 'identifier' from definition of symbolic_variable
mario
parents: 77
diff changeset
  3274
	{$$ = new symbolic_variable_c($1, locloc(@$));}
aead91ec37cd removing 'identifier' from definition of symbolic_variable
mario
parents: 77
diff changeset
  3275
*/
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3276
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3277
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3278
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3279
/* 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
  3280
 *       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
  3281
 *       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
  3282
 *       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
  3283
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3284
 *       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
  3285
 *       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
  3286
 *       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
  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
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
  3289
// 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
  3290
  any_identifier
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3291
	{$$ = 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
  3292
| 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
  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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3295
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3296
/* 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
  3297
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
  3298
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3299
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3300
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3301
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3302
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
/* 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
  3305
/********************************************/
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3306
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
  3307
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
/* 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
  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
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
  3315
  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
  3316
| 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
  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
/* 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
  3320
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
  3321
  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
  3322
| 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
  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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3325
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3326
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
  3327
  subscripted_variable '[' subscript_list ']'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3328
	{$$ = 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
  3329
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3330
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3331
/* 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
  3332
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
  3333
  any_subscripted_variable '[' subscript_list ']'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3334
	{$$ = 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
  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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3337
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3338
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
  3339
  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
  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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3342
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3343
/* 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
  3344
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
  3345
  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
  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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3349
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
  3350
  subscript
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3351
	{$$ = 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
  3352
| 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
  3353
	{$$ = $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
  3354
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3355
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
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
  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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3360
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
  3361
  record_variable '.' field_selector
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3362
	{$$ = 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
  3363
;
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
/* 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
  3367
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
  3368
  any_record_variable '.' field_selector
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3369
	{$$ = 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
  3370
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3371
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3372
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
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
  3375
  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
  3376
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3377
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3378
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3379
/* 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
  3380
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
  3381
  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
  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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3385
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
  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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3390
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3391
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
/* 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
  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
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
  3396
  VAR_INPUT            input_declaration_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3397
	{$$ = 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
  3398
| VAR_INPUT RETAIN     input_declaration_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3399
	{$$ = 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
  3400
| VAR_INPUT NON_RETAIN input_declaration_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3401
	{$$ = 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
  3402
/* ERROR_CHECK_BEGIN */
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3403
| VAR_INPUT END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3404
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3405
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3406
	 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
  3407
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3408
| VAR_INPUT RETAIN END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3409
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3410
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3411
	 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
  3412
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3413
| VAR_INPUT NON_RETAIN 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(@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
  3417
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3418
| VAR_INPUT error input_declaration_list 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
	 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
  3421
	 yyerrok;
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 RETAIN error input_declaration_list 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
	 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
  3426
	 yyerrok;
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 NON_RETAIN 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(@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
  3431
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3432
	}
95
b119b1db0a7a Changing format of error reporting.
mario
parents: 94
diff changeset
  3433
| VAR_INPUT error END_VAR
b119b1db0a7a Changing format of error reporting.
mario
parents: 94
diff changeset
  3434
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3435
	 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
  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 RETAIN error 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), "unknown error in 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
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3443
| VAR_INPUT NON_RETAIN error END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3444
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3445
	 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
  3446
	 yyerrok;
b119b1db0a7a Changing format of error reporting.
mario
parents: 94
diff changeset
  3447
	}
b119b1db0a7a Changing format of error reporting.
mario
parents: 94
diff changeset
  3448
/* 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
  3449
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3450
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3451
/* 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
  3452
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
  3453
  input_declaration ';'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3454
	{$$ = 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
  3455
| 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
  3456
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3457
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3458
| input_declaration error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3459
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3460
	 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at end of input variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3461
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3462
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3463
| input_declaration_list input_declaration error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3464
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3465
	 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at end of input variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3466
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3467
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3468
| input_declaration_list ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3469
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3470
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3471
	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after input variable declaration.");
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
/* 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
  3474
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3475
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3476
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3477
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
  3478
  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
  3479
| 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
  3480
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3481
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3482
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3483
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
  3484
  var1_list ':' BOOL R_EDGE
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3485
	{$$ = 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
  3486
| var1_list ':' BOOL F_EDGE
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3487
	{$$ = 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
  3488
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3489
| var1_list BOOL R_EDGE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3490
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3491
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3492
	 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
  3493
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3494
| var1_list BOOL F_EDGE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3495
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3496
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3497
	 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
  3498
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3499
| var1_list ':' BOOL R_EDGE F_EDGE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3500
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3501
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3502
	 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
  3503
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3504
| var1_list ':' 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), "'BOOL' missing in edge declaration.");
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 ':' 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), "'BOOL' missing in edge declaration.");
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
/* 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
  3515
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3516
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3517
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3518
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
  3519
  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
  3520
| 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
  3521
| 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
  3522
| 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
  3523
| 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
  3524
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3525
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3526
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3527
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3528
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3529
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
  3530
  var1_list ':' simple_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3531
	{$$ = 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
  3532
| var1_list ':' subrange_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3533
	{$$ = 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
  3534
| var1_list ':' enumerated_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3535
	{$$ = new var1_init_decl_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3536
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3537
| var1_list simple_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3538
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3539
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3540
	 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
  3541
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3542
| var1_list subrange_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3543
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3544
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3545
	 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
  3546
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3547
| var1_list enumerated_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3548
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3549
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3550
	 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
  3551
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3552
| var1_list ':' identifier
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), "unknown variable type defined in variable declaration.");
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 ':' error
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
	 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
  3560
	 yyerrok;
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
/* 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
  3563
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3564
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3565
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3566
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
  3567
  variable_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3568
	{$$ = 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
  3569
	 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
  3570
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3571
 | 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
  3572
	{$$ = $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
  3573
	 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
  3574
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3575
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3576
| var1_list variable_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3577
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3578
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3579
	 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
  3580
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3581
| var1_list ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3582
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3583
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3584
	 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
  3585
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3586
/* 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
  3587
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3588
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3589
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3590
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3591
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
  3592
 var1_list ':' array_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3593
	{$$ = new array_var_init_decl_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3594
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3595
| var1_list array_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3596
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3597
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3598
	 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
  3599
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3600
/* 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
  3601
;
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
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
  3605
  var1_list ':' initialized_structure
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3606
	{$$ = new structured_var_init_decl_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3607
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3608
| var1_list initialized_structure
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3609
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3610
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3611
	 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
  3612
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3613
/* 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
  3614
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3615
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
/* 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
  3618
 *       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
  3619
 *       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
  3620
 *       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
  3621
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3622
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
  3623
/*  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
  3624
  fb_name_list_with_colon function_block_type_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3625
	{$$ = 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
  3626
/*| 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
  3627
| fb_name_list_with_colon function_block_type_name ASSIGN structure_initialization
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3628
	{$$ = new fb_name_decl_c($1, $2, $4, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3629
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3630
| fb_name_list_with_colon ASSIGN structure_initialization
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3631
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3632
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3633
	 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
  3634
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3635
| fb_name_list_with_colon function_block_type_name structure_initialization
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3636
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3637
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3638
	 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
  3639
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3640
| fb_name_list_with_colon function_block_type_name ASSIGN error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3641
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3642
	 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
  3643
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3644
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3645
/* 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
  3646
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3647
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3648
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3649
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3650
/* 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
  3651
 *       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
  3652
 *       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
  3653
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3654
 *        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
  3655
 *        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
  3656
 *        (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
  3657
 *        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
  3658
 *        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
  3659
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3660
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3661
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
  3662
 (*  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
  3663
  identifier
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3664
	{$$ = 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
  3665
	 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
  3666
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3667
(* | 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
  3668
| 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
  3669
	{$$ = $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
  3670
	 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
  3671
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3672
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3673
*/
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
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
  3676
  var1_list_with_colon
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3677
	{$$ = 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
  3678
	 /* 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
  3679
	  * 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
  3680
	  */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3681
	 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
  3682
	 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
  3683
	 /* 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
  3684
	  * 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
  3685
	  * 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
  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
	 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
  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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3691
/* 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
  3692
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
  3693
  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
  3694
;
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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3697
// 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
  3698
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3699
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3700
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3701
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
  3702
  VAR_OUTPUT var_init_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3703
	{$$ = 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
  3704
| VAR_OUTPUT RETAIN var_init_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3705
	{$$ = 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
  3706
| VAR_OUTPUT NON_RETAIN var_init_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3707
	{$$ = 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
  3708
/* ERROR_CHECK_BEGIN */
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3709
| VAR_OUTPUT END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3710
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3711
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3712
	 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
  3713
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3714
| VAR_OUTPUT RETAIN END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3715
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3716
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3717
	 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
  3718
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3719
| VAR_OUTPUT NON_RETAIN END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3720
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3721
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3722
	 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
  3723
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3724
| VAR_OUTPUT error var_init_decl_list 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
	 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
  3727
	 yyerrok;
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 error var_init_decl_list 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
	 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
  3732
	 yyerrok;
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 error var_init_decl_list 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
	 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
  3737
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3738
	}
96
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3739
| VAR_OUTPUT error END_VAR
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3740
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3741
	 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
  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 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), "unknown error 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 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), "unknown error in non-retentive output variable(s) declaration.");
96
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3752
	 yyerrok;
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3753
	}
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3754
/* 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
  3755
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3756
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3757
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3758
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3759
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
  3760
  VAR_IN_OUT var_declaration_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3761
	{$$ = new input_output_declarations_c($2, locloc(@$));}
96
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3762
/* ERROR_CHECK_BEGIN */
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3763
| VAR_IN_OUT END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3764
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3765
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3766
	 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
  3767
	}
96
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3768
| VAR_IN_OUT error END_VAR
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3769
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3770
	 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
  3771
	 yyerrok;
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3772
	}
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3773
/* 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
  3774
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3775
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3776
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3777
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3778
/* 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
  3779
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
  3780
  var_declaration ';'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3781
	{$$ = 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
  3782
| 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
  3783
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3784
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3785
| var_declaration error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3786
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3787
	 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at end of variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3788
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3789
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3790
| var_declaration_list var_declaration error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3791
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3792
	 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at end of variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3793
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3794
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3795
| var_declaration_list ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3796
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3797
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3798
	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3799
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3800
/* 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
  3801
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3802
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3803
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3804
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
  3805
  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
  3806
| 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
  3807
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3808
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3809
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3810
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
  3811
  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
  3812
| 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
  3813
| 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
  3814
| 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
  3815
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3816
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3817
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
  3818
  var1_list  ':' simple_specification
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3819
	{$$ = 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
  3820
| var1_list  ':' subrange_specification
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3821
	{$$ = 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
  3822
| var1_list  ':' enumerated_specification
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3823
	{$$ = new var1_init_decl_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3824
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3825
| var1_list simple_specification
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3826
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3827
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3828
	 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
  3829
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3830
| var1_list subrange_specification
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3831
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3832
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3833
	 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
  3834
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3835
| var1_list enumerated_specification
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3836
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3837
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3838
	 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
  3839
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3840
/* 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
  3841
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3842
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3843
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3844
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3845
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
  3846
  var1_list ':' array_specification
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3847
	{$$ = new array_var_declaration_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3848
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3849
| var1_list array_specification
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3850
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3851
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3852
	 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
  3853
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3854
/* 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
  3855
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3856
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3857
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
  3858
  var1_list ':' prev_declared_structure_type_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3859
	{$$ = new structured_var_declaration_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3860
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3861
| var1_list prev_declared_structure_type_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3862
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3863
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3864
	 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
  3865
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3866
| var1_list ':' identifier
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3867
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3868
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3869
	 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
  3870
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3871
/* 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
  3872
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3873
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3874
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3875
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
  3876
  VAR var_init_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3877
	{$$ = 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
  3878
| VAR CONSTANT var_init_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3879
	{$$ = 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
  3880
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3881
| VAR END_VAR
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(@1), locl(@2), "no variable declared in variable(s) declaration.");
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
| VAR CONSTANT END_VAR
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(@3), "no variable declared in constant variable(s) 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
| VAR error var_init_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3892
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3893
	 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
  3894
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3895
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3896
| VAR CONSTANT error var_init_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3897
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3898
	 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
  3899
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3900
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3901
| VAR error 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
	 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
  3904
	 yyerrok;
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 error 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
	 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
  3909
	 yyerrok;
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
/* 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
  3912
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3913
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3914
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3915
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
  3916
  VAR RETAIN var_init_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3917
	{$$ = new retentive_var_declarations_c($3, locloc(@$));}
96
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3918
/* ERROR_CHECK_BEGIN */
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3919
| VAR RETAIN END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3920
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3921
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3922
	 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
  3923
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3924
| VAR RETAIN error var_init_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3925
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3926
	 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
  3927
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3928
	}
96
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3929
| VAR RETAIN error END_VAR
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3930
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3931
	 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
  3932
	 yyerrok;
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3933
	}
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  3934
/* 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
  3935
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3936
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3937
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3938
located_var_declarations:
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3939
  VAR located_var_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3940
	{$$ = 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
  3941
| VAR CONSTANT located_var_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3942
	{$$ = 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
  3943
| VAR RETAIN located_var_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3944
	{$$ = 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
  3945
| VAR NON_RETAIN located_var_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3946
	{$$ = 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
  3947
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3948
| VAR NON_RETAIN END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3949
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3950
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3951
	 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
  3952
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3953
| VAR error located_var_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3954
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3955
	 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
  3956
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3957
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3958
| VAR CONSTANT error located_var_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3959
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3960
	 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
  3961
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3962
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3963
| VAR RETAIN error located_var_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3964
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3965
	 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
  3966
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3967
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3968
| VAR NON_RETAIN error located_var_decl_list 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
	 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
  3971
	 yyerrok;
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 NON_RETAIN error 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), "unknown error in non retentive 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
/* 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
  3979
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3980
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3981
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  3982
/* 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
  3983
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
  3984
  located_var_decl ';'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  3985
	{$$ = 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
  3986
| 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
  3987
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3988
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3989
| located_var_decl error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3990
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3991
	 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
  3992
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3993
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3994
| located_var_decl_list located_var_decl error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3995
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3996
	 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
  3997
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3998
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  3999
| located_var_decl_list ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4000
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4001
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4002
	 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
  4003
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4004
/* 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
  4005
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4006
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4007
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4008
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
  4009
  variable_name location ':' located_var_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4010
	{$$ = 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
  4011
	 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
  4012
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4013
| location ':' located_var_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4014
	{$$ = new located_var_decl_c(NULL, $1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4015
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4016
| variable_name location located_var_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4017
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4018
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4019
	 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
  4020
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4021
| location located_var_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4022
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4023
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4024
	 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
  4025
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4026
| variable_name location ':' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4027
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4028
	 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
  4029
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4030
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4031
| location ':' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4032
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4033
	 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
  4034
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4035
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4036
/* 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
  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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4039
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4040
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4041
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4042
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
  4043
  VAR_EXTERNAL external_declaration_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4044
	{$$ = 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
  4045
| VAR_EXTERNAL CONSTANT external_declaration_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4046
	{$$ = 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
  4047
/* ERROR_CHECK_BEGIN */
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4048
| VAR_EXTERNAL END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4049
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4050
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4051
	 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
  4052
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4053
| VAR_EXTERNAL CONSTANT END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4054
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4055
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4056
	 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
  4057
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4058
| VAR_EXTERNAL error external_declaration_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4059
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4060
	 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
  4061
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4062
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4063
| VAR_EXTERNAL CONSTANT error external_declaration_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4064
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4065
	 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
  4066
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4067
	}
96
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  4068
| VAR_EXTERNAL error END_VAR
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  4069
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4070
	 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
  4071
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4072
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4073
| VAR_EXTERNAL CONSTANT error 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
	 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
  4076
	 yyerrok;
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  4077
	}
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  4078
/* 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
  4079
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4080
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4081
/* 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
  4082
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
  4083
  external_declaration ';'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4084
	{$$ = new external_declaration_list_c(locloc(@$)); $$->add_element($1);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4085
| 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
  4086
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4087
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4088
| external_declaration error
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(@1), locl(@1), "';' missing at end of external variable 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
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4093
| external_declaration_list external_declaration error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4094
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4095
	 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
  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
| external_declaration_list ';'
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
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4101
	 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
  4102
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
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
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:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4108
  global_var_name ':' simple_specification
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4109
	{$$ = 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
  4110
	 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
  4111
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4112
| global_var_name ':' subrange_specification
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4113
	{$$ = 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
  4114
	 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
  4115
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4116
| global_var_name ':' enumerated_specification
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4117
	{$$ = 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
  4118
	 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
  4119
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4120
| global_var_name ':' array_specification
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4121
	{$$ = 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
  4122
	 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
  4123
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4124
| global_var_name ':' prev_declared_structure_type_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4125
	{$$ = 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
  4126
	 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
  4127
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4128
| global_var_name ':' function_block_type_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4129
	{$$ = 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
  4130
	 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
  4131
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4132
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4133
| global_var_name simple_specification
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4134
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4135
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4136
	 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
  4137
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4138
| global_var_name subrange_specification
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4139
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4140
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4141
	 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
  4142
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4143
| global_var_name enumerated_specification
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4144
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4145
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4146
	 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
  4147
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4148
| global_var_name array_specification
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4149
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4150
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4151
	 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
  4152
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4153
| global_var_name prev_declared_structure_type_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4154
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4155
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4156
	 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
  4157
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4158
| global_var_name function_block_type_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4159
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4160
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4161
	 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
  4162
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4163
| global_var_name ':' identifier
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), "unknown type name in external variable declaration.");
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 ':' error
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
	 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
  4171
	 yyerrok;
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
/* 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
  4174
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4175
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4176
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4177
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
  4178
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4179
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4180
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
  4181
  VAR_GLOBAL global_var_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4182
	{$$ = 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
  4183
| VAR_GLOBAL CONSTANT global_var_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4184
	{$$ = 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
  4185
| VAR_GLOBAL RETAIN global_var_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4186
	{$$ = 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
  4187
/* ERROR_CHECK_BEGIN */
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4188
| VAR_GLOBAL END_VAR
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(@1), locl(@2), "no variable declared in global variable(s) declaration.");
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
| VAR_GLOBAL CONSTANT END_VAR
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(@3), "no variable declared in constant global variable(s) 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
| VAR_GLOBAL RETAIN END_VAR
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
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4201
	 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
  4202
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4203
| VAR_GLOBAL error global_var_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4204
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4205
	 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
  4206
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4207
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4208
| VAR_GLOBAL CONSTANT error global_var_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4209
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4210
	 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
  4211
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4212
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4213
| VAR_GLOBAL RETAIN error global_var_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4214
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4215
	 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
  4216
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4217
	}
96
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  4218
| VAR_GLOBAL error END_VAR
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  4219
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4220
	 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
  4221
	 yyerrok;
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 error 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
	 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
  4226
	 yyerrok;
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 error 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
	 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
  4231
	 yyerrok;
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  4232
	}
23baa8821b58 Adding some basic error cheching.
mario
parents: 95
diff changeset
  4233
/* 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
  4234
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4235
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4236
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4237
/* 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
  4238
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
  4239
  global_var_decl ';'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4240
	{$$ = 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
  4241
| 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
  4242
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4243
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4244
| global_var_decl error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4245
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4246
	 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at end of global variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4247
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4248
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4249
| global_var_decl_list global_var_decl error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4250
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4251
	 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at end of global variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4252
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4253
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4254
| global_var_decl_list ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4255
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4256
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4257
	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after global variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4258
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4259
/* 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
  4260
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4261
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4262
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4263
global_var_decl:
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4264
/* 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
  4265
  global_var_spec ':'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4266
	{$$ = new global_var_decl_c($1, NULL, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4267
*/
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4268
  global_var_spec ':' located_var_spec_init
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4269
	{$$ = 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
  4270
| global_var_spec ':' function_block_type_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4271
	{$$ = new global_var_decl_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4272
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4273
| global_var_list located_var_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4274
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4275
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4276
	 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
  4277
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4278
| global_var_name location located_var_spec_init
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4279
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4280
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4281
	 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
  4282
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4283
| global_var_spec function_block_type_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4284
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4285
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4286
	 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
  4287
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4288
| global_var_spec ':' identifier
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4289
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4290
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4291
	 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
  4292
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4293
| global_var_spec ':' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4294
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4295
	 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
  4296
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4297
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4298
/* 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
  4299
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4300
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4301
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4302
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
  4303
  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
  4304
| location
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4305
	{$$ = 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
  4306
| global_var_name location
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4307
	{$$ = 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
  4308
	 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
  4309
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4310
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4311
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4312
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4313
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
  4314
  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
  4315
| 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
  4316
| 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
  4317
| 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
  4318
| 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
  4319
| 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
  4320
| 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
  4321
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4322
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4323
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4324
location:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4325
  AT direct_variable
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4326
	{$$ = new location_c($2, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4327
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4328
| AT 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(@1), locl(@1), "invalid location in location 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
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:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4339
  global_var_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4340
	{$$ = 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
  4341
	 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
  4342
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4343
| 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
  4344
	{$$ = $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
  4345
	 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
  4346
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4347
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4348
| global_var_list global_var_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4349
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4350
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4351
	 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
  4352
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4353
| global_var_list ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4354
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4355
	 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
  4356
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4357
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4358
/* 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
  4359
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4360
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4361
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4362
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4363
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
  4364
  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
  4365
| 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
  4366
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4367
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4368
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
  4369
  var1_list ':' single_byte_string_spec
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4370
	{$$ = new single_byte_string_var_declaration_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4371
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4372
| var1_list single_byte_string_spec
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4373
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4374
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4375
	 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
  4376
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4377
/* 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
  4378
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4379
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4380
/* 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
  4381
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4382
 *       [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
  4383
 *       and
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4384
 *       [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
  4385
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4386
 *       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
  4387
 *       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
  4388
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4389
 *       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
  4390
 *        - 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
  4391
 *           -> 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
  4392
 *                                     |--> 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
  4393
 *                                     |--> 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
  4394
 *        - 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
  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
 *       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
  4397
 *        -> 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
  4398
 *        -> 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
  4399
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4400
 *       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
  4401
 *        -> 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
  4402
 *        -> 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
  4403
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4404
 *       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
  4405
 *        -> 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
  4406
 *        -> 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
  4407
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4408
 *       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
  4409
 *        -> 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
  4410
 *        -> 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
  4411
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4412
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
  4413
/*  STRING
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4414
	{$$ = 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
  4415
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4416
  STRING '[' integer ']'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4417
	{$$ = 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
  4418
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4419
| STRING ASSIGN single_byte_character_string
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4420
	{$$ = 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
  4421
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4422
| STRING '[' integer ']' ASSIGN single_byte_character_string
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4423
	{$$ = new single_byte_string_spec_c($3, $6, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4424
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4425
| STRING '[' error ']'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4426
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4427
	 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
  4428
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4429
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4430
| STRING '[' error ']' ASSIGN single_byte_character_string
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4431
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4432
	 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
  4433
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4434
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4435
| STRING '[' ']'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4436
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4437
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4438
	 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
  4439
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4440
| STRING '[' ']' ASSIGN single_byte_character_string
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4441
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4442
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4443
	 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
  4444
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4445
| STRING '[' integer error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4446
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4447
	 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
  4448
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4449
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4450
| STRING '[' integer error ASSIGN single_byte_character_string
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4451
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4452
	 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
  4453
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4454
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4455
| STRING '[' integer ']' single_byte_character_string
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4456
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4457
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4458
	 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
  4459
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4460
| STRING '[' integer ']' ASSIGN 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(@5), locl(@5), "invalid value for limited string type initialization.");
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
/* 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
  4466
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4467
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4468
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4469
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
  4470
  var1_list ':' double_byte_string_spec
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4471
	{$$ = new double_byte_string_var_declaration_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4472
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4473
| var1_list double_byte_string_spec
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4474
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4475
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4476
	 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
  4477
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4478
/* 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
  4479
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4480
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4481
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
  4482
/*  WSTRING
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4483
	{$$ = 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
  4484
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4485
  WSTRING '[' integer ']'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4486
	{$$ = 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
  4487
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4488
| WSTRING ASSIGN double_byte_character_string
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4489
	{$$ = 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
  4490
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4491
| WSTRING '[' integer ']' ASSIGN double_byte_character_string
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4492
	{$$ = new double_byte_string_spec_c($3, $6, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4493
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4494
| WSTRING '[' error ']'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4495
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4496
	 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
  4497
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4498
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4499
| WSTRING '[' error ']' ASSIGN single_byte_character_string
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4500
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4501
	 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
  4502
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4503
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4504
| WSTRING '[' ']'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4505
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4506
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4507
	 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
  4508
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4509
| WSTRING '[' ']' ASSIGN single_byte_character_string
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4510
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4511
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4512
	 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
  4513
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4514
| WSTRING '[' integer error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4515
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4516
	 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
  4517
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4518
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4519
| WSTRING '[' integer error ASSIGN single_byte_character_string
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4520
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4521
	 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
  4522
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4523
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4524
| WSTRING '[' integer ']' single_byte_character_string
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4525
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4526
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4527
	 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
  4528
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4529
| WSTRING '[' integer ']' ASSIGN 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(@5), locl(@5), "invalid value for limited double byte string type initialization.");
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
/* 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
  4535
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4536
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4537
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4538
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4539
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
  4540
  VAR            incompl_located_var_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4541
	{$$ = 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
  4542
| VAR     RETAIN incompl_located_var_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4543
	{$$ = 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
  4544
| VAR NON_RETAIN incompl_located_var_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4545
	{$$ = 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
  4546
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4547
| VAR error incompl_located_var_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4548
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4549
	 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
  4550
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4551
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4552
| VAR RETAIN error incompl_located_var_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4553
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4554
	 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
  4555
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4556
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4557
| VAR NON_RETAIN error incompl_located_var_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4558
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4559
	 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
  4560
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4561
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4562
/* 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
  4563
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4564
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4565
/* 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
  4566
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
  4567
  incompl_located_var_decl ';'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4568
	{$$ = 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
  4569
| 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
  4570
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4571
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4572
| incompl_located_var_decl error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4573
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4574
	 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
  4575
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4576
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4577
| incompl_located_var_decl_list incompl_located_var_decl error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4578
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4579
	 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
  4580
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4581
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4582
| incompl_located_var_decl_list ';'
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
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4585
	 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
  4586
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4587
/* 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
  4588
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4589
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4590
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4591
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
  4592
  variable_name incompl_location ':' var_spec
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4593
	{$$ = new incompl_located_var_decl_c($1, $2, $4, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4594
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4595
| variable_name incompl_location ':' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4596
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4597
	 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
  4598
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4599
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4600
| variable_name incompl_location var_spec
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4601
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4602
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4603
	 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
  4604
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4605
/* 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
  4606
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4607
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4608
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4609
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
  4610
  AT incompl_location_token
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4611
	{$$ = 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
  4612
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4613
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4614
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4615
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
  4616
  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
  4617
| 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
  4618
| 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
  4619
| 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
  4620
| 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
  4621
| 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
  4622
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4623
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4624
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4625
/* 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
  4626
/* 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
  4627
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4628
 *       STRING
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4629
 *       and
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4630
 *       WSTRING
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4631
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4632
 *       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
  4633
 *       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
  4634
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4635
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
  4636
/*  STRING
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4637
	{$$ = 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
  4638
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4639
  STRING '[' integer ']'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4640
	{$$ = 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
  4641
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4642
| WSTRING
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4643
	{$$ = 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
  4644
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4645
| WSTRING '[' integer ']'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4646
	{$$ = 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
  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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4650
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4651
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4652
/* 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
  4653
 *  - 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
  4654
 *  - 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
  4655
 *  - 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
  4656
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4657
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
  4658
  var_init_decl ';'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4659
	{$$ = 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
  4660
| 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
  4661
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4662
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4663
| var_init_decl_list var_init_decl error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4664
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4665
	 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at end of variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4666
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4667
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4668
/* 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
  4669
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4670
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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4673
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
/* 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
  4676
/***********************/
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4677
/*
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4678
function_name:
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4679
  prev_declared_derived_function_name
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4680
| standard_function_name 
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4681
;
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4682
*/
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4683
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
/* 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
  4685
 * 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
  4686
 * 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
  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
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
  4690
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
  4691
//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
  4692
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4693
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
  4694
//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
  4695
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
/* 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
  4698
 *       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
  4699
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4700
 *       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
  4701
 *       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
  4702
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4703
 *       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
  4704
 *       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
  4705
 *       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
  4706
 *       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
  4707
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4708
 *       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
  4709
 *       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
  4710
 *       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
  4711
 *       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
  4712
 *       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
  4713
 *       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
  4714
 *       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
  4715
 *       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
  4716
 *       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
  4717
 *       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
  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
 * 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
  4720
 *       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
  4721
 *       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
  4722
 *       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
  4723
 *       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
  4724
 *       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
  4725
 *       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
  4726
 *       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
  4727
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4728
 * 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
  4729
 *       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
  4730
 *       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
  4731
 *
78
aead91ec37cd removing 'identifier' from definition of symbolic_variable
mario
parents: 77
diff changeset
  4732
 * 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
  4733
 *       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
  4734
 *       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
  4735
 *       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
  4736
 *       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
  4737
 *       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
  4738
 *       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
  4739
 *       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
  4740
 *       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
  4741
 *       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
  4742
 *       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
  4743
 *       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
  4744
 *       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
  4745
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4746
/* 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
  4747
 * 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
  4748
 * 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
  4749
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4750
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4751
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4752
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
  4753
  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
  4754
| 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
  4755
| 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
  4756
//| 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
  4757
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4758
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4759
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4760
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
  4761
  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
  4762
| 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
  4763
//| 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
  4764
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4765
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4766
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
  4767
  standard_function_name_token
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4768
	{$$ = 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
  4769
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4770
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4771
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4772
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
  4773
  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
  4774
//| 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
  4775
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4776
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4777
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
  4778
  NOT
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4779
	{$$ = 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
  4780
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4781
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4782
/* 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
  4783
 * 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
  4784
 * 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
  4785
 *   - 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
  4786
 *   - 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
  4787
 *   - 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
  4788
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4789
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4790
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
  4791
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4792
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4793
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4794
standard_function_name_expression_clashes:
91
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4795
  AND	{$$ = new identifier_c(strdup("AND"), locloc(@$));}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4796
| OR	{$$ = new identifier_c(strdup("OR"), locloc(@$));}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4797
| XOR	{$$ = new identifier_c(strdup("XOR"), locloc(@$));}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4798
| ADD	{$$ = new identifier_c(strdup("ADD"), locloc(@$));}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4799
| SUB	{$$ = new identifier_c(strdup("SUB"), locloc(@$));}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4800
| MUL	{$$ = new identifier_c(strdup("MUL"), locloc(@$));}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4801
| DIV	{$$ = new identifier_c(strdup("DIV"), locloc(@$));}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4802
| MOD	{$$ = new identifier_c(strdup("MOD"), locloc(@$));}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4803
| GT	{$$ = new identifier_c(strdup("GT"), locloc(@$));}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4804
| GE	{$$ = new identifier_c(strdup("GE"), locloc(@$));}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4805
| EQ	{$$ = new identifier_c(strdup("EQ"), locloc(@$));}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4806
| LT	{$$ = new identifier_c(strdup("LT"), locloc(@$));}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4807
| LE	{$$ = new identifier_c(strdup("LE"), locloc(@$));}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4808
| NE	{$$ = new identifier_c(strdup("NE"), locloc(@$));}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4809
/*
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4810
  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
  4811
//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
  4812
//      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
  4813
//| 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
  4814
| 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
  4815
| 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
  4816
| 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
  4817
| 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
  4818
| 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
  4819
| 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
  4820
| 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
  4821
| 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
  4822
| 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
  4823
| 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
  4824
| 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
  4825
| 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
  4826
| NE_operator	{$$ = il_operator_c_2_identifier_c($1);}
91
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  4827
*/
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4828
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4829
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4830
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4831
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
  4832
  identifier
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4833
| 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
  4834
	{$$ = $1;
77
fe4ecf7efa79 adding some comments.
mario
parents: 75
diff changeset
  4835
	 if (not(allow_function_overloading)) {
fe4ecf7efa79 adding some comments.
mario
parents: 75
diff changeset
  4836
	   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
  4837
	   ERROR;
77
fe4ecf7efa79 adding some comments.
mario
parents: 75
diff changeset
  4838
	 }
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4839
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4840
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4841
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4842
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4843
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
  4844
/*  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
  4845
  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
  4846
	{$$ = 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
  4847
	 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
  4848
	 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
  4849
	   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
  4850
	     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
  4851
	       /* 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
  4852
	       break;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4853
	     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
  4854
	       /* 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
  4855
	       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
  4856
	       break;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4857
	     default:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4858
	       /* 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
  4859
	       ERROR;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4860
	   }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4861
	 } else {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4862
	   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
  4863
	 }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4864
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4865
/* | 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
  4866
| 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
  4867
	{$$ = 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
  4868
	 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
  4869
	 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
  4870
	   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
  4871
	     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
  4872
	     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
  4873
	     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
  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
	 } else {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4876
	   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
  4877
	 }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4878
	}
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4879
/* ERROR_CHECK_BEGIN */
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4880
| 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
  4881
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4882
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4883
	 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
  4884
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4885
| 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
  4886
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4887
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4888
	 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
  4889
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4890
| 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
  4891
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4892
	 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
  4893
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4894
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4895
| 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
  4896
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4897
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4898
	 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
  4899
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4900
| 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
  4901
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4902
	 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
  4903
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4904
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4905
| 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
  4906
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4907
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4908
	 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
  4909
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4910
| function_name_declaration ':' elementary_type_name function_body END_FUNCTION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4911
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4912
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4913
	 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
  4914
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4915
| function_name_declaration ':' derived_type_name function_body END_FUNCTION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4916
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4917
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4918
	 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
  4919
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4920
| 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
  4921
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4922
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4923
	 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
  4924
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4925
| 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
  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(@4), locl(@5), "no body defined 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 ':' elementary_type_name 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(@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
  4934
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4935
| function_name_declaration ':' derived_type_name 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
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4938
	 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
  4939
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4940
| function_name_declaration error 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
	 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
  4943
	 yyerrok;
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4944
	}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4945
/* ERROR_CHECK_END */
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4946
;
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4947
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  4948
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4949
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4950
/* 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
  4951
/* 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
  4952
 *       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
  4953
 *       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
  4954
 *       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
  4955
 *       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
  4956
 *       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
  4957
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4958
 *       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
  4959
 *       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
  4960
 *       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
  4961
 *       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
  4962
 *       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
  4963
 *       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
  4964
 *       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
  4965
 *       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
  4966
 *       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
  4967
 *       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
  4968
 *       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
  4969
 *       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
  4970
 *       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
  4971
 *       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
  4972
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4973
 *       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
  4974
 *       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
  4975
 *       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
  4976
 *       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
  4977
 *       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
  4978
 *       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
  4979
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4980
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
  4981
  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
  4982
	{$$ = $2;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4983
	 /* 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
  4984
	  * 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
  4985
	  *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4986
	  * 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
  4987
	  * 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
  4988
	  * 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
  4989
	  */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  4990
	 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
  4991
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4992
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4993
| FUNCTION error 
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4994
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4995
	 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
  4996
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4997
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  4998
/* 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
  4999
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5000
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5001
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
/* 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
  5004
io_OR_function_var_declarations_list:
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5005
  io_var_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5006
  {$$ = new var_declarations_list_c(locloc(@1));$$->add_element($1);}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5007
| function_var_decls
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5008
	{$$ = 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
  5009
| 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
  5010
	{$$ = $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
  5011
| 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
  5012
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5013
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5014
| io_OR_function_var_declarations_list error 
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5015
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5016
	 print_err_msg(current_filename, locf(@1), locl(@1), "unexpected token after variable(s) declaration in function declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5017
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5018
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5019
/* 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
  5020
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5021
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5022
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5023
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
  5024
  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
  5025
| 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
  5026
| 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
  5027
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5028
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5029
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5030
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
  5031
  VAR CONSTANT var2_init_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5032
	{$$ = 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
  5033
| VAR var2_init_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5034
	{$$ = new function_var_decls_c(NULL, $2, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5035
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5036
| VAR error var_init_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5037
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5038
	 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
  5039
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5040
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5041
| VAR CONSTANT error var_init_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5042
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5043
	 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
  5044
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5045
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5046
/* 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
  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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5049
/* 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
  5050
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
  5051
  var2_init_decl ';'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5052
	{$$ = 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
  5053
| 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
  5054
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5055
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5056
| var2_init_decl error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5057
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5058
	 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
  5059
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5060
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5061
| var2_init_decl_list var2_init_decl error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5062
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5063
	 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
  5064
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5065
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5066
| var2_init_decl_list ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5067
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5068
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5069
	 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
  5070
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5071
/* 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
  5072
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5073
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5074
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5075
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
  5076
  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
  5077
| 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
  5078
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5079
| 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
  5080
| 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
  5081
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5082
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5083
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5084
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5085
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
  5086
  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
  5087
| 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
  5088
| 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
  5089
| 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
  5090
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5091
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5092
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5093
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5094
/*****************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5095
/* 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
  5096
/*****************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5097
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
  5098
  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
  5099
| 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
  5100
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5101
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5102
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5103
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
  5104
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5105
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
  5106
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5107
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5108
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
  5109
  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
  5110
	{$$ = 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
  5111
	 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
  5112
	 /* 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
  5113
	  * 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
  5114
	  * 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
  5115
	  * 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
  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
	 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
  5118
	}
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5119
/* ERROR_CHECK_BEGIN */
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5120
| 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
  5121
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5122
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5123
	 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
  5124
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5125
| 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
  5126
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5127
	 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
  5128
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5129
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5130
| FUNCTION_BLOCK derived_function_block_name function_block_body END_FUNCTION_BLOCK
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5131
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5132
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5133
	 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
  5134
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5135
| 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
  5136
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5137
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5138
	 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
  5139
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5140
| FUNCTION_BLOCK derived_function_block_name END_FUNCTION_BLOCK
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5141
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5142
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5143
	 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
  5144
	}
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5145
| FUNCTION_BLOCK error END_FUNCTION_BLOCK
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5146
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5147
	 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
  5148
	 yyerrok;
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5149
	}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5150
/* 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
  5151
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5152
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5153
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5154
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5155
/* 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
  5156
/*  { 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
  5157
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5158
 * 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
  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
io_OR_other_var_declarations_list:
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5161
  io_var_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5162
  {$$ = new var_declarations_list_c(locloc(@$));$$->add_element($1);}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5163
| other_var_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5164
  {$$ = 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
  5165
| 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
  5166
	{$$ = $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
  5167
| 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
  5168
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5169
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5170
| io_OR_other_var_declarations_list error 
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5171
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5172
	 print_err_msg(current_filename, locf(@1), locl(@1), "unexpected token after variable(s) declaration in function declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5173
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5174
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5175
/* 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
  5176
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5177
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5178
/* NOTE:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5179
 *  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
  5180
 *  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
  5181
 *     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
  5182
 *   | 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
  5183
 *   | 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
  5184
 *   | 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
  5185
 *   | 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
  5186
 *   | 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
  5187
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5188
 *  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
  5189
 *  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
  5190
 *  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
  5191
 *  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
  5192
 *  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
  5193
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5194
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
  5195
  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
  5196
| 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
  5197
| 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
  5198
| 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
  5199
| 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
  5200
| 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
  5201
;
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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5204
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
  5205
  VAR_TEMP temp_var_decls_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5206
	{$$ = new temp_var_decls_c($2, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5207
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5208
| VAR_TEMP END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5209
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5210
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5211
	 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
  5212
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5213
| VAR_TEMP error temp_var_decls_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5214
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5215
	 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
  5216
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5217
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5218
/* 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
  5219
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5220
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5221
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5222
/* 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
  5223
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
  5224
  temp_var_decl ';'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5225
	{$$ = 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
  5226
| 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
  5227
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5228
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5229
| temp_var_decl error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5230
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5231
	 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at end of temporary variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5232
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5233
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5234
| temp_var_decls_list temp_var_decl error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5235
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5236
	 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at end of temporary variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5237
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5238
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5239
| temp_var_decls_list ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5240
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5241
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5242
	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after temporary variable declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5243
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5244
/* 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
  5245
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5246
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5247
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5248
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
  5249
  VAR NON_RETAIN var_init_decl_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5250
	{$$ = new non_retentive_var_decls_c($3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5251
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5252
| VAR NON_RETAIN error var_init_decl_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5253
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5254
	 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
  5255
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5256
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5257
/* 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
  5258
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5259
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5260
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5261
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5262
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
  5263
  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
  5264
| instruction_list	{$$ = $1;}
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5265
| 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
  5266
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5267
| 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
  5268
| 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
  5269
| <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
  5270
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5271
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5272
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5273
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5274
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5275
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5276
/**********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5277
/* 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
  5278
/**********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5279
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
  5280
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5281
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5282
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
  5283
  PROGRAM program_type_name program_var_declarations_list function_block_body END_PROGRAM
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5284
	{$$ = 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
  5285
	 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
  5286
	 /* 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
  5287
	  * 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
  5288
	  * 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
  5289
	  * 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
  5290
	  */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5291
	 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
  5292
	}
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5293
/* ERROR_CHECK_BEGIN */
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5294
| PROGRAM program_var_declarations_list function_block_body END_PROGRAM
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5295
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5296
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5297
	 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
  5298
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5299
| PROGRAM error program_var_declarations_list function_block_body END_PROGRAM
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5300
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5301
	 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
  5302
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5303
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5304
| PROGRAM program_type_name function_block_body END_PROGRAM
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5305
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5306
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5307
	 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
  5308
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5309
| PROGRAM program_type_name program_var_declarations_list END_PROGRAM
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5310
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5311
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5312
	 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
  5313
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5314
| PROGRAM program_type_name END_PROGRAM
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5315
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5316
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5317
	 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
  5318
	}
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5319
| PROGRAM error END_PROGRAM
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5320
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5321
	 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
  5322
	 yyerrok;
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5323
	}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5324
/* 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
  5325
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5326
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5327
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5328
/* 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
  5329
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5330
 * 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
  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
program_var_declarations_list:
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5333
  io_var_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5334
	{$$ = new var_declarations_list_c(locloc(@$)); $$->add_element($1);}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5335
| other_var_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5336
	{$$ = new var_declarations_list_c(locloc(@$)); $$->add_element($1);}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5337
| located_var_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5338
	{$$ = 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
  5339
| 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
  5340
	{$$ = $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
  5341
| 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
  5342
	{$$ = $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
  5343
| 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
  5344
	{$$ = $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
  5345
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5346
| 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
  5347
	{$$ = $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
  5348
*/
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5349
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5350
| program_var_declarations_list error 
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
	 print_err_msg(current_filename, locf(@1), locl(@1), "unexpected token after variable(s) declaration in program declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5353
	 yyerrok;
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
/* 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
  5356
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5357
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5358
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5359
/* TODO ... */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5360
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5361
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
  5362
  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
  5363
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5364
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5365
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5366
/* 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
  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
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
  5369
  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
  5370
| 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
  5371
;
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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5374
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5375
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
  5376
  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
  5377
| 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
  5378
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5379
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5380
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5381
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5382
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
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5384
/* B 1.6 Sequential Function Chart elements *
3
38850ee685e6 ST and IL parsing added into flex-bison analyser
lbessard
parents: 1
diff changeset
  5385
/********************************************/
0
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
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
  5388
  sfc_network
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5389
	{$$ = 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
  5390
| sequential_function_chart sfc_network
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5391
	{$$ = $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
  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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5394
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
  5395
  initial_step
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5396
	{$$ = 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
  5397
| sfc_network step
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5398
	{$$ = $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
  5399
| sfc_network transition
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5400
	{$$ = $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
  5401
| sfc_network action
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5402
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5403
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5404
| sfc_network error 
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5405
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5406
	 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
  5407
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5408
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5409
/* 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
  5410
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5411
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5412
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
  5413
  INITIAL_STEP step_name ':' action_association_list END_STEP
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  5414
//  INITIAL_STEP identifier ':' action_association_list END_STEP
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5415
	{$$ = new initial_step_c($2, $4, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5416
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5417
| INITIAL_STEP ':' action_association_list END_STEP
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5418
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5419
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5420
	 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
  5421
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5422
| INITIAL_STEP error ':' action_association_list END_STEP
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5423
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5424
	 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
  5425
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5426
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5427
| INITIAL_STEP step_name action_association_list END_STEP
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5428
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5429
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5430
	 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
  5431
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5432
| INITIAL_STEP step_name error action_association_list END_STEP
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5433
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5434
	 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
  5435
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5436
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5437
| INITIAL_STEP step_name ':' error END_STEP
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5438
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5439
	 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
  5440
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5441
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5442
| INITIAL_STEP error END_STEP
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5443
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5444
	 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
  5445
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5446
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5447
/* 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
  5448
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5449
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5450
step:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5451
  STEP step_name ':' action_association_list END_STEP
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  5452
//  STEP identifier ':' action_association_list END_STEP
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5453
	{$$ = new step_c($2, $4, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5454
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5455
| STEP ':' action_association_list END_STEP
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5456
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5457
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5458
	 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
  5459
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5460
| STEP error ':' action_association_list END_STEP
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5461
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5462
	 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
  5463
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5464
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5465
| STEP step_name action_association_list END_STEP
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5466
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5467
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5468
	 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
  5469
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5470
| STEP step_name error action_association_list END_STEP
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5471
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5472
	 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
  5473
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5474
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5475
| STEP step_name ':' error END_STEP
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5476
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5477
	 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
  5478
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5479
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5480
| STEP error END_STEP
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5481
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5482
	 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
  5483
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5484
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5485
/* 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
  5486
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5487
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5488
/* 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
  5489
 *  - 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
  5490
 *  - step
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5491
 */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5492
action_association_list:
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5493
  /* empty */
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5494
	{$$ = 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
  5495
| action_association_list action_association ';'
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5496
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5497
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5498
| action_association_list action_association error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5499
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5500
	 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
  5501
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5502
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5503
| action_association_list ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5504
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5505
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5506
	 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
  5507
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5508
/* ERROR_CHECK_END */
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5509
;
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5510
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5511
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  5512
// step_name: identifier;
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  5513
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
  5514
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5515
action_association:
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5516
  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
  5517
	{$$ = new action_association_c($1, $4, $6, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5518
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5519
/*| action_name '(' error indicator_name_list ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5520
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5521
	 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
  5522
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5523
	}*/
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5524
/* ERROR_CHECK_END */
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5525
;
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5526
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5527
/* 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
  5528
indicator_name_list:
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5529
  /* empty */
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5530
	{$$ = 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
  5531
| indicator_name_list ',' indicator_name
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5532
	{$$ = $1; $$->add_element($3);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5533
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5534
| indicator_name_list indicator_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5535
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5536
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5537
	 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
  5538
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5539
| indicator_name_list ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5540
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5541
	 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
  5542
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5543
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5544
/* 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
  5545
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5546
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  5547
// action_name: identifier;
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  5548
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
  5549
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5550
action_qualifier:
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5551
  /* empty */
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5552
	{$$ = NULL;}
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5553
| qualifier
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5554
	{$$ = 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
  5555
| timed_qualifier ',' action_time
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5556
	{$$ = new action_qualifier_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5557
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5558
| timed_qualifier action_time
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5559
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5560
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5561
	 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
  5562
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5563
| timed_qualifier ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5564
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5565
	 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
  5566
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5567
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5568
/* ERROR_CHECK_END */
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5569
;
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5570
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5571
qualifier:
94
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  5572
  N		{$$ = new qualifier_c(strdup("N"), locloc(@$));}
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5573
| R		{$$ = new qualifier_c(strdup("R"), locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5574
| S		{$$ = new qualifier_c(strdup("S"), locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5575
| 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
  5576
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5577
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5578
timed_qualifier:
94
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  5579
  L		{$$ = new timed_qualifier_c(strdup("L"), locloc(@$));}
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5580
| D		{$$ = new timed_qualifier_c(strdup("D"), locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5581
| SD		{$$ = new timed_qualifier_c(strdup("SD"), locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5582
| DS		{$$ = new timed_qualifier_c(strdup("DS"), locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5583
| 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
  5584
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5585
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5586
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
  5587
  duration
10
66f4f7f85d0a generate_iec completed
lbessard
parents: 5
diff changeset
  5588
| variable
66f4f7f85d0a generate_iec completed
lbessard
parents: 5
diff changeset
  5589
;
66f4f7f85d0a generate_iec completed
lbessard
parents: 5
diff changeset
  5590
66f4f7f85d0a generate_iec completed
lbessard
parents: 5
diff changeset
  5591
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
  5592
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  5593
// transition_name: identifier;
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  5594
transition_name: any_identifier;
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  5595
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5596
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5597
steps:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5598
  step_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5599
	{$$ = 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
  5600
| '(' step_name_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5601
	{$$ = new steps_c(NULL, $2, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5602
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5603
| '(' step_name_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5604
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5605
	 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
  5606
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5607
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5608
| '(' error ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5609
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5610
	 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
  5611
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5612
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5613
/* ERROR_CHECK_END */
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5614
;
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5615
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5616
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
  5617
  step_name ',' step_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5618
	{$$ = 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
  5619
| step_name_list ',' step_name
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5620
	{$$ = $1; $$->add_element($3);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5621
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5622
| step_name_list step_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5623
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5624
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5625
	 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
  5626
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5627
| step_name_list ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5628
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5629
	 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
  5630
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5631
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5632
/* ERROR_CHECK_END */
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5633
;
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
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  5635
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5636
/* NOTE: flex will automatically pop() out of body_state to previous state.
94
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  5637
 *       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
  5638
 *       after forcing flex to go to body_state.
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5639
 */
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5640
transition:
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5641
  TRANSITION transition_priority
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5642
    FROM steps TO steps 
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5643
    {cmd_goto_body_state();} transition_condition 
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5644
  END_TRANSITION 
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5645
	{$$ = new transition_c(NULL, $2, $4, $6, $8, locloc(@$));}
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5646
//| TRANSITION identifier FROM steps TO steps ... 
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5647
| TRANSITION transition_name transition_priority
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5648
    FROM steps TO steps 
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5649
    {cmd_goto_body_state();} transition_condition 
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5650
  END_TRANSITION 
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5651
	{$$ = new transition_c($2, $3, $5, $7, $9, locloc(@$));}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5652
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5653
| 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
  5654
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5655
	 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
  5656
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5657
	} 
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5658
| 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
  5659
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5660
	 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
  5661
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5662
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5663
| 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
  5664
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5665
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5666
	 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
  5667
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5668
| 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
  5669
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5670
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5671
	 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
  5672
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5673
| 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
  5674
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5675
	 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
  5676
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5677
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5678
| 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
  5679
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5680
	 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
  5681
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5682
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5683
| 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
  5684
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5685
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5686
	 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
  5687
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5688
| 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
  5689
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5690
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5691
	 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
  5692
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5693
| 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
  5694
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5695
	 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
  5696
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5697
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5698
| 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
  5699
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5700
	 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
  5701
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5702
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5703
| 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
  5704
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5705
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5706
	 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
  5707
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5708
| 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
  5709
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5710
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5711
	 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
  5712
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5713
| 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
  5714
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5715
	 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
  5716
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5717
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5718
| 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
  5719
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5720
	 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
  5721
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5722
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5723
| TRANSITION transition_priority {cmd_goto_body_state();} transition_condition END_TRANSITION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5724
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5725
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5726
	 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
  5727
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5728
| 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
  5729
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5730
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5731
	 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
  5732
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5733
| TRANSITION error END_TRANSITION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5734
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5735
	 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
  5736
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5737
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5738
/* ERROR_CHECK_END */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5739
;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5740
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5741
transition_priority:
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5742
  /* empty */
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
| '(' {cmd_goto_sfc_priority_state();} PRIORITY {cmd_pop_state();} ASSIGN integer ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5745
	{$$ = $6;}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5746
;
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5747
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5748
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5749
transition_condition:
10
66f4f7f85d0a generate_iec completed
lbessard
parents: 5
diff changeset
  5750
  ':' eol_list simple_instr_list
88
dab799d3d4a6 Adding location data to new transition_condition_c.
mario
parents: 87
diff changeset
  5751
	{$$ = new transition_condition_c($3, NULL, locloc(@$));}
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5752
| ASSIGN expression ';'
88
dab799d3d4a6 Adding location data to new transition_condition_c.
mario
parents: 87
diff changeset
  5753
	{$$ = new transition_condition_c(NULL, $2, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5754
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5755
| eol_list simple_instr_list
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5756
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5757
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5758
	 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
  5759
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5760
| ':' eol_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5761
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5762
	 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
  5763
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5764
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5765
| ASSIGN ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5766
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5767
	 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
  5768
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5769
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5770
| ASSIGN error ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5771
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5772
	 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
  5773
	 yyerrok;
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
| ASSIGN expression error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5776
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5777
	 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
  5778
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5779
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5780
/* ERROR_CHECK_END */
10
66f4f7f85d0a generate_iec completed
lbessard
parents: 5
diff changeset
  5781
;
3
38850ee685e6 ST and IL parsing added into flex-bison analyser
lbessard
parents: 1
diff changeset
  5782
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5783
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5784
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5785
action:
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5786
//  ACTION identifier ':' ... 
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5787
  ACTION action_name ':' {cmd_goto_body_state();} function_block_body END_ACTION
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5788
	{$$ = new action_c($2, $5, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5789
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5790
| ACTION ':' {cmd_goto_body_state();} function_block_body END_ACTION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5791
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5792
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5793
	 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
  5794
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5795
| ACTION error ':' {cmd_goto_body_state();} function_block_body END_ACTION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5796
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5797
	 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
  5798
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5799
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5800
| ACTION action_name {cmd_goto_body_state();} function_block_body END_ACTION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5801
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5802
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5803
	 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
  5804
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5805
| ACTION action_name ':' END_ACTION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5806
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5807
	 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
  5808
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5809
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5810
| ACTION error END_ACTION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5811
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5812
	 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
  5813
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5814
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5815
/* ERROR_CHECK_END */
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  5816
;
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
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
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5820
/* 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
  5821
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5822
/* NOTE:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5823
 * 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
  5824
 * 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
  5825
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5826
 * 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
  5827
 * 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
  5828
 * 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
  5829
 * 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
  5830
 * 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
  5831
 * 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
  5832
 * 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
  5833
 * 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
  5834
 * 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
  5835
 *   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
  5836
 * 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
  5837
 * 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
  5838
 * 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
  5839
 * 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
  5840
 * 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
  5841
 * 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
  5842
 * 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
  5843
 * 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
  5844
 * the resource names that need to be distinguished into a 
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5845
 * 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
  5846
 * 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
  5847
 * 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
  5848
 * 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
  5849
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5850
 * 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
  5851
 * 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
  5852
 * 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
  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
 * 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
  5855
 * 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
  5856
 */
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5857
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
  5858
prev_declared_resource_name: prev_declared_resource_name_token {$$ = new identifier_c($1, locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5859
prev_declared_program_name: prev_declared_program_name_token {$$ = new identifier_c($1, locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5860
// 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
  5861
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5862
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5863
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5864
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5865
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5866
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5867
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
  5868
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5869
/* 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
  5870
 *       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
  5871
 *       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
  5872
 *       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
  5873
 *       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
  5874
 *       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
  5875
 *       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
  5876
 *       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
  5877
 *       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
  5878
 *       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
  5879
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5880
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5881
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
  5882
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5883
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
  5884
  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
  5885
   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
  5886
   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
  5887
   {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
  5888
   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
  5889
   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
  5890
  END_CONFIGURATION
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5891
	{$$ = 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
  5892
	 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
  5893
	 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
  5894
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5895
| 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
  5896
   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
  5897
   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
  5898
   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
  5899
   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
  5900
 END_CONFIGURATION
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5901
	{$$ = 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
  5902
	 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
  5903
	 variable_name_symtable.pop();
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  5904
}
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5905
/* ERROR_CHECK_BEGIN */
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5906
| CONFIGURATION 
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5907
   optional_global_var_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5908
   single_resource_declaration
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5909
   {variable_name_symtable.pop();}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5910
   optional_access_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5911
   optional_instance_specific_initializations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5912
  END_CONFIGURATION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5913
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5914
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5915
	 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
  5916
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5917
| CONFIGURATION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5918
   optional_global_var_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5919
   resource_declaration_list
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5920
   optional_access_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5921
   optional_instance_specific_initializations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5922
  END_CONFIGURATION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5923
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5924
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5925
	 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
  5926
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5927
| CONFIGURATION error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5928
   optional_global_var_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5929
   single_resource_declaration
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5930
   {variable_name_symtable.pop();}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5931
   optional_access_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5932
   optional_instance_specific_initializations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5933
  END_CONFIGURATION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5934
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5935
	 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
  5936
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5937
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5938
| CONFIGURATION error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5939
   optional_global_var_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5940
   resource_declaration_list
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5941
   optional_access_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5942
   optional_instance_specific_initializations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5943
  END_CONFIGURATION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5944
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5945
	 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
  5946
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5947
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5948
| CONFIGURATION configuration_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5949
   optional_global_var_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5950
   optional_access_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5951
   optional_instance_specific_initializations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5952
  END_CONFIGURATION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5953
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5954
	 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
  5955
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5956
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5957
| CONFIGURATION configuration_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5958
   optional_global_var_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5959
   error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5960
   optional_access_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5961
   optional_instance_specific_initializations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5962
  END_CONFIGURATION
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5963
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5964
	 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
  5965
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5966
	}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5967
| 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
  5968
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  5969
	 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
  5970
	 yyerrok;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5971
	}
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  5972
/* 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
  5973
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5974
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5975
// 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
  5976
//  - 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
  5977
//  - 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
  5978
//
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5979
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
  5980
  // empty
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5981
	{$$ = NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5982
| 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
  5983
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5984
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5985
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5986
// 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
  5987
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
  5988
  // empty
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5989
	{$$ = NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5990
//| 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
  5991
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5992
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5993
// 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
  5994
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
  5995
  // empty
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5996
	{$$ = NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5997
| 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
  5998
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  5999
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6000
// 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
  6001
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
  6002
  resource_declaration
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6003
	{$$ = 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
  6004
| 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
  6005
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6006
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6007
| resource_declaration_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6008
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6009
	 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
  6010
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6011
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6012
/* 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
  6013
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6014
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6015
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6016
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
  6017
  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
  6018
   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
  6019
   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
  6020
  END_RESOURCE
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6021
	{$$ = new resource_declaration_c($3, $5, $6, $7, locloc(@$));
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  6022
	 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
  6023
	 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
  6024
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6025
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6026
| RESOURCE {variable_name_symtable.push();} ON resource_type_name
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6027
   optional_global_var_declarations
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6028
   single_resource_declaration
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6029
  END_RESOURCE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6030
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6031
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6032
	 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
  6033
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6034
| RESOURCE error END_RESOURCE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6035
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6036
	 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
  6037
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6038
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6039
/* 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
  6040
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6041
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6042
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6043
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
  6044
 task_configuration_list program_configuration_list
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6045
	{$$ = 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
  6046
;
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
// 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
  6050
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
  6051
  // empty
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6052
	{$$ = 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
  6053
| 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
  6054
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6055
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6056
| task_configuration_list task_configuration error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6057
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6058
	 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at the end of task configuration in resource declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6059
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6060
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6061
| task_configuration_list ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6062
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6063
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6064
	 print_err_msg(current_filename, locf(@1), locl(@1), "unexpected ';' after task configuration in resource declaration.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6065
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6066
/* 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
  6067
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6068
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6069
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6070
// 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
  6071
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
  6072
  program_configuration ';'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6073
	{$$ = 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
  6074
| 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
  6075
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6076
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6077
| program_configuration error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6078
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6079
	 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
  6080
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6081
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6082
| program_configuration_list program_configuration error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6083
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6084
	 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
  6085
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6086
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6087
| program_configuration_list ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6088
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6089
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6090
	 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
  6091
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6092
/* 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
  6093
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6094
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6095
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6096
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
  6097
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6098
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6099
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
  6100
 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
  6101
	{$$ = NULL;}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6102
// ERROR_CHECK_BEGIN //
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6103
| VAR_ACCESS END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6104
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6105
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6106
	 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
  6107
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6108
| VAR_ACCESS error access_declaration_list END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6109
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6110
	 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
  6111
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6112
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6113
| VAR_ACCESS error END_VAR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6114
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6115
	 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
  6116
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6117
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6118
// 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
  6119
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6120
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6121
// 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
  6122
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
  6123
  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
  6124
| access_declaration_list access_declaration ';'
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6125
// ERROR_CHECK_BEGIN //
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6126
| access_declaration error
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
	 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
  6129
	 yyerrok;
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
| access_declaration_list access_declaration error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6132
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6133
	 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
  6134
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6135
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6136
| access_declaration_list ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6137
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6138
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6139
	 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
  6140
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6141
// 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
  6142
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6143
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6144
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6145
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
  6146
  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
  6147
| 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
  6148
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6149
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6150
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6151
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
  6152
  direct_variable
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6153
| 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
  6154
| any_fb_name_list symbolic_variable
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6155
| prev_declared_resource_name '.' any_fb_name_list symbolic_variable
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6156
| prev_declared_program_name '.'  any_fb_name_list symbolic_variable
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6157
| 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
  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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6161
// 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
  6162
//  - 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
  6163
//  - 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
  6164
//
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6165
/* 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
  6166
 *       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
  6167
 *       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
  6168
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6169
 *       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
  6170
 *       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
  6171
 *       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
  6172
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6173
 *       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
  6174
 *       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
  6175
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6176
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
  6177
  // empty
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6178
	{$$ = 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
  6179
//| 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
  6180
| 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
  6181
	{$$ = $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
  6182
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6183
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6184
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6185
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6186
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
  6187
//  [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
  6188
                                  prev_declared_global_var_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6189
	{$$ = 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
  6190
|                                 prev_declared_global_var_name '.' structure_element_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6191
	{$$ = 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
  6192
| prev_declared_resource_name '.' prev_declared_global_var_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6193
	{$$ = 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
  6194
| prev_declared_resource_name '.' prev_declared_global_var_name '.' structure_element_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6195
	{$$ = 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
  6196
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6197
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6198
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6199
//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
  6200
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6201
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6202
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
  6203
/* NOTE:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6204
 * 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
  6205
 * 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
  6206
 * 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
  6207
 * _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
  6208
 * 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
  6209
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6210
 * 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
  6211
 * 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
  6212
 * initialization!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6213
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6214
//  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
  6215
  program_name '.' symbolic_variable
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6216
	{$$ = 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
  6217
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6218
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6219
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
  6220
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6221
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6222
direction:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6223
  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
  6224
	{$$ = NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6225
| 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
  6226
	{$$ = NULL;}
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
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
  6231
  TASK task_name task_initialization
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6232
	{$$ = new task_configuration_c($2, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6233
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6234
| TASK task_initialization
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6235
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6236
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6237
	 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
  6238
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6239
| TASK error task_initialization
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6240
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6241
	 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
  6242
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6243
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6244
| TASK task_name error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6245
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6246
	 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
  6247
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6248
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6249
/* 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
  6250
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6251
75
0e381bdb8888 Fixing handling of task initialisation.
mario
parents: 74
diff changeset
  6252
/* 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
  6253
 *       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
  6254
 *       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
  6255
 *       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
  6256
 *       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
  6257
 *       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
  6258
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6259
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
  6260
74
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6261
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6262
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
  6263
//  '(' [SINGLE ASSIGN data_source ','] [INTERVAL ASSIGN data_source ','] PRIORITY ASSIGN integer ')' //
75
0e381bdb8888 Fixing handling of task initialisation.
mario
parents: 74
diff changeset
  6264
  '(' {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
  6265
	{$$ = new task_initialization_c($3, $4, $5, locloc(@$));}
74
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6266
;
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6267
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6268
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6269
task_initialization_single:
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6270
// [SINGLE ASSIGN data_source ',']
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6271
  /* empty */
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6272
	{$$ = NULL;}
75
0e381bdb8888 Fixing handling of task initialisation.
mario
parents: 74
diff changeset
  6273
| SINGLE ASSIGN {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();} 
0e381bdb8888 Fixing handling of task initialisation.
mario
parents: 74
diff changeset
  6274
	{$$ = $4;}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6275
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6276
| SINGLE {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6277
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6278
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6279
	 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
  6280
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6281
| SINGLE error {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6282
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6283
	 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
  6284
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6285
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6286
| SINGLE ASSIGN {cmd_pop_state();} ',' {cmd_goto_task_init_state();}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6287
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6288
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6289
	 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
  6290
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6291
| SINGLE ASSIGN {cmd_pop_state();} error ',' {cmd_goto_task_init_state();}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6292
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6293
	 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
  6294
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6295
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6296
/* ERROR_CHECK_END */
74
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6297
;
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6298
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6299
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6300
task_initialization_interval:
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6301
// [INTERVAL ASSIGN data_source ','] 
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6302
  /* empty */
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6303
	{$$ = NULL;}
75
0e381bdb8888 Fixing handling of task initialisation.
mario
parents: 74
diff changeset
  6304
| INTERVAL ASSIGN {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();}
0e381bdb8888 Fixing handling of task initialisation.
mario
parents: 74
diff changeset
  6305
	{$$ = $4;}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6306
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6307
| INTERVAL {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6308
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6309
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6310
	 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
  6311
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6312
| INTERVAL error {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6313
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6314
	 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
  6315
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6316
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6317
| INTERVAL ASSIGN {cmd_pop_state();} ',' {cmd_goto_task_init_state();}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6318
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6319
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6320
	 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
  6321
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6322
| INTERVAL ASSIGN {cmd_pop_state();} error ',' {cmd_goto_task_init_state();}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6323
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6324
	 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
  6325
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6326
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6327
/* ERROR_CHECK_END */
75
0e381bdb8888 Fixing handling of task initialisation.
mario
parents: 74
diff changeset
  6328
;
0e381bdb8888 Fixing handling of task initialisation.
mario
parents: 74
diff changeset
  6329
74
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6330
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6331
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6332
task_initialization_priority:
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6333
// PRIORITY ASSIGN integer
75
0e381bdb8888 Fixing handling of task initialisation.
mario
parents: 74
diff changeset
  6334
  PRIORITY ASSIGN {cmd_pop_state();} integer 
0e381bdb8888 Fixing handling of task initialisation.
mario
parents: 74
diff changeset
  6335
	{$$ = $4;}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6336
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6337
| PRIORITY {cmd_pop_state();} integer
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6338
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6339
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6340
	 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
  6341
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6342
| PRIORITY error {cmd_pop_state();} integer 
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6343
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6344
	 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
  6345
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6346
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6347
| PRIORITY ASSIGN {cmd_pop_state();} error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6348
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6349
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6350
	 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
  6351
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6352
/* ERROR_CHECK_END */
75
0e381bdb8888 Fixing handling of task initialisation.
mario
parents: 74
diff changeset
  6353
;
0e381bdb8888 Fixing handling of task initialisation.
mario
parents: 74
diff changeset
  6354
74
85af9521bf63 fixing identifier issues of PRIORITY, SINGLE, and INTERVAL
mario
parents: 73
diff changeset
  6355
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6356
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6357
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
  6358
  constant
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6359
| 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
  6360
| 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
  6361
| 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
  6362
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6363
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6364
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
  6365
//  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
  6366
  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
  6367
	{$$ = 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
  6368
	 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
  6369
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6370
| 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
  6371
	{$$ = 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
  6372
	 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
  6373
	}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6374
| 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
  6375
	{$$ = 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
  6376
	 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
  6377
	}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6378
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6379
| PROGRAM program_name optional_task_name ':' identifier optional_prog_conf_elements
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6380
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6381
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6382
	 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
  6383
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6384
| PROGRAM RETAIN program_name optional_task_name ':' identifier optional_prog_conf_elements
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6385
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6386
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6387
	 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
  6388
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6389
| 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
  6390
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6391
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6392
	 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
  6393
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6394
| 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
  6395
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6396
	 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
  6397
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6398
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6399
| 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
  6400
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6401
	 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
  6402
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6403
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6404
| 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
  6405
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6406
	 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
  6407
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6408
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6409
| 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
  6410
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6411
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6412
	 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
  6413
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6414
| 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
  6415
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6416
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6417
	 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
  6418
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6419
| 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
  6420
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6421
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6422
	 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
  6423
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6424
| 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
  6425
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6426
	 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
  6427
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6428
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6429
| 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
  6430
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6431
	 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
  6432
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6433
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6434
| 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
  6435
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6436
	 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
  6437
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6438
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6439
| 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
  6440
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6441
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6442
	 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
  6443
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6444
| 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
  6445
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6446
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6447
	 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
  6448
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6449
| 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
  6450
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6451
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6452
	 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
  6453
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6454
| 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
  6455
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6456
	 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
  6457
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6458
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6459
| 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
  6460
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6461
	 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
  6462
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6463
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6464
| 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
  6465
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6466
	 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
  6467
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6468
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6469
| PROGRAM program_name optional_task_name ':' optional_prog_conf_elements
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6470
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6471
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6472
	 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
  6473
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6474
| PROGRAM RETAIN program_name optional_task_name ':' optional_prog_conf_elements
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6475
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6476
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6477
	 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
  6478
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6479
| PROGRAM NON_RETAIN program_name optional_task_name ':' optional_prog_conf_elements
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6480
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6481
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6482
	 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
  6483
  }
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6484
/* 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
  6485
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6486
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6487
// 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
  6488
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
  6489
  // empty //
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6490
	{$$ = NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6491
| 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
  6492
	{$$ = $2;}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6493
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6494
| WITH error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6495
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6496
	 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
  6497
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6498
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6499
/* 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
  6500
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6501
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6502
// 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
  6503
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
  6504
  // empty //
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6505
	{$$ = NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6506
| '(' 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
  6507
	{$$ = $2;}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6508
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6509
| '(' error ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6510
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6511
	 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
  6512
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6513
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6514
| '(' prog_conf_elements error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6515
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6516
	 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
  6517
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6518
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6519
/* 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
  6520
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6521
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6522
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6523
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
  6524
  prog_conf_element
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6525
	{$$ = 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
  6526
| 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
  6527
	{$$ = $1; $$->add_element($3);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6528
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6529
| prog_conf_elements prog_conf_element
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6530
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6531
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6532
	 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
  6533
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6534
| prog_conf_elements ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6535
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6536
	 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
  6537
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6538
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6539
/* 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
  6540
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6541
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6542
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6543
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
  6544
  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
  6545
| 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
  6546
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6547
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6548
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6549
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
  6550
  // 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
  6551
/* 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
  6552
 *       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
  6553
 *       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
  6554
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6555
  any_identifier WITH task_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6556
	{$$ = new fb_task_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6557
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6558
| any_identifier WITH 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), "invalid task name in function block 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
/* NOTE:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6568
 *  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
  6569
 *  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
  6570
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6571
 *  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
  6572
 *  (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
  6573
 *  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
  6574
 *  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
  6575
 *  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
  6576
 *  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
  6577
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6578
 *  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
  6579
 *  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
  6580
 *  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
  6581
 *  '(' 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
  6582
 *  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
  6583
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6584
 *  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
  6585
 *  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
  6586
 *  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
  6587
 *  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
  6588
 *  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
  6589
 *  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
  6590
 *  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
  6591
 *  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
  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
 *  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
  6594
 *  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
  6595
 *  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
  6596
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6597
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
  6598
  any_symbolic_variable ASSIGN prog_data_source
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6599
	{$$ = 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
  6600
| any_symbolic_variable SENDTO data_sink
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6601
	{$$ = new prog_cnxn_sendto_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6602
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6603
| any_symbolic_variable constant
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6604
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6605
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6606
	 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
  6607
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6608
| any_symbolic_variable enumerated_value
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6609
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6610
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6611
	 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
  6612
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6613
| any_symbolic_variable data_sink
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6614
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6615
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6616
	 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
  6617
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6618
| any_symbolic_variable error prog_data_source
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6619
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6620
	 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
  6621
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6622
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6623
| any_symbolic_variable ASSIGN error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6624
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6625
	 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
  6626
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6627
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6628
| any_symbolic_variable SENDTO error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6629
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6630
	 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
  6631
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6632
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6633
/* 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
  6634
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6635
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6636
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
  6637
  constant
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6638
| 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
  6639
| 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
  6640
| 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
  6641
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6642
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6643
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
  6644
  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
  6645
| 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
  6646
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6647
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6648
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
  6649
 VAR_CONFIG instance_specific_init_list END_VAR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6650
	{$$ = new instance_specific_initializations_c($2, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6651
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6652
| VAR_CONFIG END_VAR
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(@1), locl(@2), "no variable declared in configuration variable(s) initialization.");
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
| VAR_CONFIG error instance_specific_init_list END_VAR
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
	 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
  6660
	 yyerrok;
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
| VAR_CONFIG error END_VAR
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(@1), locl(@3), "unknown error in configuration variable(s) initialization.");
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
/* 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
  6668
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6669
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6670
// 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
  6671
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
  6672
  instance_specific_init ';'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6673
	{$$ = 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
  6674
| 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
  6675
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6676
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6677
| instance_specific_init error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6678
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6679
	 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
  6680
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6681
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6682
| instance_specific_init_list instance_specific_init error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6683
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6684
	 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
  6685
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6686
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6687
| instance_specific_init_list ';'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6688
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6689
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6690
	 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
  6691
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6692
/* 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
  6693
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6694
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6695
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6696
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
  6697
//
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6698
//  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
  6699
//  ((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
  6700
//
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6701
//  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
  6702
/* 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
  6703
 *       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
  6704
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6705
/* 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
  6706
 *       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
  6707
 *       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
  6708
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6709
  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
  6710
	{$$ = 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
  6711
| 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
  6712
	{$$ = 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
  6713
| 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
  6714
	{$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
  6715
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6716
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6717
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6718
/* 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
  6719
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
  6720
  function_block_type_name ASSIGN structure_initialization
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6721
	{$$ = new fb_initialization_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6722
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6723
| function_block_type_name structure_initialization
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6724
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6725
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6726
	 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
  6727
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6728
| function_block_type_name error structure_initialization
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6729
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6730
	 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
  6731
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6732
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6733
/* 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
  6734
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6735
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6736
/***********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6737
/* 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
  6738
/***********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6739
/* 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
  6740
/* 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
  6741
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6742
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
  6743
  EOL
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6744
| 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
  6745
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6746
94
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  6747
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6748
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6749
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
  6750
  il_instruction
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6751
	{$$ = new instruction_list_c(locloc(@$)); $$->add_element($1);}
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  6752
| pragma eol_list
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6753
	{$$ = 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
  6754
| 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
  6755
	{$$ = $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
  6756
| 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
  6757
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6758
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6759
| instruction_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6760
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6761
	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid IL instruction.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6762
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6763
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6764
/* ERROR_CHECK_END */
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6765
;
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6766
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6767
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6768
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6769
il_instruction:
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6770
  il_incomplete_instruction eol_list
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6771
	{$$ = new il_instruction_c(NULL, $1, locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6772
| label ':' il_incomplete_instruction eol_list
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6773
	{$$ = new il_instruction_c($1, $3, locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6774
/* ERROR_CHECK_BEGIN */
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6775
| error eol_list
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6776
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6777
	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid IL instruction.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6778
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6779
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6780
| il_incomplete_instruction error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6781
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6782
	 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
  6783
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6784
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6785
| error ':' il_incomplete_instruction eol_list
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6786
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6787
	 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
  6788
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6789
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6790
| label il_incomplete_instruction eol_list
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6791
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6792
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6793
	 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
  6794
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6795
| label error il_incomplete_instruction eol_list
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6796
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6797
	 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
  6798
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6799
	}
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6800
| label ':' error eol_list
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6801
	{$$ = NULL;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6802
	 print_err_msg(current_filename, locf(@2), locl(@4), "invalid IL instruction.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6803
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6804
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6805
| label ':' il_incomplete_instruction error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6806
	{$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6807
	 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
  6808
	 yyerrok;
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6809
	}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6810
/* 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
  6811
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6812
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6813
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6814
/* 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
  6815
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
  6816
  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
  6817
| 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
  6818
| 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
  6819
| 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
  6820
| 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
  6821
| 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
  6822
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6823
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6824
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6825
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
  6826
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6827
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6828
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6829
il_simple_operation:
94
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  6830
// (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
  6831
  il_simple_operator
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6832
	{$$ = new il_simple_operation_c($1, NULL, locloc(@$));}
93
284ef59bb133 Cleaning up comments.
mario
parents: 92
diff changeset
  6833
/*
284ef59bb133 Cleaning up comments.
mario
parents: 92
diff changeset
  6834
 * Note: Bison is getting confused with the following rule,
94
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  6835
 *       i.e. it is finding conflicts where there seemingly are really none.
93
284ef59bb133 Cleaning up comments.
mario
parents: 92
diff changeset
  6836
 *       The rule was therefore replaced by the equivalent following
284ef59bb133 Cleaning up comments.
mario
parents: 92
diff changeset
  6837
 *       two rules.
284ef59bb133 Cleaning up comments.
mario
parents: 92
diff changeset
  6838
 */
284ef59bb133 Cleaning up comments.
mario
parents: 92
diff changeset
  6839
/*
284ef59bb133 Cleaning up comments.
mario
parents: 92
diff changeset
  6840
| il_simple_operator il_operand
284ef59bb133 Cleaning up comments.
mario
parents: 92
diff changeset
  6841
	{$$ = new il_simple_operation_c($1, $2, locloc(@$));}
284ef59bb133 Cleaning up comments.
mario
parents: 92
diff changeset
  6842
*/
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6843
| il_simple_operator_noclash il_operand
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6844
	{$$ = new il_simple_operation_c($1, $2, locloc(@$));}
91
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  6845
| il_simple_operator_clash il_operand
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  6846
	{$$ = 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
  6847
/* 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
  6848
 *         | 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
  6849
 *       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
  6850
 *       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
  6851
 *       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
  6852
 *       without any operands, could be reduced to either an operator or a
89
5b2ec5c057fa Cleaning up comments.
mario
parents: 88
diff changeset
  6853
 *       function call. 
5b2ec5c057fa Cleaning up comments.
mario
parents: 88
diff changeset
  6854
 *
5b2ec5c057fa Cleaning up comments.
mario
parents: 88
diff changeset
  6855
 *       I (Mario) have chosen to reduce it to an operator.
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6856
 *       In order to do this, we must remove from the syntax that defines
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6857
 *       function calls all the functions whose names clash with the IL operators.
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6858
 *
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6859
 *       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
  6860
 *         | 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
  6861
 *       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
  6862
 *         | 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
  6863
 *       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
  6864
 *       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
  6865
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6866
| function_name_no_clashes
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6867
	{$$ = 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
  6868
/* 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
  6869
 *         | il_simple_operator il_operand
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6870
 *       already contains the 'NOT', 'MOD', etc. operators, followed by a single il_operand.
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6871
 *       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
  6872
 *       function. This means that (MOD, AND,...) could be interpret as a function name
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6873
 *       or as an IL operator! This would lead us to a reduce/reduce conflict!
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6874
 *
89
5b2ec5c057fa Cleaning up comments.
mario
parents: 88
diff changeset
  6875
 *       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
  6876
 *       In order to do this, we must remove from the syntax that defines
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6877
 *       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
  6878
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6879
 *       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
  6880
 *         | 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
  6881
 *       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
  6882
 *         | 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
  6883
 *       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
  6884
 *       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
  6885
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6886
 *       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
  6887
 *       this alternative syntax does not cover the possibility of
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6888
 *       the function 'NOT', 'MOD', etc... being called with more than one il_operand,
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6889
 *       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
  6890
 *       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
  6891
 *       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
  6892
 *       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
  6893
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6894
| function_name_no_clashes il_operand_list
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6895
	{$$ = new il_function_call_c($1, $2, locloc(@$));}
91
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  6896
| il_simple_operator_clash il_operand_list2
93
284ef59bb133 Cleaning up comments.
mario
parents: 92
diff changeset
  6897
	{$$ = new il_function_call_c(il_operator_c_2_identifier_c($1), $2, locloc(@$));}
284ef59bb133 Cleaning up comments.
mario
parents: 92
diff changeset
  6898
;
284ef59bb133 Cleaning up comments.
mario
parents: 92
diff changeset
  6899
91
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  6900
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6901
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6902
il_expression:
94
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  6903
// il_expr_operator '(' [il_operand] EOL {EOL} [simple_instr_list] ')'
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  6904
/*
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  6905
 * Note: Bison is getting confused with the use of il_expr_operator,
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  6906
 *       i.e. it is finding conflicts where there seemingly are really none.
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  6907
 *       il_expr_operator was therefore replaced by the equivalent 
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  6908
 *       il_expr_operator_noclash | il_expr_operator_clash.
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  6909
 */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6910
  il_expr_operator_noclash '(' eol_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6911
	{$$ = 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
  6912
| il_expr_operator_noclash '(' il_operand eol_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6913
	{$$ = 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
  6914
| il_expr_operator_noclash '(' eol_list simple_instr_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6915
	{$$ = 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
  6916
| il_expr_operator_noclash '(' il_operand eol_list simple_instr_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6917
	{$$ = 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
  6918
| il_expr_operator_clash '(' eol_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6919
	{$$ = 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
  6920
| il_expr_operator_clash '(' il_operand eol_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6921
	{$$ = 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
  6922
| il_expr_operator_clash '(' il_operand eol_list simple_instr_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6923
	{$$ = 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
  6924
| il_expr_operator_clash_eol_list simple_instr_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6925
	{$$ = new il_expression_c($1, NULL, $2, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6926
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6927
| il_expr_operator_noclash '(' eol_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6928
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6929
	 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
  6930
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6931
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6932
| il_expr_operator_noclash '(' il_operand eol_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6933
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6934
	 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
  6935
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6936
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6937
| il_expr_operator_noclash '(' eol_list simple_instr_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6938
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6939
	 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
  6940
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6941
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6942
| il_expr_operator_noclash '(' il_operand eol_list simple_instr_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6943
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6944
	 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
  6945
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6946
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6947
| il_expr_operator_clash '(' il_operand eol_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6948
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6949
	 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
  6950
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6951
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6952
| il_expr_operator_clash '(' il_operand eol_list simple_instr_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6953
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6954
	 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
  6955
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6956
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6957
| il_expr_operator_clash_eol_list simple_instr_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6958
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6959
	 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
  6960
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6961
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6962
/* 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
  6963
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6964
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6965
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6966
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
  6967
  il_jump_operator label
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6968
	{$$ = new il_jump_operation_c($1, $2, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6969
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6970
| il_jump_operator error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6971
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6972
	 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
  6973
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6974
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6975
/* 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
  6976
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6977
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6978
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  6979
il_fb_call:
94
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  6980
// 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
  6981
  il_call_operator prev_declared_fb_name
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6982
	{$$ = 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
  6983
| il_call_operator prev_declared_fb_name '(' ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6984
	{$$ = 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
  6985
| il_call_operator prev_declared_fb_name '(' eol_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6986
	{$$ = 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
  6987
| il_call_operator prev_declared_fb_name '(' il_operand_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6988
	{$$ = 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
  6989
| il_call_operator prev_declared_fb_name '(' eol_list il_param_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  6990
	{$$ = new il_fb_call_c($1, $2, NULL, $5, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6991
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6992
| il_call_operator error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6993
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6994
	 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
  6995
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6996
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6997
| il_call_operator '(' ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6998
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  6999
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7000
	 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
  7001
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7002
| il_call_operator '(' eol_list ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7003
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7004
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7005
	 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
  7006
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7007
| il_call_operator '(' il_operand_list ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7008
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7009
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7010
	 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
  7011
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7012
| il_call_operator '(' eol_list il_param_list ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7013
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7014
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7015
	 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
  7016
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7017
| il_call_operator error '(' ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7018
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7019
	 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
  7020
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7021
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7022
| il_call_operator error '(' eol_list ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7023
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7024
	 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
  7025
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7026
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7027
| il_call_operator error '(' il_operand_list ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7028
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7029
	 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
  7030
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7031
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7032
| il_call_operator error '(' eol_list il_param_list ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7033
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7034
	 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
  7035
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7036
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7037
| il_call_operator prev_declared_fb_name ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7038
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7039
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7040
	 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
  7041
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7042
| il_call_operator prev_declared_fb_name il_operand_list ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7043
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7044
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7045
	 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
  7046
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7047
| il_call_operator prev_declared_fb_name '(' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7048
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7049
	 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
  7050
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7051
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7052
| il_call_operator prev_declared_fb_name '(' eol_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7053
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7054
	 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
  7055
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7056
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7057
| il_call_operator prev_declared_fb_name '(' il_operand_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7058
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7059
	 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
  7060
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7061
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7062
/* 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
  7063
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7064
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7065
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7066
/* 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
  7067
il_formal_funct_call:
94
40288323acc0 Fixing some more comments.
mario
parents: 93
diff changeset
  7068
// 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
  7069
/*  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
  7070
/* 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
  7071
 *         - 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
  7072
 *         - 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
  7073
 *       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
  7074
 *       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
  7075
 *       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
  7076
 *       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
  7077
 *       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
  7078
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7079
 *       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
  7080
 *       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
  7081
 *       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
  7082
 *       as operators, rather than as function calls!
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7083
 *       (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
  7084
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7085
  function_name_no_clashes '(' eol_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7086
	{$$ = 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
  7087
| function_name_simpleop_clashes '(' eol_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7088
	{$$ = 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
  7089
/* | function_name '(' eol_list il_param_list ')' */
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7090
/* For the above syntax, we no longer have two ways of interpreting the
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7091
 * same syntax. The above is always a function call!
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7092
 * However, some of the functions that we may be calling
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7093
 * may have the same name as an IL operator. This means that
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7094
 * flex will be parsing them and handing them over to bison as
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7095
 * IL operator tokens, and not as function name tokens.
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7096
 * (when parsing ST, flex no longer recognizes IL operators,
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7097
 * so will always return the correct function name, unless that
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7098
 * name also coincides with an operator used in ST -> XOR, OR, MOD, AND, NOT)
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7099
 *
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7100
 * We must therefore interpret the IL operators as function names!
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7101
 */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7102
| function_name_no_clashes '(' eol_list il_param_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7103
	{$$ = 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
  7104
| function_name_simpleop_clashes '(' eol_list il_param_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7105
	{$$ = new il_formal_funct_call_c($1, $4, locloc(@$));}
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7106
/* The following line should read:
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7107
 *
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7108
 * | function_name_expression_clashes '(' eol_list il_param_list ')'
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7109
 *
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7110
 * 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
  7111
 * 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
  7112
 * 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
  7113
 * 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
  7114
 * 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
  7115
 * 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
  7116
 * 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
  7117
 * 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
  7118
 * 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
  7119
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7120
 * 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
  7121
 * 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
  7122
 * 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
  7123
 * 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
  7124
 * 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
  7125
 * 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
  7126
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7127
| il_expr_operator_clash_eol_list il_param_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7128
	{$$ = 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
  7129
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7130
| function_name_no_clashes '(' eol_list error ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7131
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7132
	 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
  7133
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7134
	} 
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7135
| function_name_simpleop_clashes '(' eol_list error ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7136
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7137
	 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
  7138
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7139
	} 
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7140
| il_expr_operator_clash_eol_list error ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7141
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7142
	 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
  7143
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7144
	} 
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7145
/* 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
  7146
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7147
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7148
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7149
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
  7150
  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
  7151
	{$$ = $1;}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7152
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7153
| il_expr_operator_clash '(' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7154
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7155
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7156
	 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
  7157
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7158
/* 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
  7159
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7160
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7161
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7162
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
  7163
  variable
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  7164
| 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
  7165
| constant
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7166
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7167
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
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
  7170
  il_operand
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7171
	{$$ = new il_operand_list_c(locloc(@$)); $$->add_element($1);}
91
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  7172
| il_operand_list2
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  7173
;
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  7174
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  7175
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  7176
/* List with 2 or more il_operands */ 
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  7177
il_operand_list2:
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  7178
  il_operand ',' il_operand 
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  7179
	{$$ = new il_operand_list_c(locloc(@$)); $$->add_element($1); $$->add_element($3);}
ac119a256fc0 Cleaning up some bison rules.
mario
parents: 90
diff changeset
  7180
| 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
  7181
	{$$ = $1; $$->add_element($3);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7182
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7183
| il_operand_list2 il_operand
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7184
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7185
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7186
	 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
  7187
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7188
| il_formal_funct_call error il_operand
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7189
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7190
	 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
  7191
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7192
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7193
| il_formal_funct_call ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7194
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7195
	 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
  7196
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7197
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7198
/* 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
  7199
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7200
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7201
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7202
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
  7203
  il_simple_instruction
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7204
	{$$ = 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
  7205
| 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
  7206
	{$$ = $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
  7207
;
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
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
  7211
  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
  7212
| 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
  7213
| il_formal_funct_call eol_list
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7214
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7215
| il_expression error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7216
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7217
	 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
  7218
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7219
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7220
| il_formal_funct_call error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7221
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7222
	 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
  7223
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7224
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7225
/* 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
  7226
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7227
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7228
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7229
/* 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
  7230
 * 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
  7231
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7232
 * 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
  7233
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7234
 * 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
  7235
 * 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
  7236
 * 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
  7237
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7238
 * 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
  7239
 * 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
  7240
 * 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
  7241
 * 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
  7242
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7243
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
  7244
  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
  7245
	{$$ = $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
  7246
| il_param_last_instruction
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7247
	{$$ = new il_param_list_c(locloc(@$)); $$->add_element($1);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7248
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7249
| il_param_instruction_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7250
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7251
	 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
  7252
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7253
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7254
| il_param_last_instruction il_param_last_instruction
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7255
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7256
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7257
	 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
  7258
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7259
| il_param_instruction_list il_param_last_instruction il_param_last_instruction
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7260
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7261
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7262
	 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
  7263
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7264
/* 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
  7265
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7266
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7267
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7268
/* 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
  7269
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
  7270
  il_param_instruction
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7271
	{$$ = 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
  7272
| 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
  7273
	{$$ = $1; $$->add_element($2);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7274
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7275
| il_param_last_instruction il_param_instruction
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7276
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7277
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7278
	 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
  7279
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7280
| il_param_instruction_list il_param_last_instruction il_param_instruction
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7281
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7282
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7283
	 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
  7284
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7285
/* 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
  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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7288
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_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_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
  7291
| il_param_out_assignment ',' eol_list
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7292
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7293
| il_param_assignment ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7294
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7295
	 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
  7296
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7297
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7298
| il_param_out_assignment ',' 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), "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
  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
/* 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
  7304
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7305
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7306
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7307
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
  7308
  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
  7309
| il_param_out_assignment eol_list
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7310
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7311
| il_param_assignment error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7312
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7313
	 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
  7314
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7315
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7316
| il_param_out_assignment error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7317
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7318
	 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
  7319
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7320
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7321
/* ERROR_CHECK_END */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7322
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7323
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7324
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7325
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7326
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
  7327
  il_assign_operator il_operand
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7328
	{$$ = 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
  7329
| il_assign_operator '(' eol_list simple_instr_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7330
	{$$ = new il_param_assignment_c($1, NULL, $4, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7331
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7332
| error il_operand
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7333
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7334
	 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
  7335
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7336
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7337
| error '(' eol_list simple_instr_list ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7338
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7339
	 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
  7340
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7341
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7342
| il_assign_operator 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(@1), locl(@1), "invalid operand defined in parameter assignment.");
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_assign_operator '(' ')'
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(@1), locl(@1), "no instruction list defined in parameter assignment.");
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
| il_assign_operator '(' error ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7353
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7354
	 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
  7355
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7356
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7357
| il_assign_operator '(' eol_list simple_instr_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7358
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7359
	 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
  7360
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7361
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7362
/* 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
  7363
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7364
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7365
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7366
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
  7367
  il_assign_out_operator variable
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7368
	{$$ = new il_param_out_assignment_c($1, $2, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7369
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7370
| il_assign_out_operator error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7371
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7372
	 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
  7373
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7374
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7375
/* 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
  7376
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7377
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7378
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7379
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7380
/*******************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7381
/* 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
  7382
/*******************/
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7383
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
  7384
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7385
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7386
/* NOTE:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7387
 *  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
  7388
 * 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
  7389
 * 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
  7390
 * 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
  7391
 * (Mario)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7392
 */
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7393
LD_operator: 		LD 	{$$ = new LD_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7394
LDN_operator: 		LDN 	{$$ = new LDN_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7395
ST_operator: 		ST 	{$$ = new ST_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7396
STN_operator: 		STN 	{$$ = new STN_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7397
NOT_operator: 		NOT 	{$$ = new NOT_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7398
S_operator: 		S 	{$$ = new S_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7399
R_operator: 		R 	{$$ = new R_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7400
S1_operator: 		S1 	{$$ = new S1_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7401
R1_operator: 		R1 	{$$ = new R1_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7402
CLK_operator: 		CLK 	{$$ = new CLK_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7403
CU_operator: 		CU 	{$$ = new CU_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7404
CD_operator: 		CD 	{$$ = new CD_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7405
PV_operator: 		PV 	{$$ = new PV_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7406
IN_operator: 		IN 	{$$ = new IN_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7407
PT_operator: 		PT 	{$$ = new PT_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7408
AND_operator: 		AND 	{$$ = new AND_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7409
AND2_operator: 		AND2 	{$$ = new AND_operator_c(locloc(@$));}; /* '&' in the source code! */
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7410
OR_operator: 		OR 	{$$ = new OR_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7411
XOR_operator: 		XOR 	{$$ = new XOR_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7412
ANDN_operator: 		ANDN 	{$$ = new ANDN_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7413
ANDN2_operator:		ANDN2 	{$$ = new ANDN_operator_c(locloc(@$));}; /* '&N' in the source code! */
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7414
ORN_operator: 		ORN 	{$$ = new ORN_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7415
XORN_operator: 		XORN 	{$$ = new XORN_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7416
ADD_operator: 		ADD 	{$$ = new ADD_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7417
SUB_operator: 		SUB 	{$$ = new SUB_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7418
MUL_operator: 		MUL 	{$$ = new MUL_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7419
DIV_operator: 		DIV 	{$$ = new DIV_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7420
MOD_operator: 		MOD 	{$$ = new MOD_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7421
GT_operator: 		GT 	{$$ = new GT_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7422
GE_operator: 		GE 	{$$ = new GE_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7423
EQ_operator: 		EQ 	{$$ = new EQ_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7424
LT_operator: 		LT 	{$$ = new LT_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7425
LE_operator: 		LE 	{$$ = new LE_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7426
NE_operator: 		NE 	{$$ = new NE_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7427
CAL_operator: 		CAL 	{$$ = new CAL_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7428
CALC_operator: 		CALC 	{$$ = new CALC_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7429
CALCN_operator: 	CALCN 	{$$ = new CALCN_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7430
RET_operator: 		RET 	{$$ = new RET_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7431
RETC_operator: 		RETC 	{$$ = new RETC_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7432
RETCN_operator: 	RETCN 	{$$ = new RETCN_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7433
JMP_operator: 		JMP 	{$$ = new JMP_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7434
JMPC_operator: 		JMPC 	{$$ = new JMPC_operator_c(locloc(@$));};
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7435
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
  7436
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7437
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7438
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
  7439
  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
  7440
| 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
  7441
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7442
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7443
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7444
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
  7445
  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
  7446
| 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
  7447
| 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
  7448
| 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
  7449
| 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
  7450
| 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
  7451
| 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
  7452
| 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
  7453
| 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
  7454
| 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
  7455
| 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
  7456
| 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
  7457
| 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
  7458
| 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
  7459
| 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
  7460
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7461
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7462
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7463
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
  7464
  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
  7465
| 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
  7466
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7467
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7468
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
  7469
  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
  7470
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7471
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7472
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
  7473
  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
  7474
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7475
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7476
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7477
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7478
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
  7479
  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
  7480
| 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
  7481
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7482
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7483
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7484
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
  7485
  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
  7486
| 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
  7487
| 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
  7488
| 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
  7489
| 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
  7490
| 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
  7491
| 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
  7492
| 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
  7493
| 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
  7494
| 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
  7495
| 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
  7496
| 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
  7497
| 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
  7498
| 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
  7499
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7500
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7501
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7502
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
  7503
  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
  7504
| 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
  7505
| 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
  7506
| 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
  7507
| 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
  7508
;
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
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_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
  7514
/*  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
  7515
  any_identifier ASSIGN
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7516
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7517
| error ASSIGN
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7518
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7519
	 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
  7520
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7521
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7522
/* 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
  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
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
  7527
/*  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
  7528
/*  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
  7529
  sendto_identifier SENDTO
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7530
	{$$ = 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
  7531
/*| 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
  7532
| NOT sendto_identifier SENDTO
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7533
	{$$ = 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
  7534
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7535
| error SENDTO
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7536
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7537
	 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
  7538
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7539
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7540
| NOT SENDTO
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7541
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7542
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7543
	 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
  7544
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7545
| NOT error SENDTO
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7546
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7547
	 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
  7548
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7549
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7550
/* 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
  7551
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7552
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7553
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7554
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
  7555
  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
  7556
| 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
  7557
| 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
  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
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
  7562
  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
  7563
| 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
  7564
| 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
  7565
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7566
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7567
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7568
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
  7569
  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
  7570
| 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
  7571
| 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
  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
/***********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7576
/* 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
  7577
/***********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7578
expression:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7579
  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
  7580
| expression OR xor_expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7581
	{$$ = new or_expression_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7582
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7583
| expression OR error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7584
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7585
	 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
  7586
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7587
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7588
/* 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
  7589
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7590
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7591
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
  7592
  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
  7593
| xor_expression XOR and_expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7594
	{$$ = new xor_expression_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7595
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7596
| xor_expression XOR error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7597
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7598
	 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
  7599
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7600
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7601
/* 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
  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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7604
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
  7605
  comparison
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7606
| and_expression '&' comparison
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7607
	{$$ = 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
  7608
| and_expression AND comparison
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7609
	{$$ = 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
  7610
/* 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
  7611
 *       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
  7612
 *       AND2!
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7613
 *       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
  7614
 *       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
  7615
 *       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
  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
| and_expression AND2 comparison
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7618
	{$$ = new and_expression_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7619
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7620
| and_expression '&' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7621
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7622
	 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
  7623
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7624
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7625
| and_expression AND error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7626
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7627
	 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
  7628
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7629
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7630
| and_expression AND2 error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7631
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7632
	 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
  7633
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7634
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7635
/* 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
  7636
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7637
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7638
comparison:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7639
  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
  7640
| comparison '=' equ_expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7641
	{$$ = 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
  7642
| comparison OPER_NE equ_expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7643
	{$$ = new notequ_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
| comparison '=' 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 '=' 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
| comparison OPER_NE error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7651
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7652
	 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
  7653
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7654
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7655
/* 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
  7656
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7657
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7658
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
  7659
  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
  7660
| equ_expression '<' add_expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7661
	{$$ = 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
  7662
| equ_expression '>' add_expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7663
	{$$ = 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
  7664
| equ_expression OPER_LE add_expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7665
	{$$ = 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
  7666
| equ_expression OPER_GE add_expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7667
	{$$ = new ge_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
| equ_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
| equ_expression '>' 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 '>' 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
| equ_expression OPER_LE 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
| equ_expression OPER_GE error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7685
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7686
	 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
  7687
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7688
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7689
/* 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
  7690
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7691
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7692
/* 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
  7693
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
  7694
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7695
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7696
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
  7697
  term
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7698
| add_expression '+' term
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7699
	{$$ = 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
  7700
| add_expression '-' term
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7701
	{$$ = new sub_expression_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7702
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7703
| add_expression '+' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7704
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7705
	 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
  7706
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7707
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7708
| add_expression '-' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7709
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7710
	 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
  7711
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7712
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7713
/* 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
  7714
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7715
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7716
/* 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
  7717
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
  7718
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7719
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7720
term:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7721
  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
  7722
| term '*' power_expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7723
	{$$ = 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
  7724
| term '/' power_expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7725
	{$$ = 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
  7726
| term MOD power_expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7727
	{$$ = new mod_expression_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7728
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7729
| term '*' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7730
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7731
	 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
  7732
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7733
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7734
| term '/' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7735
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7736
	 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
  7737
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7738
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7739
| term MOD error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7740
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7741
	 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
  7742
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7743
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7744
/* 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
  7745
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7746
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7747
/* 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
  7748
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
  7749
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7750
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7751
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
  7752
  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
  7753
| power_expression OPER_EXP unary_expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7754
	{$$ = new power_expression_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7755
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7756
| power_expression OPER_EXP error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7757
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7758
	 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
  7759
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7760
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7761
/* 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
  7762
;
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
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
  7766
  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
  7767
| '-' primary_expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7768
	{$$ = 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
  7769
| NOT primary_expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7770
	{$$ = new not_expression_c($2, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7771
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7772
| '-' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7773
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7774
	 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
  7775
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7776
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7777
| NOT error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7778
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7779
	 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
  7780
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7781
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7782
/* 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
  7783
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7784
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7785
/* 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
  7786
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
  7787
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7788
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7789
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7790
/* 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
  7791
 *       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
  7792
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7793
 *       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
  7794
 *       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
  7795
 *       (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
  7796
 *       OR
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7797
 *       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
  7798
 *       (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
  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
 *       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
  7801
 *       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
  7802
 */
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  7803
/* NOTE: We use enumerated_value_without_identifier instead of enumerated_value
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  7804
 *       in order to remove a reduce/reduce conflict between reducing an
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  7805
 *       identifier to a variable or an enumerated_value.
78
aead91ec37cd removing 'identifier' from definition of symbolic_variable
mario
parents: 77
diff changeset
  7806
 *
aead91ec37cd removing 'identifier' from definition of symbolic_variable
mario
parents: 77
diff changeset
  7807
 *       This change follows the IEC specification. The specification seems to
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  7808
 *       imply (by introducing syntax that allows to unambiguosly reference an
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  7809
 *       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
  7810
 *       for a variable and an enumerated value, then the variable shall be
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  7811
 *       considered.
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  7812
 */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7813
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
  7814
/* constant */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7815
  non_negative_constant
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  7816
//| enumerated_value_without_identifier
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  7817
| 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
  7818
| variable
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7819
| '(' expression ')'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7820
	{$$ = $2;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7821
|  function_invocation
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7822
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7823
| '(' expression error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7824
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7825
	 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
  7826
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7827
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7828
/* 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
  7829
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7830
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7831
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7832
/* 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
  7833
/* 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
  7834
 *       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
  7835
 *       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
  7836
 *       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
  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
 *       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
  7839
 *       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
  7840
 *           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
  7841
 *       with
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7842
 *           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
  7843
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7844
 *       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
  7845
 *       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
  7846
 *       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
  7847
 *       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
  7848
 *       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
  7849
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7850
 *       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
  7851
 *       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
  7852
 *       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
  7853
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7854
 *       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
  7855
 *       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
  7856
 *       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
  7857
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7858
function_invocation:
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  7859
/*  function_name '(' [param_assignment_list] ')' */
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  7860
  function_name_no_NOT_clashes '(' param_assignment_formal_list ')'
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  7861
	{$$ = new function_invocation_c($1, $3, locloc(@$));}
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  7862
| function_name_no_NOT_clashes '(' param_assignment_nonformal_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7863
	{$$ = new function_invocation_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7864
/* ERROR_CHECK_BEGIN */ 
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7865
| function_name_no_NOT_clashes param_assignment_formal_list ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7866
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7867
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7868
	 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
  7869
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7870
| function_name_no_NOT_clashes error param_assignment_formal_list ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7871
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7872
	 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
  7873
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7874
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7875
| function_name_no_NOT_clashes error param_assignment_nonformal_list ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7876
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7877
	 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
  7878
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7879
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7880
| function_name_no_NOT_clashes '(' ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7881
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7882
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7883
	 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
  7884
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7885
| function_name_no_NOT_clashes '(' error ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7886
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7887
	 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
  7888
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7889
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7890
| function_name_no_NOT_clashes '(' param_assignment_formal_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7891
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7892
	 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
  7893
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7894
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7895
| function_name_no_NOT_clashes '(' param_assignment_nonformal_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7896
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7897
	 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
  7898
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7899
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7900
/* 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
  7901
;
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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7904
/********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7905
/* 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
  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
statement_list:
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  7908
  statement ';'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7909
	{$$ = new statement_list_c(locloc(@$)); $$->add_element($1);}
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  7910
| pragma
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7911
	{$$ = 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
  7912
| 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
  7913
	{$$ = $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
  7914
| 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
  7915
	{$$ = $1; $$->add_element($2);}
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7916
/* ERROR_CHECK_BEGIN */
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7917
| statement_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7918
	{$$ = $1;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7919
	 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
  7920
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7921
	}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7922
| statement_list error ';'
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7923
	{$$ = $1;
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7924
	 print_err_msg(current_filename, locf(@1), locl(@3), "invalid statement in ST statement.");
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7925
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7926
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7927
| statement_list statement error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7928
	{$$ = $1;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7929
	 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at the end of 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
  7930
	 yyerrok;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7931
	}
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7932
/* 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
  7933
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7934
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7935
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7936
statement:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7937
  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
  7938
| 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
  7939
| 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
  7940
| 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
  7941
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7942
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7943
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7944
/*********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7945
/* 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
  7946
/*********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7947
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
  7948
  variable ASSIGN expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7949
	{$$ = new assignment_statement_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7950
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7951
| variable ASSIGN error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7952
	{$$ = $1;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7953
	 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
  7954
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7955
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7956
/* 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
  7957
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7958
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7959
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7960
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7961
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7962
/*****************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7963
/* 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
  7964
/*****************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7965
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
  7966
  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
  7967
| 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
  7968
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7969
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7970
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7971
return_statement:
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7972
  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
  7973
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7974
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7975
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7976
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  7977
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
  7978
  prev_declared_fb_name '(' ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7979
	{$$ = new fb_invocation_c($1, NULL, locloc(@$));	}
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  7980
| prev_declared_fb_name '(' param_assignment_formal_list ')'
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  7981
	{$$ = new fb_invocation_c($1, $3, locloc(@$));}
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  7982
| prev_declared_fb_name '(' param_assignment_nonformal_list ')'
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  7983
	{$$ = new fb_invocation_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7984
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7985
| prev_declared_fb_name ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7986
	{$$ = $1;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7987
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7988
	 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
  7989
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7990
| prev_declared_fb_name param_assignment_formal_list ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7991
	{$$ = $1;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7992
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7993
	 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
  7994
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7995
| prev_declared_fb_name error ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7996
	{$$ = $1;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7997
	 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
  7998
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  7999
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8000
| prev_declared_fb_name error param_assignment_formal_list ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8001
	{$$ = $1;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8002
	 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
  8003
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8004
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8005
| prev_declared_fb_name error param_assignment_nonformal_list ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8006
	{$$ = $1;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8007
	 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
  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
| prev_declared_fb_name '(' error ')'
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8011
	{$$ = $1;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8012
	 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
  8013
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8014
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8015
| prev_declared_fb_name '(' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8016
	{$$ = $1;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8017
	 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
  8018
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8019
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8020
| prev_declared_fb_name '(' param_assignment_formal_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8021
	{$$ = $1;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8022
	 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
  8023
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8024
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8025
| prev_declared_fb_name '(' param_assignment_nonformal_list error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8026
	{$$ = $1;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8027
	 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
  8028
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8029
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8030
/* 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
  8031
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8032
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8033
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8034
/* 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
  8035
 * - 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
  8036
 * - 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
  8037
 */
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8038
param_assignment_formal_list:
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8039
  param_assignment_formal
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8040
	{$$ = new param_assignment_list_c(locloc(@$)); $$->add_element($1);}
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8041
| 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
  8042
	{$$ = $1; $$->add_element($3);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8043
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8044
| param_assignment_formal_list error param_assignment_formal
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8045
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8046
	 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
  8047
	 yyerrok;
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
| param_assignment_formal_list ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8050
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8051
	 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
  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
/* 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
  8055
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8056
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8057
/* helper symbol for
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8058
 * - fb_invocation
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8059
 * - function_invocation
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8060
 */
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8061
param_assignment_nonformal_list:
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8062
  param_assignment_nonformal
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8063
	{$$ = new param_assignment_list_c(locloc(@$)); $$->add_element($1);}
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8064
| param_assignment_nonformal_list ',' param_assignment_nonformal
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8065
	{$$ = $1; $$->add_element($3);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8066
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8067
| param_assignment_nonformal_list ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8068
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8069
	 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
  8070
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8071
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8072
/* ERROR_CHECK_END */
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8073
;
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8074
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8075
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8076
/* NOTE: According to the IEC 61131-3 standard, there are two possible
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8077
 *       syntaxes for calling function blocks within ST.
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8078
 *       The formal method has the form:
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8079
 *        fb ( invar := x, inoutvar := var1, outvar => var2);
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8080
 *       The non-formal method has the form:
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8081
 *        fb (x, var1, var2);
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8082
 *       In the text of IEC 61131-3 (where the semantics are defined),
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8083
 *       it is obvious that mixing the two syntaxes is considered incorrect.
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8084
 *       The following should therefore be incorrect: 
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8085
 *        fb ( invar := x, var1, var2);
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8086
 *       However, according to the syntax definition, as defined in IEC 61131-3,
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8087
 *       mixing the formal and non-formal methods of invocation is allowed.
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8088
 *       We have two alternatives:
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8089
 *        (a) implement the syntax here in iec.y according to the standard,
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8090
 *            and leave it to the semantic analyser stage to find this error
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8091
 *        (b) or implement the syntax in iec.y correctly, not allowing 
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8092
 *            the mixing of formal and non-formal invocation syntaxes.
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8093
 *       Considering that this is a syntax issue, and not semantic issue,
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8094
 *       I (Mario) have decided to go with alternative (a).
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8095
 *       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
  8096
 *       Annex B of the IEC 61131-3 standard, but rather implement
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8097
 *       the syntax also taking into account the textual part of the standard too.
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8098
 */
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8099
/*
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8100
param_assignment:
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8101
  variable_name ASSIGN expression 
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8102
*/
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8103
param_assignment_nonformal:
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8104
  expression
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8105
;
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8106
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8107
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8108
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
  8109
  any_identifier ASSIGN expression
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8110
	{$$ = 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
  8111
/*| 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
  8112
/*| 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
  8113
| sendto_identifier SENDTO variable
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8114
	{$$ = new output_variable_param_assignment_c(NULL,$1, $3, locloc(@$));}
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8115
/*| 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
  8116
/*| 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
  8117
| NOT sendto_identifier SENDTO variable
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8118
	{$$ = 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
  8119
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8120
| any_identifier ASSIGN error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8121
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8122
	 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
  8123
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8124
	} 
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8125
| sendto_identifier SENDTO error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8126
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8127
	 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
  8128
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8129
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8130
| NOT SENDTO variable
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8131
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8132
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8133
	 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
  8134
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8135
| NOT error SENDTO variable
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8136
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8137
	 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
  8138
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8139
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8140
| NOT sendto_identifier SENDTO error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8141
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8142
	 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
  8143
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8144
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8145
/* 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
  8146
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8147
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8148
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8149
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8150
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8151
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8152
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8153
/* 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
  8154
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8155
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
  8156
  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
  8157
| 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
  8158
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8159
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8160
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8161
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
  8162
  IF expression THEN statement_list elseif_statement_list END_IF
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8163
	{$$ = 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
  8164
| IF expression THEN statement_list elseif_statement_list ELSE statement_list END_IF
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8165
	{$$ = new if_statement_c($2, $4, $5, $7, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8166
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8167
| IF THEN statement_list elseif_statement_list END_IF
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8168
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8169
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8170
	 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
  8171
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8172
| IF THEN statement_list elseif_statement_list ELSE statement_list END_IF
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8173
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8174
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8175
	 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
  8176
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8177
| IF error THEN statement_list elseif_statement_list END_IF
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8178
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8179
	 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
  8180
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8181
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8182
| 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
  8183
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8184
	 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
  8185
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8186
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8187
| IF expression error statement_list elseif_statement_list END_IF
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8188
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8189
	 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
  8190
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8191
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8192
| 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
  8193
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8194
	 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
  8195
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8196
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8197
| IF expression THEN elseif_statement_list END_IF
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8198
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8199
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8200
	 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
  8201
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8202
| IF expression THEN elseif_statement_list ELSE statement_list END_IF
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8203
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8204
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8205
	 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
  8206
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8207
| IF expression THEN statement_list elseif_statement_list ELSE END_IF
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8208
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8209
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8210
	 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
  8211
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8212
| IF expression THEN statement_list elseif_statement_list ELSE error END_IF
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8213
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8214
	 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
  8215
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8216
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8217
| IF error END_IF
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8218
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8219
	 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
  8220
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8221
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8222
/* 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
  8223
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8224
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8225
/* 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
  8226
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
  8227
  /* empty */
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8228
	{$$ = 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
  8229
| 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
  8230
	{$$ = $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
  8231
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8232
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8233
/* 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
  8234
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
  8235
  ELSIF expression THEN statement_list
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8236
	{$$ = new elseif_statement_c($2, $4, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8237
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8238
| ELSIF THEN statement_list
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8239
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8240
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8241
	 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
  8242
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8243
| ELSIF error THEN statement_list
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8244
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8245
	 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
  8246
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8247
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8248
| ELSIF expression error statement_list
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8249
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8250
	 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
  8251
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8252
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8253
| ELSIF expression THEN error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8254
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8255
	 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
  8256
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8257
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8258
/* 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
  8259
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8260
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8261
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8262
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
  8263
  CASE expression OF case_element_list END_CASE
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8264
	{$$ = 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
  8265
| CASE expression OF case_element_list ELSE statement_list END_CASE
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8266
	{$$ = new case_statement_c($2, $4, $6, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8267
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8268
| CASE OF case_element_list END_CASE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8269
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8270
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8271
	 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
  8272
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8273
| CASE OF case_element_list ELSE statement_list END_CASE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8274
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8275
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8276
	 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
  8277
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8278
| CASE error OF case_element_list END_CASE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8279
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8280
	 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
  8281
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8282
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8283
| CASE error OF case_element_list ELSE statement_list END_CASE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8284
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8285
	 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
  8286
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8287
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8288
| CASE expression error case_element_list END_CASE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8289
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8290
	 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
  8291
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8292
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8293
| CASE expression error case_element_list ELSE statement_list END_CASE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8294
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8295
	 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
  8296
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8297
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8298
| CASE expression OF END_CASE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8299
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8300
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8301
	 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
  8302
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8303
| CASE expression OF ELSE statement_list END_CASE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8304
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8305
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8306
	 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
  8307
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8308
| CASE expression OF error END_CASE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8309
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8310
	 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
  8311
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8312
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8313
| CASE expression OF error ELSE statement_list END_CASE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8314
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8315
	 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
  8316
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8317
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8318
| CASE expression OF case_element_list ELSE END_CASE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8319
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8320
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8321
	 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
  8322
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8323
| CASE expression OF case_element_list ELSE error END_CASE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8324
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8325
	 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
  8326
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8327
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8328
| CASE error END_CASE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8329
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8330
	 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
  8331
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8332
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8333
/* 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
  8334
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8335
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8336
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8337
/* 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
  8338
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
  8339
  case_element
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8340
	{$$ = 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
  8341
| 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
  8342
	{$$ = $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
  8343
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8344
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8345
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8346
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
  8347
  case_list ':' statement_list
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8348
	{$$ = new case_element_c($1, $3, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8349
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8350
| case_list statement_list
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8351
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8352
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8353
	 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
  8354
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8355
| case_list ':' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8356
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8357
	 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
  8358
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8359
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8360
/* 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
  8361
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8362
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8363
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8364
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
  8365
  case_list_element
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8366
	{$$ = 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
  8367
| 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
  8368
	{$$ = $1; $$->add_element($3);}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8369
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8370
| case_list ',' error
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8371
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8372
	 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
  8373
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8374
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8375
/* 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
  8376
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8377
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8378
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8379
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
  8380
  signed_integer
78
aead91ec37cd removing 'identifier' from definition of symbolic_variable
mario
parents: 77
diff changeset
  8381
| 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
  8382
| 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
  8383
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8384
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8385
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8386
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8387
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
/* 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
  8391
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8392
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
  8393
  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
  8394
| 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
  8395
| 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
  8396
| 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
  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
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
  8401
  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
  8402
	{$$ = 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
  8403
| FOR control_variable ASSIGN expression TO expression DO statement_list END_FOR
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8404
	{$$ = new for_statement_c($2, $4, $6, NULL, $8, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8405
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8406
| FOR ASSIGN expression TO expression BY expression DO statement_list END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8407
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8408
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8409
	 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
  8410
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8411
| FOR ASSIGN expression TO expression DO statement_list END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8412
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8413
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8414
	 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
  8415
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8416
| 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
  8417
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8418
	 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
  8419
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8420
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8421
| FOR error ASSIGN expression TO expression DO statement_list END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8422
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8423
	 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
  8424
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8425
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8426
| 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
  8427
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8428
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8429
	 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
  8430
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8431
| FOR control_variable expression TO expression DO statement_list END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8432
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8433
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8434
	 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
  8435
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8436
| 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
  8437
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8438
	 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
  8439
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8440
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8441
| FOR control_variable error expression TO expression DO statement_list END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8442
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8443
	 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
  8444
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8445
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8446
| 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
  8447
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8448
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8449
	 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
  8450
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8451
| FOR control_variable ASSIGN TO expression DO statement_list END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8452
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8453
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8454
	 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
  8455
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8456
| 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
  8457
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8458
	 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
  8459
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8460
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8461
| FOR control_variable ASSIGN error TO expression DO statement_list END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8462
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8463
	 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
  8464
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8465
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8466
| 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
  8467
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8468
	 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
  8469
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8470
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8471
| FOR control_variable ASSIGN expression error expression DO statement_list END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8472
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8473
	 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
  8474
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8475
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8476
| 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
  8477
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8478
	 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
  8479
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8480
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8481
| 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
  8482
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8483
	 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
  8484
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8485
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8486
| FOR control_variable ASSIGN expression TO expression error statement_list END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8487
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8488
	 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
  8489
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8490
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8491
| FOR control_variable ASSIGN expression TO expression BY expression DO END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8492
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8493
	 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
  8494
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8495
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8496
| FOR control_variable ASSIGN expression TO expression DO END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8497
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8498
	 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
  8499
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8500
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8501
| 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
  8502
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8503
	 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
  8504
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8505
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8506
| FOR control_variable ASSIGN expression TO expression DO error END_FOR
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8507
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8508
	 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
  8509
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8510
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8511
/* 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
  8512
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8513
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8514
/* 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
  8515
 * 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
  8516
 * 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
  8517
 * (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
  8518
 * (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
  8519
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8520
 * 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
  8521
 * must have been declared in some VAR .. END_VAR
79
7417b346e5a3 fixing buf in FOR control variable.
mario
parents: 78
diff changeset
  8522
 * 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
  8523
 * control_variable: prev_declared_variable_name;
13
77174ccc5471 Many major changes to support SFC!
mario
parents: 10
diff changeset
  8524
 * 
79
7417b346e5a3 fixing buf in FOR control variable.
mario
parents: 78
diff changeset
  8525
 * If we don't, then the correct use of any previosuly declared 
7417b346e5a3 fixing buf in FOR control variable.
mario
parents: 78
diff changeset
  8526
 * 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
  8527
*/
79
7417b346e5a3 fixing buf in FOR control variable.
mario
parents: 78
diff changeset
  8528
control_variable: prev_declared_variable_name {$$ = $1;};
7417b346e5a3 fixing buf in FOR control variable.
mario
parents: 78
diff changeset
  8529
// 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
  8530
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8531
/* 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
  8532
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8533
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
  8534
  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
  8535
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8536
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8537
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8538
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8539
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
  8540
  WHILE expression DO statement_list END_WHILE
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8541
	{$$ = new while_statement_c($2, $4, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8542
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8543
| WHILE DO statement_list END_WHILE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8544
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8545
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8546
	 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
  8547
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8548
| WHILE error DO statement_list END_WHILE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8549
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8550
	 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
  8551
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8552
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8553
| WHILE expression error statement_list END_WHILE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8554
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8555
	 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
  8556
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8557
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8558
| WHILE expression DO END_WHILE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8559
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8560
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8561
	 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
  8562
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8563
| WHILE expression DO error END_WHILE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8564
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8565
	 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
  8566
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8567
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8568
| WHILE error END_WHILE
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8569
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8570
	 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
  8571
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8572
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8573
/* 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
  8574
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8575
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8576
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8577
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
  8578
  REPEAT statement_list UNTIL expression END_REPEAT
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8579
	{$$ = new repeat_statement_c($2, $4, locloc(@$));}
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8580
/* ERROR_CHECK_BEGIN */
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8581
| REPEAT UNTIL expression END_REPEAT
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8582
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8583
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8584
	 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
  8585
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8586
| REPEAT error UNTIL expression END_REPEAT
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8587
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8588
	 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
  8589
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8590
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8591
| REPEAT statement_list UNTIL END_REPEAT
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8592
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8593
	 yynerrs++;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8594
	 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
  8595
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8596
| REPEAT statement_list UNTIL error END_REPEAT
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8597
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8598
	 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
  8599
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8600
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8601
| REPEAT error END_REPEAT
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8602
  {$$ = NULL;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8603
	 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
  8604
	 yyerrok;
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8605
	}
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8606
/* 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
  8607
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8608
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8609
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8610
exit_statement:
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8611
  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
  8612
;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8613
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8614
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8615
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8616
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8617
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8618
%%
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8619
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8620
#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
  8621
#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
  8622
#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
  8623
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8624
/* 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
  8625
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
  8626
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
  8627
15
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8628
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8629
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8630
/* 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
  8631
 * 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
  8632
 * but disallows them in user code...
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8633
 */
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8634
bool allow_function_overloading = false;
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8635
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8636
/* 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
  8637
 * by bison.
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8638
 */
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8639
symbol_c *tree_root;
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8640
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8641
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8642
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8643
/* 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
  8644
 * 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
  8645
 * 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
  8646
 * 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
  8647
 * 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
  8648
 * 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
  8649
 * (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
  8650
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8651
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
  8652
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
  8653
  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
  8654
/* fprintf(stderr, "error %d: %s\n", yynerrs // global variable //, error_msg); */
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8655
/*  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
  8656
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8657
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8658
95
b119b1db0a7a Changing format of error reporting.
mario
parents: 94
diff changeset
  8659
void print_err_msg(const char *filename,
b119b1db0a7a Changing format of error reporting.
mario
parents: 94
diff changeset
  8660
                   int first_line,
b119b1db0a7a Changing format of error reporting.
mario
parents: 94
diff changeset
  8661
                   int first_column,
b119b1db0a7a Changing format of error reporting.
mario
parents: 94
diff changeset
  8662
                   int last_line,
b119b1db0a7a Changing format of error reporting.
mario
parents: 94
diff changeset
  8663
                   int last_column,
b119b1db0a7a Changing format of error reporting.
mario
parents: 94
diff changeset
  8664
                   const char *additional_error_msg) {
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8665
  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
  8666
  //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
  8667
  print_include_stack();
131
f55ef301e14c Adding some human-readable error messages
lbessard
parents: 121
diff changeset
  8668
  //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
  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
/* 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
  8674
/* 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
  8675
 * 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
  8676
 * 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
  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
#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
  8679
  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
  8680
  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
  8681
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8682
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8683
/* 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
  8684
 *       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
  8685
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8686
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
  8687
  const char *name = NULL;
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8688
  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
  8689
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8690
  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
  8691
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8692
  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
  8693
  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
  8694
  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
  8695
  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
  8696
  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
  8697
  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
  8698
  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
  8699
  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
  8700
  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
  8701
  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
  8702
  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
  8703
  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
  8704
  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
  8705
  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
  8706
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8707
  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
  8708
  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
  8709
  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
  8710
  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
  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
  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
  8713
  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
  8714
  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
  8715
  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
  8716
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8717
  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
  8718
  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
  8719
  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
  8720
  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
  8721
  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
  8722
  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
  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
  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
  8725
  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
  8726
  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
  8727
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8728
  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
  8729
  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
  8730
  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
  8731
  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
  8732
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_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
  8734
  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
  8735
  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
  8736
  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
  8737
  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
  8738
  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
  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
  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
  8741
  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
  8742
  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
  8743
  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
  8744
  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
  8745
  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
  8746
  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
  8747
  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
  8748
  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
  8749
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8750
  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
  8751
    ERROR;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8752
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8753
  res = new identifier_c(strdup(name), 
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8754
                         il_operator->first_line,
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8755
                         il_operator->first_column,
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8756
                         il_operator->last_line,
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8757
                         il_operator->last_column
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8758
                        );
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8759
  free(il_operator);
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8760
  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
  8761
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8762
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8763
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
  8764
#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
  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
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
  8767
// 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
  8768
//   Table 34 - Standard bistable function blocks
73
0e623bbdee95 fixing infinite error loops at library level, and ...
mario
parents: 68
diff changeset
  8769
"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
  8770
// 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
  8771
//   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
  8772
"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
  8773
// 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
  8774
//   Table 36 - Standard counter function blocks
68
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8775
"CTU","CTU_DINT","CTU_LINT","CTU_UDINT","CTU_ULINT",
b0a43002dcac Adding basic error checking.
mario
parents: 52
diff changeset
  8776
"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
  8777
"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
  8778
// 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
  8779
//   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
  8780
"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
  8781
/* 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
  8782
NULL
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8783
};
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8784
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8785
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8786
#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
  8787
#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
  8788
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
  8789
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
  8790
15
0b472e25eb16 Adding changes to make the compiler compatible with bison ver 2.3
mario
parents: 13
diff changeset
  8791
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
  8792
  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
  8793
  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
  8794
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8795
  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
  8796
    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
  8797
    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
  8798
    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
  8799
    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
  8800
  }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8801
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8802
  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
  8803
    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
  8804
  }
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
  8805
  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
  8806
    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
  8807
    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
  8808
  }
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
  8809
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
  8810
  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
  8811
    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
  8812
    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
  8813
    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
  8814
  }
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
  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
  8817
    /* 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
  8818
    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
  8819
    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
  8820
    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
  8821
  }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8822
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8823
  /* 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
  8824
  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
  8825
  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
  8826
  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
  8827
  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
  8828
  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
  8829
      ERROR;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8830
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8831
  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
  8832
    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
  8833
    ERROR;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8834
  }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8835
  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
  8836
  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
  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
  /* 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
  8839
   * 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
  8840
   */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8841
  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
  8842
    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
  8843
        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
  8844
      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
  8845
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8846
  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
  8847
    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
  8848
        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
  8849
      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
  8850
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8851
#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
  8852
  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
  8853
#endif
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
  /* 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
  8856
  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
  8857
  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
  8858
  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
  8859
  current_filename = filename;
85
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8860
  {int res;
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8861
    if ((res = yyparse()) != 0) {
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8862
      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
  8863
      ERROR;
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8864
    }
a6e651ba55c2 Fixing handling of enumeration values;
mario
parents: 79
diff changeset
  8865
  }
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8866
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8867
  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
  8868
    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
  8869
    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
  8870
  }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8871
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8872
  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
  8873
    *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
  8874
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8875
  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
  8876
  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
  8877
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8878
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8879
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  8880