stage4/generate_iec/generate_iec.cc
author mjsousa
Sat, 15 Mar 2014 20:10:20 +0000
changeset 876 e2c4f6f4abe2
parent 873 dea39ef02847
child 878 89eb85bab58f
permissions -rw-r--r--
Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
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
/*
267
0a1204bcc9af starting to add proper header file with declaration of standard functions
Mario de Sousa <msousa@fe.up.pt>
parents: 257
diff changeset
     2
 *  matiec - a compiler for the programming languages defined in IEC 61131-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
     3
 *
267
0a1204bcc9af starting to add proper header file with declaration of standard functions
Mario de Sousa <msousa@fe.up.pt>
parents: 257
diff changeset
     4
 *  Copyright (C) 2003-2011  Mario de Sousa (msousa@fe.up.pt)
279
c0453b7f99df Re-generated std lib related code, with updated headers, updated all forgotten headers
Edouard Tisserant
parents: 267
diff changeset
     5
 *  Copyright (C) 2007-2011  Laurent Bessard and Edouard Tisserant
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
     6
 *
267
0a1204bcc9af starting to add proper header file with declaration of standard functions
Mario de Sousa <msousa@fe.up.pt>
parents: 257
diff changeset
     7
 *  This program is free software: you can redistribute it and/or modify
0a1204bcc9af starting to add proper header file with declaration of standard functions
Mario de Sousa <msousa@fe.up.pt>
parents: 257
diff changeset
     8
 *  it under the terms of the GNU General Public License as published by
0a1204bcc9af starting to add proper header file with declaration of standard functions
Mario de Sousa <msousa@fe.up.pt>
parents: 257
diff changeset
     9
 *  the Free Software Foundation, either version 3 of the License, or
0a1204bcc9af starting to add proper header file with declaration of standard functions
Mario de Sousa <msousa@fe.up.pt>
parents: 257
diff changeset
    10
 *  (at your option) any later version.
0a1204bcc9af starting to add proper header file with declaration of standard functions
Mario de Sousa <msousa@fe.up.pt>
parents: 257
diff changeset
    11
 *
0a1204bcc9af starting to add proper header file with declaration of standard functions
Mario de Sousa <msousa@fe.up.pt>
parents: 257
diff changeset
    12
 *  This program is distributed in the hope that it will be useful,
0a1204bcc9af starting to add proper header file with declaration of standard functions
Mario de Sousa <msousa@fe.up.pt>
parents: 257
diff changeset
    13
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
0a1204bcc9af starting to add proper header file with declaration of standard functions
Mario de Sousa <msousa@fe.up.pt>
parents: 257
diff changeset
    14
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0a1204bcc9af starting to add proper header file with declaration of standard functions
Mario de Sousa <msousa@fe.up.pt>
parents: 257
diff changeset
    15
 *  GNU General Public License for more details.
0a1204bcc9af starting to add proper header file with declaration of standard functions
Mario de Sousa <msousa@fe.up.pt>
parents: 257
diff changeset
    16
 *
0a1204bcc9af starting to add proper header file with declaration of standard functions
Mario de Sousa <msousa@fe.up.pt>
parents: 257
diff changeset
    17
 *  You should have received a copy of the GNU General Public License
0a1204bcc9af starting to add proper header file with declaration of standard functions
Mario de Sousa <msousa@fe.up.pt>
parents: 257
diff changeset
    18
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
0a1204bcc9af starting to add proper header file with declaration of standard functions
Mario de Sousa <msousa@fe.up.pt>
parents: 257
diff changeset
    19
 *
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    20
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    21
 * 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
    22
 * 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
    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
/*
267
0a1204bcc9af starting to add proper header file with declaration of standard functions
Mario de Sousa <msousa@fe.up.pt>
parents: 257
diff changeset
    26
 * An IEC 61131-3 compiler.
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    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
 * 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
    29
 * 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
    30
 *
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    31
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    32
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    33
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
 * Code to be included into the code generated by the 4th stage.
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
 * This is part of the 4th stage that generates
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    38
 * a ST and IL source program equivalent to the IL and ST
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    39
 * code.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    40
 * This is expected to be used mainly in debuging 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
    41
 * and lexical parser, and as a starting point for other
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    42
 * 4th stages.
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    43
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    44
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    45
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    46
580
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
    47
/* Compile with the following option, to print out the const_value of each symbol, which was filled in by constant_folding_c during stage3 */
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
    48
// #define DEBUG_CONST_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
    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
// #include <stdio.h>  /* required for NULL */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    53
#include <string>
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    54
#include <iostream>
27
667721cf52c5 Now, stage4out can address files. Generate_cc have been split into one visitor per C file : pous, ressource and config. Work in progress.
etisserant
parents: 17
diff changeset
    55
#include <sstream>
202
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
    56
#include <typeinfo>
0
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 "generate_iec.hh"
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
#include "../stage4.hh"
596
4efb11e44065 Add ERROR_MSG macro && move extract_XXX() functions to constant_folding.cc
Mario de Sousa <msousa@fe.up.pt>
parents: 580
diff changeset
    60
#include "../../main.hh" // required for ERROR() and ERROR_MSG() macros.
4efb11e44065 Add ERROR_MSG macro && move extract_XXX() functions to constant_folding.cc
Mario de Sousa <msousa@fe.up.pt>
parents: 580
diff changeset
    61
4efb11e44065 Add ERROR_MSG macro && move extract_XXX() functions to constant_folding.cc
Mario de Sousa <msousa@fe.up.pt>
parents: 580
diff changeset
    62
4efb11e44065 Add ERROR_MSG macro && move extract_XXX() functions to constant_folding.cc
Mario de Sousa <msousa@fe.up.pt>
parents: 580
diff changeset
    63
459
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 453
diff changeset
    64
0
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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    67
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    68
//class generate_iec_c: public iterator_visitor_c {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    69
class generate_iec_c: public visitor_c {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    70
  private:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    71
    stage4out_c &s4o;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    72
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    73
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    74
  public:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    75
    generate_iec_c(stage4out_c *s4o_ptr): s4o(*s4o_ptr) {}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    76
    ~generate_iec_c(void) {}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    77
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    78
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    79
  private:
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    80
580
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
    81
    
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
    82
void print_const_value(symbol_c *symbol) {
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
    83
#ifdef DEBUG_CONST_VALUE
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
    84
  if (NULL == symbol) return;
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
    85
  bool first = true;
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
    86
  
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
    87
  if (NULL != symbol->const_value_uint64) {
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
    88
    first?s4o.print("{"):s4o.print("; ");
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
    89
    first = false;
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
    90
    s4o.print("uint64:");
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
    91
    if (symbol->const_value_uint64->status == symbol_c::cs_const_value)
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
    92
      s4o.print_uint64(symbol->const_value_uint64->value);
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
    93
    if (symbol->const_value_uint64->status == symbol_c::cs_overflow)
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
    94
    s4o.print("OVERFLOW");
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
    95
  }
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
    96
  if (NULL != symbol->const_value_int64) {
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
    97
    first?s4o.print("{"):s4o.print("; ");
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
    98
    first = false;
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
    99
    s4o.print("int64:");
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   100
    if (symbol->const_value_int64->status == symbol_c::cs_const_value)
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   101
      s4o.print_int64(symbol->const_value_int64->value);
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   102
    if (symbol->const_value_int64->status == symbol_c::cs_overflow)
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   103
    s4o.print("OVERFLOW");
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   104
  }
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   105
  if (NULL != symbol->const_value_real64) {
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   106
    first?s4o.print("{"):s4o.print("; ");
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   107
    first = false;
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   108
    s4o.print("real64:");
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   109
    if (symbol->const_value_real64->status == symbol_c::cs_const_value)
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   110
      s4o.print_real64(symbol->const_value_real64->value);
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   111
    if (symbol->const_value_real64->status == symbol_c::cs_overflow)
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   112
    s4o.print("OVERFLOW");
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   113
  }
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   114
  if (NULL != symbol->const_value_bool) {
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   115
    first?s4o.print("{"):s4o.print("; ");
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   116
    first = false;
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   117
    s4o.print("bool:");
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   118
    if (symbol->const_value_bool->status == symbol_c::cs_const_value)
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   119
      s4o.print((symbol->const_value_bool->value)?"true":"false");
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   120
    if (symbol->const_value_bool->status == symbol_c::cs_overflow)
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   121
    s4o.print("OVERFLOW");
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   122
  }
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   123
  if (!first) s4o.print("}");  
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   124
#endif
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   125
  return;
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   126
}
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   127
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   128
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   129
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   130
void *print_token(token_c *token) {
580
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   131
  print_const_value(token);
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   132
  return s4o.print(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
   133
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   134
580
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   135
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   136
void *print_literal(symbol_c *type, symbol_c *value) {
580
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   137
  print_const_value(value);
257
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   138
  if (NULL != type) {
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   139
    type->accept(*this);
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   140
    s4o.print("#");
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   141
  }
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   142
  value->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   143
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   144
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   145
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   146
void *print_list(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
   147
			       std::string pre_elem_str = "",
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   148
			       std::string inter_elem_str = "",
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   149
			       std::string post_elem_str = "") {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   150
  if (list->n > 0) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   151
    s4o.print(pre_elem_str);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   152
    list->elements[0]->accept(*this);
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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   155
  for(int i = 1; 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
   156
    s4o.print(inter_elem_str);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   157
    list->elements[i]->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   158
  }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   159
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   160
  if (list->n > 0)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   161
    s4o.print(post_elem_str);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   162
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   163
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   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
580
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   167
void *print_binary_expression(symbol_c *symbol,
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   168
			      symbol_c *l_exp,
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   169
			      symbol_c *r_exp,
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   170
			      const char *operation) {
580
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   171
  print_const_value(symbol);
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   172
  s4o.print("(");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   173
  l_exp->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   174
  s4o.print(operation);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   175
  r_exp->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   176
  s4o.print(")");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   177
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   178
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   179
580
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   180
void *print_unary_expression(symbol_c *symbol,
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   181
			     symbol_c *exp,
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   182
			     const char *operation) {
580
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   183
  print_const_value(symbol);
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   184
  s4o.print(operation);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   185
  exp->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   186
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   187
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   188
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   189
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   190
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   191
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   192
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   193
  public:
143
73372bdeeffb Adding support for EN/ENO parameters in bison rules
lbessard
parents: 118
diff changeset
   194
73372bdeeffb Adding support for EN/ENO parameters in bison rules
lbessard
parents: 118
diff changeset
   195
/*  EN/ENO */
202
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   196
#if 0
143
73372bdeeffb Adding support for EN/ENO parameters in bison rules
lbessard
parents: 118
diff changeset
   197
void *visit(en_param_c *symbol) {
73372bdeeffb Adding support for EN/ENO parameters in bison rules
lbessard
parents: 118
diff changeset
   198
  s4o.print("EN");
73372bdeeffb Adding support for EN/ENO parameters in bison rules
lbessard
parents: 118
diff changeset
   199
  return NULL;
73372bdeeffb Adding support for EN/ENO parameters in bison rules
lbessard
parents: 118
diff changeset
   200
}
73372bdeeffb Adding support for EN/ENO parameters in bison rules
lbessard
parents: 118
diff changeset
   201
73372bdeeffb Adding support for EN/ENO parameters in bison rules
lbessard
parents: 118
diff changeset
   202
void *visit(eno_param_c *symbol) {
73372bdeeffb Adding support for EN/ENO parameters in bison rules
lbessard
parents: 118
diff changeset
   203
  s4o.print("ENO");
73372bdeeffb Adding support for EN/ENO parameters in bison rules
lbessard
parents: 118
diff changeset
   204
  return NULL;
73372bdeeffb Adding support for EN/ENO parameters in bison rules
lbessard
parents: 118
diff changeset
   205
}
202
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   206
void *visit(en_param_c *symbol) {
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   207
  return symbol->param_name->accept(*this);
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   208
}
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   209
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   210
void *visit(eno_param_c *symbol) {
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   211
  return symbol->param_name->accept(*this);
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   212
}
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   213
#endif
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   214
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   215
459
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 453
diff changeset
   216
/* A class used to identify an entry (literal, variable, etc...) in the abstract syntax tree with an invalid data type */
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 453
diff changeset
   217
/* This is only used from stage3 onwards. Stages 1 and 2 will never create any instances of invalid_type_name_c */
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 453
diff changeset
   218
// SYM_REF0(invalid_type_name_c)
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 453
diff changeset
   219
void *visit(invalid_type_name_c *symbol) {
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 453
diff changeset
   220
  ERROR;
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 453
diff changeset
   221
  return NULL;
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 453
diff changeset
   222
}
202
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   223
143
73372bdeeffb Adding support for EN/ENO parameters in bison rules
lbessard
parents: 118
diff changeset
   224
267
0a1204bcc9af starting to add proper header file with declaration of standard functions
Mario de Sousa <msousa@fe.up.pt>
parents: 257
diff changeset
   225
/******************/
0a1204bcc9af starting to add proper header file with declaration of standard functions
Mario de Sousa <msousa@fe.up.pt>
parents: 257
diff changeset
   226
/* 2.1.6 Pragmas  */
0a1204bcc9af starting to add proper header file with declaration of standard functions
Mario de Sousa <msousa@fe.up.pt>
parents: 257
diff changeset
   227
/******************/
0a1204bcc9af starting to add proper header file with declaration of standard functions
Mario de Sousa <msousa@fe.up.pt>
parents: 257
diff changeset
   228
void *visit(enable_code_generation_pragma_c*)  {s4o.print("{enable code generation}");  return NULL;}
0a1204bcc9af starting to add proper header file with declaration of standard functions
Mario de Sousa <msousa@fe.up.pt>
parents: 257
diff changeset
   229
void *visit(disable_code_generation_pragma_c*) {s4o.print("{disable code generation}"); return NULL;}
0a1204bcc9af starting to add proper header file with declaration of standard functions
Mario de Sousa <msousa@fe.up.pt>
parents: 257
diff changeset
   230
void *visit(pragma_c *symbol)                  {return print_token(symbol);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   231
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   232
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   233
/***************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   234
/* 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
   235
/***************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   236
void *visit(library_c *symbol) {return print_list(symbol);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   237
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   238
/*******************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   239
/* 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
   240
/*******************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   241
void *visit(identifier_c *symbol) {return print_token(symbol);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   242
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   243
/*********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   244
/* 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
   245
/*********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   246
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   247
/******************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   248
/* 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
   249
/******************************/
257
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   250
void *visit(real_c *symbol)               {return print_token(symbol);}
580
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   251
void *visit(neg_real_c *symbol)           {return print_unary_expression(symbol, symbol->exp, "-");}
257
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   252
void *visit(integer_c *symbol)            {return print_token(symbol);}
580
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
   253
void *visit(neg_integer_c *symbol)        {return print_unary_expression(symbol, symbol->exp, "-");}
257
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   254
void *visit(binary_integer_c *symbol)     {return print_token(symbol);}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   255
void *visit(octal_integer_c *symbol)      {return print_token(symbol);}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   256
void *visit(hex_integer_c *symbol)        {return print_token(symbol);}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   257
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   258
void *visit(integer_literal_c *symbol)    {return print_literal(symbol->type, symbol->value);}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   259
void *visit(real_literal_c *symbol)       {return print_literal(symbol->type, symbol->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
   260
void *visit(bit_string_literal_c *symbol) {return print_literal(symbol->type, symbol->value);}
257
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   261
void *visit(boolean_literal_c *symbol)    {return print_literal(symbol->type, symbol->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
   262
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   263
/* helper class for boolean_literal_c */
257
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   264
void *visit(boolean_true_c *symbol)       {s4o.print(/*"TRUE"*/"1"); return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   265
void *visit(boolean_false_c *symbol)      {s4o.print(/*"FALSE"*/"0"); return NULL;}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   266
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
/* 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
   269
/*******************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   270
void *visit(double_byte_character_string_c *symbol) {return print_token(symbol);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   271
void *visit(single_byte_character_string_c *symbol) {return print_token(symbol);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   272
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
/* 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
   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
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
/* 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
   280
/************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   281
void *visit(neg_time_c *symbol) {s4o.print("-"); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   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
void *visit(duration_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   284
  s4o.print("TIME#");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   285
  if (symbol->neg != NULL)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   286
    symbol->neg->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   287
  symbol->interval->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   288
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   289
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   290
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   291
void *visit(fixed_point_c *symbol) {return print_token(symbol);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   292
547
dab341e80664 Fix parsing os TIME literals & rename the extract_integer() function.
mjsousa <msousa@fe.up.pt>
parents: 459
diff changeset
   293
/* SYM_REF5(interval_c, days, hours, minutes, seconds, milliseconds) */
dab341e80664 Fix parsing os TIME literals & rename the extract_integer() function.
mjsousa <msousa@fe.up.pt>
parents: 459
diff changeset
   294
void *visit(interval_c *symbol) {
dab341e80664 Fix parsing os TIME literals & rename the extract_integer() function.
mjsousa <msousa@fe.up.pt>
parents: 459
diff changeset
   295
  if (NULL != symbol->days) {
dab341e80664 Fix parsing os TIME literals & rename the extract_integer() function.
mjsousa <msousa@fe.up.pt>
parents: 459
diff changeset
   296
    symbol->days->accept(*this);
dab341e80664 Fix parsing os TIME literals & rename the extract_integer() function.
mjsousa <msousa@fe.up.pt>
parents: 459
diff changeset
   297
    s4o.print("d");
dab341e80664 Fix parsing os TIME literals & rename the extract_integer() function.
mjsousa <msousa@fe.up.pt>
parents: 459
diff changeset
   298
  }
dab341e80664 Fix parsing os TIME literals & rename the extract_integer() function.
mjsousa <msousa@fe.up.pt>
parents: 459
diff changeset
   299
dab341e80664 Fix parsing os TIME literals & rename the extract_integer() function.
mjsousa <msousa@fe.up.pt>
parents: 459
diff changeset
   300
  if (NULL != symbol->hours) {
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   301
    symbol->hours->accept(*this);
547
dab341e80664 Fix parsing os TIME literals & rename the extract_integer() function.
mjsousa <msousa@fe.up.pt>
parents: 459
diff changeset
   302
    s4o.print("h");
dab341e80664 Fix parsing os TIME literals & rename the extract_integer() function.
mjsousa <msousa@fe.up.pt>
parents: 459
diff changeset
   303
  }
dab341e80664 Fix parsing os TIME literals & rename the extract_integer() function.
mjsousa <msousa@fe.up.pt>
parents: 459
diff changeset
   304
dab341e80664 Fix parsing os TIME literals & rename the extract_integer() function.
mjsousa <msousa@fe.up.pt>
parents: 459
diff changeset
   305
  if (NULL != symbol->minutes) {
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   306
    symbol->minutes->accept(*this);
547
dab341e80664 Fix parsing os TIME literals & rename the extract_integer() function.
mjsousa <msousa@fe.up.pt>
parents: 459
diff changeset
   307
    s4o.print("m");
dab341e80664 Fix parsing os TIME literals & rename the extract_integer() function.
mjsousa <msousa@fe.up.pt>
parents: 459
diff changeset
   308
  }
dab341e80664 Fix parsing os TIME literals & rename the extract_integer() function.
mjsousa <msousa@fe.up.pt>
parents: 459
diff changeset
   309
dab341e80664 Fix parsing os TIME literals & rename the extract_integer() function.
mjsousa <msousa@fe.up.pt>
parents: 459
diff changeset
   310
  if (NULL != symbol->seconds) {
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   311
    symbol->seconds->accept(*this);
547
dab341e80664 Fix parsing os TIME literals & rename the extract_integer() function.
mjsousa <msousa@fe.up.pt>
parents: 459
diff changeset
   312
    s4o.print("s");
dab341e80664 Fix parsing os TIME literals & rename the extract_integer() function.
mjsousa <msousa@fe.up.pt>
parents: 459
diff changeset
   313
  }
dab341e80664 Fix parsing os TIME literals & rename the extract_integer() function.
mjsousa <msousa@fe.up.pt>
parents: 459
diff changeset
   314
dab341e80664 Fix parsing os TIME literals & rename the extract_integer() function.
mjsousa <msousa@fe.up.pt>
parents: 459
diff changeset
   315
  if (NULL != symbol->milliseconds) {
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   316
    symbol->milliseconds->accept(*this);
547
dab341e80664 Fix parsing os TIME literals & rename the extract_integer() function.
mjsousa <msousa@fe.up.pt>
parents: 459
diff changeset
   317
    s4o.print("ms");
dab341e80664 Fix parsing os TIME literals & rename the extract_integer() function.
mjsousa <msousa@fe.up.pt>
parents: 459
diff changeset
   318
  }
dab341e80664 Fix parsing os TIME literals & rename the extract_integer() function.
mjsousa <msousa@fe.up.pt>
parents: 459
diff changeset
   319
dab341e80664 Fix parsing os TIME literals & rename the extract_integer() function.
mjsousa <msousa@fe.up.pt>
parents: 459
diff changeset
   320
  return NULL;
dab341e80664 Fix parsing os TIME literals & rename the extract_integer() function.
mjsousa <msousa@fe.up.pt>
parents: 459
diff changeset
   321
}
dab341e80664 Fix parsing os TIME literals & rename the extract_integer() function.
mjsousa <msousa@fe.up.pt>
parents: 459
diff changeset
   322
dab341e80664 Fix parsing os TIME literals & rename the extract_integer() function.
mjsousa <msousa@fe.up.pt>
parents: 459
diff changeset
   323
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   324
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   325
/************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   326
/* 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
   327
/************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   328
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   329
void *visit(time_of_day_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   330
  s4o.print("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
   331
  symbol->daytime->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   332
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   333
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   334
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   335
void *visit(daytime_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   336
  symbol->day_hour->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   337
  s4o.print(":");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   338
  symbol->day_minute->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   339
  s4o.print(":");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   340
  symbol->day_second->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   341
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   342
}
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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   345
void *visit(date_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   346
  s4o.print("DATE#");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   347
  symbol->date_literal->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   348
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   349
}
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
void *visit(date_literal_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   352
  symbol->year->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   353
  s4o.print("-");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   354
  symbol->month->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   355
  s4o.print("-");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   356
  symbol->day->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   357
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   360
void *visit(date_and_time_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   361
  s4o.print("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
   362
  symbol->date_literal->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   363
  s4o.print("-");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   364
  symbol->daytime->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   365
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   366
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   367
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   368
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
/***********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   371
/* 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
   372
/***********************************/
257
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   373
void *visit(time_type_name_c *symbol)        {s4o.print("TIME");        return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   374
void *visit(bool_type_name_c *symbol)        {s4o.print("BOOL");        return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   375
void *visit(sint_type_name_c *symbol)        {s4o.print("SINT");        return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   376
void *visit(int_type_name_c *symbol)         {s4o.print("INT");         return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   377
void *visit(dint_type_name_c *symbol)        {s4o.print("DINT");        return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   378
void *visit(lint_type_name_c *symbol)        {s4o.print("LINT");        return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   379
void *visit(usint_type_name_c *symbol)       {s4o.print("USINT");       return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   380
void *visit(uint_type_name_c *symbol)        {s4o.print("UINT");        return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   381
void *visit(udint_type_name_c *symbol)       {s4o.print("UDINT");       return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   382
void *visit(ulint_type_name_c *symbol)       {s4o.print("ULINT");       return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   383
void *visit(real_type_name_c *symbol)        {s4o.print("REAL");        return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   384
void *visit(lreal_type_name_c *symbol)       {s4o.print("LREAL");       return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   385
void *visit(date_type_name_c *symbol)        {s4o.print("DATE");        return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   386
void *visit(tod_type_name_c *symbol)         {s4o.print("TOD");         return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   387
void *visit(dt_type_name_c *symbol)          {s4o.print("DT");          return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   388
void *visit(byte_type_name_c *symbol)        {s4o.print("BYTE");        return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   389
void *visit(word_type_name_c *symbol)        {s4o.print("WORD");        return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   390
void *visit(lword_type_name_c *symbol)       {s4o.print("LWORD");       return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   391
void *visit(dword_type_name_c *symbol)       {s4o.print("DWORD");       return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   392
void *visit(string_type_name_c *symbol)      {s4o.print("STRING");      return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   393
void *visit(wstring_type_name_c *symbol)     {s4o.print("WSTRING");     return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   394
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   395
void *visit(safetime_type_name_c *symbol)    {s4o.print("SAFETIME");    return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   396
void *visit(safebool_type_name_c *symbol)    {s4o.print("SAFEBOOL");    return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   397
void *visit(safesint_type_name_c *symbol)    {s4o.print("SAFESINT");    return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   398
void *visit(safeint_type_name_c *symbol)     {s4o.print("SAFEINT");     return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   399
void *visit(safedint_type_name_c *symbol)    {s4o.print("SAFEDINT");    return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   400
void *visit(safelint_type_name_c *symbol)    {s4o.print("SAFELINT");    return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   401
void *visit(safeusint_type_name_c *symbol)   {s4o.print("SAFEUSINT");   return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   402
void *visit(safeuint_type_name_c *symbol)    {s4o.print("SAFEUINT");    return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   403
void *visit(safeudint_type_name_c *symbol)   {s4o.print("SAFEUDINT");   return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   404
void *visit(safeulint_type_name_c *symbol)   {s4o.print("SAFEULINT");   return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   405
void *visit(safereal_type_name_c *symbol)    {s4o.print("SAFEREAL");    return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   406
void *visit(safelreal_type_name_c *symbol)   {s4o.print("SAFELREAL");   return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   407
void *visit(safedate_type_name_c *symbol)    {s4o.print("SAFEDATE");    return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   408
void *visit(safetod_type_name_c *symbol)     {s4o.print("SAFETOD");     return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   409
void *visit(safedt_type_name_c *symbol)      {s4o.print("SAFEDT");      return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   410
void *visit(safebyte_type_name_c *symbol)    {s4o.print("SAFEBYTE");    return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   411
void *visit(safeword_type_name_c *symbol)    {s4o.print("SAFEWORD");    return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   412
void *visit(safelword_type_name_c *symbol)   {s4o.print("SAFELWORD");   return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   413
void *visit(safedword_type_name_c *symbol)   {s4o.print("SAFEDWORD");   return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   414
void *visit(safestring_type_name_c *symbol)  {s4o.print("SAFESTRING");  return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   415
void *visit(safewstring_type_name_c *symbol) {s4o.print("SAFEWSTRING"); return NULL;}
90782e241346 Huge change.
Mario de Sousa <msousa@fe.up.pt>
parents: 202
diff changeset
   416
0
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.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
   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
/*  TYPE type_declaration_list 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
   422
void *visit(data_type_declaration_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   423
  s4o.print("TYPE\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   424
  s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   425
  symbol->type_declaration_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   426
  s4o.indent_left();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   427
  s4o.print("END_TYPE\n\n\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   428
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   429
}
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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   432
/* 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
   433
/*| 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
   434
void *visit(type_declaration_list_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   435
  return print_list(symbol, s4o.indent_spaces, ";\n" + s4o.indent_spaces, ";\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   436
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   437
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   438
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   439
/*  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
   440
void *visit(simple_type_declaration_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   441
  symbol->simple_type_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   442
  s4o.print(" : ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   443
  symbol->simple_spec_init->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   444
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   445
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   446
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   447
/* 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
   448
void *visit(simple_spec_init_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   449
  symbol->simple_specification->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   450
  if (symbol->constant != NULL) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   451
    s4o.print(" := ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   452
    symbol->constant->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   453
  }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   454
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   455
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   456
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   457
/*  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
   458
void *visit(subrange_type_declaration_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   459
  symbol->subrange_type_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   460
  s4o.print(" : ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   461
  symbol->subrange_spec_init->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   462
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   463
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   464
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   465
/* subrange_specification ASSIGN 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
   466
void *visit(subrange_spec_init_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   467
  symbol->subrange_specification->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   468
  if (symbol->signed_integer != NULL) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   469
    s4o.print(" := ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   470
    symbol->signed_integer->accept(*this);
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
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   475
/*  integer_type_name '(' subrange')' */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   476
void *visit(subrange_specification_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   477
  symbol->integer_type_name->accept(*this);
98
d0cdf1d00b74 Adding support for derived data types.
lbessard
parents: 87
diff changeset
   478
  if (symbol->subrange != NULL) {
d0cdf1d00b74 Adding support for derived data types.
lbessard
parents: 87
diff changeset
   479
    s4o.print("(");
d0cdf1d00b74 Adding support for derived data types.
lbessard
parents: 87
diff changeset
   480
    symbol->subrange->accept(*this);
d0cdf1d00b74 Adding support for derived data types.
lbessard
parents: 87
diff changeset
   481
    s4o.print(")");
d0cdf1d00b74 Adding support for derived data types.
lbessard
parents: 87
diff changeset
   482
  }
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   483
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   484
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   485
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   486
/*  signed_integer DOTDOT 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
   487
void *visit(subrange_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   488
  symbol->lower_limit->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   489
  s4o.print(" .. ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   490
  symbol->upper_limit->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   491
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   492
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   493
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   494
/*  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
   495
void *visit(enumerated_type_declaration_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   496
  symbol->enumerated_type_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   497
  s4o.print(" : ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   498
  symbol->enumerated_spec_init->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   499
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   500
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   501
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   502
/* enumerated_specification ASSIGN 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
   503
void *visit(enumerated_spec_init_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   504
  symbol->enumerated_specification->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   505
  if (symbol->enumerated_value != NULL) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   506
    s4o.print(" := ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   507
    symbol->enumerated_value->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   508
  }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   509
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   510
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   511
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   512
/* helper symbol for enumerated_specification->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
   513
/* 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
   514
void *visit(enumerated_value_list_c *symbol) {print_list(symbol, "(", ", ", ")"); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   515
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   516
/* 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
   517
void *visit(enumerated_value_c *symbol) {
144
0ee0055a8ffe Bug with enumerated_value fixed
lbessard
parents: 143
diff changeset
   518
  if (symbol->type != NULL) {
0ee0055a8ffe Bug with enumerated_value fixed
lbessard
parents: 143
diff changeset
   519
    symbol->type->accept(*this);
0ee0055a8ffe Bug with enumerated_value fixed
lbessard
parents: 143
diff changeset
   520
    s4o.print("#");
0ee0055a8ffe Bug with enumerated_value fixed
lbessard
parents: 143
diff changeset
   521
  }
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   522
  symbol->value->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   523
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   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
/*  identifier ':' 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
   527
void *visit(array_type_declaration_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   528
  symbol->identifier->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   529
  s4o.print(" : ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   530
  symbol->array_spec_init->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   531
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   532
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   533
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   534
/* array_specification [ASSIGN 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
   535
/* array_initialization may be NULL ! */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   536
void *visit(array_spec_init_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   537
  symbol->array_specification->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   538
  if (symbol->array_initialization != NULL) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   539
    s4o.print(" := ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   540
    symbol->array_initialization->accept(*this);
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
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   543
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   544
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   545
/* ARRAY '[' array_subrange_list ']' OF 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
   546
void *visit(array_specification_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   547
  s4o.print("ARRAY [");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   548
  symbol->array_subrange_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   549
  s4o.print("] OF ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   550
  symbol->non_generic_type_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   551
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   552
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   553
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 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
   555
/* array_subrange_list ',' subrange */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   556
void *visit(array_subrange_list_c *symbol) {print_list(symbol, "", ", "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   557
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   558
/* 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
   559
/* 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
   560
void *visit(array_initial_elements_list_c *symbol) {print_list(symbol, "[", ", ", "]"); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   561
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   562
/* integer '(' [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
   563
/* array_initial_element may be NULL ! */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   564
void *visit(array_initial_elements_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   565
  symbol->integer->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   566
  s4o.print("(");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   567
  if (symbol->array_initial_element != NULL)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   568
    symbol->array_initial_element->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   569
  s4o.print(")");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   570
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   571
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   572
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   573
/*  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
   574
void *visit(structure_type_declaration_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   575
  symbol->structure_type_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   576
  s4o.print(" : ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   577
  symbol->structure_specification->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   578
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   579
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   580
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   581
/* structure_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
   582
/* structure_initialization may be NULL ! */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   583
void *visit(initialized_structure_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   584
  symbol->structure_type_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   585
  if (symbol->structure_initialization != NULL) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   586
    s4o.print(" := ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   587
    symbol->structure_initialization->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   588
  }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   589
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   590
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   591
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   592
/* 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
   593
/* structure_declaration:  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
   594
/* 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
   595
void *visit(structure_element_declaration_list_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   596
  s4o.print("STRUCT\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   597
  s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   598
  print_list(symbol, s4o.indent_spaces, ";\n" + s4o.indent_spaces, ";\n" + s4o.indent_spaces);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   599
  s4o.print("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
   600
  s4o.indent_left();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   601
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   602
}
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
/*  structure_element_name ':' *_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
   605
void *visit(structure_element_declaration_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   606
  symbol->structure_element_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   607
  s4o.print(" : ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   608
  symbol->spec_init->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   609
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   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
/* 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
   613
/* structure_initialization: '(' 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
   614
/* 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
   615
void *visit(structure_element_initialization_list_c *symbol) {print_list(symbol, "(", ", ", ")"); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   616
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   617
/*  structure_element_name ASSIGN value */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   618
void *visit(structure_element_initialization_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   619
  symbol->structure_element_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   620
  s4o.print(" := ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   621
  symbol->value->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   622
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   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
/*  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
   626
void *visit(string_type_declaration_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   627
  symbol->string_type_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   628
  s4o.print(" : ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   629
  symbol->elementary_string_type_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   630
  symbol->string_type_declaration_size->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   631
  if (symbol->string_type_declaration_init != NULL)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   632
    symbol->string_type_declaration_init->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   633
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   634
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   635
810
d9c48ad646f1 Add a new node to the abstract symtax tree, which will let us do datatype checking of FB variable declarations using the standard algorithm, and no special cases.
Mario de Sousa <msousa@fe.up.pt>
parents: 805
diff changeset
   636
/*  function_block_type_name ASSIGN structure_initialization */
d9c48ad646f1 Add a new node to the abstract symtax tree, which will let us do datatype checking of FB variable declarations using the standard algorithm, and no special cases.
Mario de Sousa <msousa@fe.up.pt>
parents: 805
diff changeset
   637
/* structure_initialization -> may be NULL ! */
d9c48ad646f1 Add a new node to the abstract symtax tree, which will let us do datatype checking of FB variable declarations using the standard algorithm, and no special cases.
Mario de Sousa <msousa@fe.up.pt>
parents: 805
diff changeset
   638
void *visit(fb_spec_init_c *symbol) {
d9c48ad646f1 Add a new node to the abstract symtax tree, which will let us do datatype checking of FB variable declarations using the standard algorithm, and no special cases.
Mario de Sousa <msousa@fe.up.pt>
parents: 805
diff changeset
   639
  symbol->function_block_type_name->accept(*this);
d9c48ad646f1 Add a new node to the abstract symtax tree, which will let us do datatype checking of FB variable declarations using the standard algorithm, and no special cases.
Mario de Sousa <msousa@fe.up.pt>
parents: 805
diff changeset
   640
  if (symbol->structure_initialization != NULL) {
d9c48ad646f1 Add a new node to the abstract symtax tree, which will let us do datatype checking of FB variable declarations using the standard algorithm, and no special cases.
Mario de Sousa <msousa@fe.up.pt>
parents: 805
diff changeset
   641
    s4o.print(" := ");
d9c48ad646f1 Add a new node to the abstract symtax tree, which will let us do datatype checking of FB variable declarations using the standard algorithm, and no special cases.
Mario de Sousa <msousa@fe.up.pt>
parents: 805
diff changeset
   642
    symbol->structure_initialization->accept(*this);
d9c48ad646f1 Add a new node to the abstract symtax tree, which will let us do datatype checking of FB variable declarations using the standard algorithm, and no special cases.
Mario de Sousa <msousa@fe.up.pt>
parents: 805
diff changeset
   643
  }
d9c48ad646f1 Add a new node to the abstract symtax tree, which will let us do datatype checking of FB variable declarations using the standard algorithm, and no special cases.
Mario de Sousa <msousa@fe.up.pt>
parents: 805
diff changeset
   644
  return NULL;
d9c48ad646f1 Add a new node to the abstract symtax tree, which will let us do datatype checking of FB variable declarations using the standard algorithm, and no special cases.
Mario de Sousa <msousa@fe.up.pt>
parents: 805
diff changeset
   645
}
0
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
876
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   649
/* ref_spec:  REF_TO (non_generic_type_name | function_block_type_name) */
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   650
// SYM_REF1(ref_spec_c, type_name)
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   651
void *visit(ref_spec_c *symbol) {
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   652
  s4o.print("REF_TO ");
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   653
  symbol->type_name->accept(*this);
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   654
  return NULL;
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   655
}
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   656
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   657
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   658
/* For the moment, we do not support initialising reference data types */
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   659
/* ref_spec_init: ref_spec; */ 
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   660
/* SYM_REF0(ref_spec_init_c) */
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   661
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   662
/* ref_type_decl: identifier ':' ref_spec_init */
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   663
// SYM_REF2(ref_type_decl_c, ref_type_name, ref_spec_init)
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   664
void *visit(ref_type_decl_c *symbol) {
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   665
  symbol->ref_type_name->accept(*this);
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   666
  s4o.print(" : ");
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   667
  symbol->ref_spec_init->accept(*this);
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   668
  return NULL;
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   669
}
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   670
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   671
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   672
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   673
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   674
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   675
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   676
e2c4f6f4abe2 Add support for parsing of REF_TO keyword (defined in IEC61131-3 v3). This support is currently inactive (in flex) until we get to add C code generation later on.
mjsousa
parents: 873
diff changeset
   677
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   678
/*********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   679
/* 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
   680
/*********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   681
void *visit(symbolic_variable_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   682
  symbol->var_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   683
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   684
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   685
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   686
/********************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   687
/* 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
   688
/********************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   689
void *visit(direct_variable_c *symbol) {return print_token(symbol);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   690
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   691
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   692
/*************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   693
/* 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
   694
/*************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   695
/*  subscripted_variable '[' 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
   696
void *visit(array_variable_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   697
  symbol->subscripted_variable->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   698
  s4o.print("[");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   699
  symbol->subscript_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   700
  s4o.print("]");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   701
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   702
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   703
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   704
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   705
/* 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
   706
void *visit(subscript_list_c *symbol) {return print_list(symbol, "", ", ");}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   707
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   708
/*  record_variable '.' 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
   709
void *visit(structured_variable_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   710
  symbol->record_variable->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   711
  s4o.print(".");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   712
  symbol->field_selector->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   713
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   714
}
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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   717
/******************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   718
/* 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
   719
/******************************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   720
void *visit(constant_option_c *symbol) {s4o.print("CONSTANT"); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   721
void *visit(retain_option_c *symbol) {s4o.print("RETAIN"); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   722
void *visit(non_retain_option_c *symbol) {s4o.print("NON_RETAIN"); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   723
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   724
/* VAR_INPUT [RETAIN | NON_RETAIN] input_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
   725
/* option -> the RETAIN/NON_RETAIN/<NULL> directive... */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   726
void *visit(input_declarations_c *symbol) {
202
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   727
  if (typeid(*(symbol->method)) == typeid(explicit_definition_c)) {
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   728
    s4o.print(s4o.indent_spaces); s4o.print("VAR_INPUT ");
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   729
    if (symbol->option != NULL)
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   730
      symbol->option->accept(*this);
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   731
    s4o.print("\n");
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   732
    s4o.indent_right();
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   733
    symbol->input_declaration_list->accept(*this);
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   734
    s4o.indent_left();
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   735
    s4o.print(s4o.indent_spaces); s4o.print("END_VAR\n");
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   736
  }
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   737
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   738
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   739
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   740
/* 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
   741
/*| 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
   742
void *visit(input_declaration_list_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   743
  return print_list(symbol, s4o.indent_spaces, ";\n" + s4o.indent_spaces, ";\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   744
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   745
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   746
/* edge -> The F_EDGE or R_EDGE directive */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   747
void *visit(edge_declaration_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   748
  symbol->var1_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   749
  s4o.print(" : BOOL ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   750
  symbol->edge->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   751
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   752
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   753
202
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   754
/* dummy classes only used as flags! */
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   755
void *visit(explicit_definition_c *symbol) {return NULL;}
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   756
void *visit(implicit_definition_c *symbol) {return NULL;}
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   757
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   758
/* EN : BOOL := 1 */
146
eef5e62048c7 Adding support for EN/ENO params in function and function blocks (standard function not supported yet)
lbessard
parents: 144
diff changeset
   759
void *visit(en_param_declaration_c *symbol) {
202
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   760
  if (typeid(*(symbol->method)) == typeid(explicit_definition_c)) {
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   761
    symbol->name->accept(*this);
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   762
    s4o.print(" : ");
805
b737cfc92614 Use simple_spec_init_c inside en_param_declaration_c (will reduce need to handle it as a special case in the future).
Mario de Sousa <msousa@fe.up.pt>
parents: 690
diff changeset
   763
    symbol->type_decl->accept(*this);
202
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   764
  }
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   765
  return NULL;
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   766
}
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   767
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   768
/* ENO : BOOL */
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   769
void *visit(eno_param_declaration_c *symbol) {
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   770
  if (typeid(*(symbol->method)) == typeid(explicit_definition_c)) {
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   771
    symbol->name->accept(*this);
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   772
    s4o.print(" : ");
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   773
    symbol->type->accept(*this);
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   774
  }
146
eef5e62048c7 Adding support for EN/ENO params in function and function blocks (standard function not supported yet)
lbessard
parents: 144
diff changeset
   775
  return NULL;
eef5e62048c7 Adding support for EN/ENO params in function and function blocks (standard function not supported yet)
lbessard
parents: 144
diff changeset
   776
}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   777
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   778
void *visit(raising_edge_option_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   779
  s4o.print("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
   780
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   781
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   782
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   783
void *visit(falling_edge_option_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   784
  s4o.print("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
   785
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   786
}
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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   789
/* var1_list is one of 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
   790
 *    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
   791
 *    subrange_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
   792
 *    enumerated_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
   793
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   794
void *visit(var1_init_decl_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   795
  symbol->var1_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   796
  s4o.print(" : ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   797
  symbol->spec_init->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   798
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   801
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   802
void *visit(var1_list_c *symbol) {return print_list(symbol, "", ", ");}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   803
350
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
   804
/* | [var1_list ','] variable_name '..' */
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
   805
/* NOTE: This is an extension to the standard!!! */
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
   806
/* In order to be able to handle extensible standard functions
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
   807
 * (i.e. standard functions that may have a variable number of
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
   808
 * input parameters, such as AND(word#33, word#44, word#55, word#66),
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
   809
 * we have extended the acceptable syntax to allow var_name '..'
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
   810
 * in an input variable declaration.
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
   811
 *
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
   812
 * This allows us to parse the declaration of standard
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
   813
 * extensible functions and load their interface definition
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
   814
 * into the abstract syntax tree just like we do to other 
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
   815
 * user defined functions.
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
   816
 * This has the advantage that we can later do semantic
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
   817
 * checking of calls to functions (be it a standard or user defined
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
   818
 * function) in (almost) exactly the same way.
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
   819
 *
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
   820
 * Of course, we have a flag that disables this syntax when parsing user
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
   821
 * written code, so we only allow this extra syntax while parsing the 
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
   822
 * 'header' file that declares all the standard IEC 61131-3 functions.
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
   823
 */
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
   824
void *visit(extensible_input_parameter_c *symbol) {
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
   825
  symbol->var_name->accept(*this);
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
   826
  s4o.print(" .. ");
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
   827
  return NULL;
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
   828
}
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
   829
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   830
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   831
/* var1_list ':' 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
   832
void *visit(array_var_init_decl_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   833
  symbol->var1_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   834
  s4o.print(" : ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   835
  symbol->array_spec_init->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   836
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   837
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   838
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   839
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   840
/*  var1_list ':' 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
   841
void *visit(structured_var_init_decl_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   842
  symbol->var1_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   843
  s4o.print(" : ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   844
  symbol->initialized_structure->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   845
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   848
/* 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
   849
/* structure_initialization -> may be NULL ! */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   850
void *visit(fb_name_decl_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   851
  symbol->fb_name_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   852
  s4o.print(" : ");
810
d9c48ad646f1 Add a new node to the abstract symtax tree, which will let us do datatype checking of FB variable declarations using the standard algorithm, and no special cases.
Mario de Sousa <msousa@fe.up.pt>
parents: 805
diff changeset
   853
  symbol->fb_spec_init->accept(*this);
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   854
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   855
}
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
/* 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
   858
void *visit(fb_name_list_c *symbol) {return print_list(symbol, "", ", ");}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   859
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   860
/* VAR_OUTPUT [RETAIN | NON_RETAIN] var_init_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
   861
/* option -> may be NULL ! */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   862
void *visit(output_declarations_c *symbol) {
202
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   863
  if (typeid(*(symbol->method)) == typeid(explicit_definition_c)) {
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   864
    s4o.print(s4o.indent_spaces); s4o.print("VAR_OUTPUT ");
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   865
    if (symbol->option != NULL)
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   866
      symbol->option->accept(*this);
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   867
    s4o.print("\n");
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   868
    s4o.indent_right();
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   869
    symbol->var_init_decl_list->accept(*this);
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   870
    s4o.indent_left();
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   871
    s4o.print(s4o.indent_spaces); s4o.print("END_VAR\n");
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
   872
  }
146
eef5e62048c7 Adding support for EN/ENO params in function and function blocks (standard function not supported yet)
lbessard
parents: 144
diff changeset
   873
  return NULL;
eef5e62048c7 Adding support for EN/ENO params in function and function blocks (standard function not supported yet)
lbessard
parents: 144
diff changeset
   874
}
eef5e62048c7 Adding support for EN/ENO params in function and function blocks (standard function not supported yet)
lbessard
parents: 144
diff changeset
   875
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   876
/*  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
   877
void *visit(input_output_declarations_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   878
  s4o.print(s4o.indent_spaces); s4o.print("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
   879
  s4o.print("\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   880
  s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   881
  symbol->var_declaration_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   882
  s4o.indent_left();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   883
  s4o.print(s4o.indent_spaces); s4o.print("END_VAR\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   884
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   885
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   886
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 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
   888
/* 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
   889
void *visit(var_declaration_list_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   890
  return print_list(symbol, s4o.indent_spaces, ";\n" + s4o.indent_spaces, ";\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   891
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   892
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   893
/*  var1_list ':' 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
   894
void *visit(array_var_declaration_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   895
  symbol->var1_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   896
  s4o.print(" : ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   897
  symbol->array_specification->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   898
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   899
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   900
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   901
/*  var1_list ':' 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
   902
void *visit(structured_var_declaration_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   903
  symbol->var1_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   904
  s4o.print(" : ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   905
  symbol->structure_type_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   906
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   907
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   908
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   909
/* VAR [CONSTANT] var_init_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
   910
/* option -> may be NULL ! */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   911
void *visit(var_declarations_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   912
  s4o.print(s4o.indent_spaces); s4o.print("VAR ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   913
  if (symbol->option != NULL)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   914
    symbol->option->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   915
  s4o.print("\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   916
  s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   917
  symbol->var_init_decl_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   918
  s4o.indent_left();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   919
  s4o.print(s4o.indent_spaces); s4o.print("END_VAR\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   920
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   921
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   922
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   923
/*  VAR RETAIN var_init_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
   924
void *visit(retentive_var_declarations_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   925
  s4o.print(s4o.indent_spaces); s4o.print("VAR RETAIN ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   926
  s4o.print("\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   927
  s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   928
  symbol->var_init_decl_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   929
  s4o.indent_left();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   930
  s4o.print(s4o.indent_spaces); s4o.print("END_VAR\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   931
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   932
}
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
/*  VAR [CONSTANT|RETAIN|NON_RETAIN] located_var_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
   935
/* option -> may be NULL ! */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   936
void *visit(located_var_declarations_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   937
  s4o.print(s4o.indent_spaces); s4o.print("VAR ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   938
  if (symbol->option != NULL)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   939
    symbol->option->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   940
  s4o.print("\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   941
  s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   942
  symbol->located_var_decl_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   943
  s4o.indent_left();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   944
  s4o.print(s4o.indent_spaces); s4o.print("END_VAR\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   945
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   946
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   947
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   948
/* 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
   949
/* 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
   950
void *visit(located_var_decl_list_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   951
  return print_list(symbol, s4o.indent_spaces, ";\n" + s4o.indent_spaces, ";\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   952
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   953
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   954
/*  [variable_name] location ':' 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
   955
/* variable_name -> may be NULL ! */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   956
void *visit(located_var_decl_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   957
  if (symbol->variable_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
   958
    symbol->variable_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   959
    s4o.print(" ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   960
  }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   961
  symbol->location->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   962
  s4o.print(" : ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   963
  symbol->located_var_spec_init->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   964
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   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
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
/*| VAR_EXTERNAL [CONSTANT] external_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
   969
/* option -> may be NULL ! */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   970
void *visit(external_var_declarations_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   971
  s4o.print(s4o.indent_spaces); s4o.print("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
   972
  if (symbol->option != NULL)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   973
    symbol->option->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   974
  s4o.print("\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   975
  s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   976
  symbol->external_declaration_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   977
  s4o.indent_left();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   978
  s4o.print(s4o.indent_spaces); s4o.print("END_VAR\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   979
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   980
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   981
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   982
/* 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
   983
/*| external_declaration_list 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
   984
void *visit(external_declaration_list_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   985
  return print_list(symbol, s4o.indent_spaces, ";\n" + s4o.indent_spaces, ";\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   986
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   987
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   988
/*  global_var_name ':' (simple_specification|subrange_specification|enumerated_specification|array_specification|prev_declared_structure_type_name|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
   989
void *visit(external_declaration_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   990
  symbol->global_var_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   991
  s4o.print(" : ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   992
  symbol->specification->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   993
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   994
}
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
/*| VAR_GLOBAL [CONSTANT|RETAIN] global_var_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
   997
/* option -> may be NULL ! */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   998
void *visit(global_var_declarations_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
   999
  s4o.print(s4o.indent_spaces); s4o.print("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
  1000
  if (symbol->option != NULL)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1001
    symbol->option->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1002
  s4o.print("\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1003
  s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1004
  symbol->global_var_decl_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1005
  s4o.indent_left();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1006
  s4o.print(s4o.indent_spaces); s4o.print("END_VAR\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1007
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1008
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1009
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1010
/* 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
  1011
/*| 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
  1012
void *visit(global_var_decl_list_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1013
  return print_list(symbol, s4o.indent_spaces, ";\n" + s4o.indent_spaces, ";\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1014
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1015
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1016
/*| global_var_spec ':' [located_var_spec_init|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
  1017
/* type_specification ->may be NULL ! */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1018
void *visit(global_var_decl_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1019
  symbol->global_var_spec->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1020
  s4o.print(" : ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1021
  if (symbol->type_specification != NULL)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1022
    symbol->type_specification->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1023
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1024
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1025
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1026
/*| global_var_name location */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1027
void *visit(global_var_spec_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1028
  symbol->global_var_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1029
  s4o.print(" ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1030
  symbol->location->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1031
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1032
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1033
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1034
/*  AT 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
  1035
void *visit(location_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1036
  s4o.print("AT ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1037
  symbol->direct_variable->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1038
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1039
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1040
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1041
/*| 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
  1042
void *visit(global_var_list_c *symbol) {return print_list(symbol, "", ", ");}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1043
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1044
/*  var1_list ':' 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
  1045
void *visit(single_byte_string_var_declaration_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1046
  symbol->var1_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1047
  s4o.print(" : ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1048
  symbol->single_byte_string_spec->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1049
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1050
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1051
350
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
  1052
/*  single_byte_limited_len_string_spec [ASSIGN single_byte_character_string] */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1053
/* single_byte_character_string ->may be NULL ! */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1054
void *visit(single_byte_string_spec_c *symbol) {
350
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
  1055
  symbol->string_spec->accept(*this);
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1056
  if (symbol->single_byte_character_string != NULL) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1057
    s4o.print(" := ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1058
    symbol->single_byte_character_string->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1059
  }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1060
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1061
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1062
350
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
  1063
/*  STRING ['[' integer ']'] */
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
  1064
/* integer ->may be NULL ! */
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
  1065
void *visit(single_byte_limited_len_string_spec_c *symbol) {
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
  1066
  symbol->string_type_name->accept(*this);
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
  1067
  if (symbol->character_string_len != NULL) {
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
  1068
    s4o.print(" [");
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
  1069
    symbol->character_string_len->accept(*this);
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
  1070
    s4o.print("]");
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
  1071
  }
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
  1072
  return NULL;
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
  1073
}
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
  1074
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1075
/*  var1_list ':' 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
  1076
void *visit(double_byte_string_var_declaration_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1077
  symbol->var1_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1078
  s4o.print(" : ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1079
  symbol->double_byte_string_spec->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1080
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1081
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1082
350
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
  1083
/*  double_byte_limited_len_string_spec [ASSIGN double_byte_character_string] */
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1084
/* integer ->may be NULL ! */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1085
/* double_byte_character_string ->may be NULL ! */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1086
void *visit(double_byte_string_spec_c *symbol) {
350
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
  1087
  symbol->string_spec->accept(*this);
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1088
  if (symbol->double_byte_character_string != NULL) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1089
    s4o.print(" := ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1090
    symbol->double_byte_character_string->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1091
  }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1092
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1093
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1094
350
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
  1095
/* WSTRING ['[' integer ']'] */
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
  1096
/* integer ->may be NULL ! */
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
  1097
void *visit(double_byte_limited_len_string_spec_c *symbol) {
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
  1098
  symbol->string_type_name->accept(*this);
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
  1099
  if (symbol->character_string_len != NULL) {
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
  1100
    s4o.print(" [");
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
  1101
    symbol->character_string_len->accept(*this);
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
  1102
    s4o.print("]");
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
  1103
  }
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
  1104
  return NULL;
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
  1105
}
2c3c4dc34979 Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents: 311
diff changeset
  1106
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1107
/*| VAR [RETAIN|NON_RETAIN] incompl_located_var_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
  1108
/* option ->may be NULL ! */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1109
void *visit(incompl_located_var_declarations_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1110
  s4o.print(s4o.indent_spaces); s4o.print("VAR ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1111
  if (symbol->option != NULL)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1112
    symbol->option->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1113
  s4o.print("\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1114
  s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1115
  symbol->incompl_located_var_decl_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1116
  s4o.indent_left();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1117
  s4o.print(s4o.indent_spaces); s4o.print("END_VAR\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1118
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1119
}
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
/* 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
  1122
/*| 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
  1123
void *visit(incompl_located_var_decl_list_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1124
  return print_list(symbol, s4o.indent_spaces, ";\n" + s4o.indent_spaces, ";\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1125
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1126
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1127
/*  variable_name incompl_location ':' 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
  1128
void *visit(incompl_located_var_decl_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1129
  symbol->variable_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1130
  s4o.print(" ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1131
  symbol->incompl_location->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1132
  s4o.print(" : ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1133
  symbol->var_spec->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1134
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1135
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1136
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1137
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1138
/*  AT 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
  1139
void *visit(incompl_location_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1140
  s4o.print(" AT ");
10
66f4f7f85d0a generate_iec completed
lbessard
parents: 8
diff changeset
  1141
  return print_token(symbol);
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1142
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1143
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1144
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1145
/* 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
  1146
 *  - 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
  1147
 *  - 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
  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
/* | 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
  1150
void *visit(var_init_decl_list_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1151
  return print_list(symbol, s4o.indent_spaces, ";\n" + s4o.indent_spaces, ";\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1152
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1153
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
/* 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
  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
void *visit(function_declaration_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1159
  s4o.print("FUNCTION ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1160
  symbol->derived_function_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1161
  s4o.print(" : ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1162
  symbol->type_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1163
  s4o.print("\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1164
  s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1165
  symbol->var_declarations_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1166
  s4o.print("\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1167
  symbol->function_body->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1168
  s4o.indent_left();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1169
  s4o.print(s4o.indent_spaces + "END_FUNCTION\n\n\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1170
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1171
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1172
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1173
/* 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
  1174
void *visit(var_declarations_list_c *symbol) {return print_list(symbol);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1175
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1176
void *visit(function_var_decls_c *symbol) {
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1177
  //s4o.print(s4o.indent_spaces); 
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1178
  s4o.print("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
  1179
  if (symbol->option != NULL)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1180
    symbol->option->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1181
  s4o.print("\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1182
  s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1183
  symbol->decl_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1184
  s4o.indent_left();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1185
  s4o.print(s4o.indent_spaces); s4o.print("END_VAR\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1186
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1187
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1188
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1189
/* 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
  1190
void *visit(var2_init_decl_list_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1191
  print_list(symbol, s4o.indent_spaces, ";\n" + s4o.indent_spaces, ";\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1192
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1193
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1194
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1195
/*****************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1196
/* 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
  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
/*  FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations function_block_body 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
  1199
void *visit(function_block_declaration_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1200
  s4o.print("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
  1201
  symbol->fblock_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1202
  s4o.print("\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1203
  s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1204
  symbol->var_declarations->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1205
  s4o.print("\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1206
  symbol->fblock_body->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1207
  s4o.indent_left();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1208
  s4o.print(s4o.indent_spaces + "END_FUNCTION_BLOCK\n\n\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1209
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  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
/*  VAR_TEMP temp_var_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
  1213
void *visit(temp_var_decls_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1214
  s4o.print("VAR_TEMP\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1215
  s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1216
  symbol->var_decl_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1217
  s4o.indent_left();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1218
  s4o.print("END_VAR\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1219
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1220
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1221
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1222
/* 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
  1223
void *visit(temp_var_decls_list_c *symbol) {return print_list(symbol);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1224
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1225
/*  VAR NON_RETAIN var_init_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
  1226
void *visit(non_retentive_var_decls_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1227
  s4o.print("VAR NON_RETAIN\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1228
  s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1229
  symbol->var_decl_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1230
  s4o.indent_left();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1231
  s4o.print("END_VAR\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1232
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1235
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1236
/**********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1237
/* 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
  1238
/**********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1239
/*  PROGRAM program_type_name program_var_declarations_list function_block_body 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
  1240
void *visit(program_declaration_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1241
  s4o.print("PROGRAM ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1242
  symbol->program_type_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1243
  s4o.print("\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1244
  s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1245
  symbol->var_declarations->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1246
  s4o.print("\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1247
  symbol->function_block_body->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1248
  s4o.indent_left();
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1249
  s4o.print("END_PROGRAM\n\n\n");
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1250
  return NULL;
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1251
}
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1252
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1253
/***********************************/
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1254
/* B 1.6 Sequential Function Chart */
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1255
/***********************************/
8
89902a42698e Added some more coments.
mario
parents: 7
diff changeset
  1256
7
0df673a4a561 Added some comments. Fixed some accesses to potential NULL pointers.
mario
parents: 3
diff changeset
  1257
/* sequential_function_chart {sfc_network} */
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1258
void *visit(sequential_function_chart_c *symbol) {
10
66f4f7f85d0a generate_iec completed
lbessard
parents: 8
diff changeset
  1259
  print_list(symbol, "", "\n", "");
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1260
  return NULL;
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1261
}
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1262
7
0df673a4a561 Added some comments. Fixed some accesses to potential NULL pointers.
mario
parents: 3
diff changeset
  1263
/* sfc_network {step | transition | action} */
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1264
void *visit(sfc_network_c *symbol) {
10
66f4f7f85d0a generate_iec completed
lbessard
parents: 8
diff changeset
  1265
  print_list(symbol, "", "\n", "");
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1266
  return NULL;
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1267
}
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1268
7
0df673a4a561 Added some comments. Fixed some accesses to potential NULL pointers.
mario
parents: 3
diff changeset
  1269
/* INITIAL_STEP step_name ':' [action_association_list] END_STEP */
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1270
void *visit(initial_step_c *symbol) {
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1271
  s4o.print(s4o.indent_spaces);
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1272
  s4o.print("INITIAL_STEP ");
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1273
  symbol->step_name->accept(*this);
10
66f4f7f85d0a generate_iec completed
lbessard
parents: 8
diff changeset
  1274
  s4o.print(":\n");
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1275
  s4o.indent_right();
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1276
  symbol->action_association_list->accept(*this);
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1277
  s4o.print("\n");
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1278
  s4o.indent_left();
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1279
  s4o.print(s4o.indent_spaces);
10
66f4f7f85d0a generate_iec completed
lbessard
parents: 8
diff changeset
  1280
  s4o.print("END_STEP\n");
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1281
  return NULL;
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1282
}
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1283
7
0df673a4a561 Added some comments. Fixed some accesses to potential NULL pointers.
mario
parents: 3
diff changeset
  1284
/* STEP step_name ':' [action_association_list] END_STEP */
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1285
void *visit(step_c *symbol) {
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1286
  s4o.print(s4o.indent_spaces);
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1287
  s4o.print("STEP ");
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1288
  symbol->step_name->accept(*this);
10
66f4f7f85d0a generate_iec completed
lbessard
parents: 8
diff changeset
  1289
  s4o.print(":\n");
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1290
  s4o.indent_right();
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1291
  symbol->action_association_list->accept(*this);
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1292
  s4o.print("\n");
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1293
  s4o.indent_left();
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1294
  s4o.print(s4o.indent_spaces);
10
66f4f7f85d0a generate_iec completed
lbessard
parents: 8
diff changeset
  1295
  s4o.print("END_STEP\n");
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1296
  return NULL;
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1297
}
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1298
7
0df673a4a561 Added some comments. Fixed some accesses to potential NULL pointers.
mario
parents: 3
diff changeset
  1299
/* action_association_list {action_association} */
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1300
void *visit(action_association_list_c *symbol) {
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1301
  print_list(symbol, "", "\n", "");
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1302
  return NULL;
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1303
}
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1304
7
0df673a4a561 Added some comments. Fixed some accesses to potential NULL pointers.
mario
parents: 3
diff changeset
  1305
/* action_name '(' [action_qualifier] [indicator_name_list] ')' */
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1306
void *visit(action_association_c *symbol) {
10
66f4f7f85d0a generate_iec completed
lbessard
parents: 8
diff changeset
  1307
  s4o.print(s4o.indent_spaces);
66f4f7f85d0a generate_iec completed
lbessard
parents: 8
diff changeset
  1308
  symbol->action_name->accept(*this);
66f4f7f85d0a generate_iec completed
lbessard
parents: 8
diff changeset
  1309
  s4o.print("(");
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1310
  if(symbol->action_qualifier != NULL){
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1311
    symbol->action_qualifier->accept(*this);
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1312
  }
7
0df673a4a561 Added some comments. Fixed some accesses to potential NULL pointers.
mario
parents: 3
diff changeset
  1313
  if(symbol->indicator_name_list != NULL){
10
66f4f7f85d0a generate_iec completed
lbessard
parents: 8
diff changeset
  1314
  	symbol->indicator_name_list->accept(*this);
66f4f7f85d0a generate_iec completed
lbessard
parents: 8
diff changeset
  1315
  }
66f4f7f85d0a generate_iec completed
lbessard
parents: 8
diff changeset
  1316
  s4o.print(");");
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1317
  return NULL;
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1318
}
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1319
7
0df673a4a561 Added some comments. Fixed some accesses to potential NULL pointers.
mario
parents: 3
diff changeset
  1320
/* indicator_name_list ',' indicator_name */
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1321
void *visit(indicator_name_list_c *symbol) {
10
66f4f7f85d0a generate_iec completed
lbessard
parents: 8
diff changeset
  1322
  print_list(symbol, ", ", ", ", "");
7
0df673a4a561 Added some comments. Fixed some accesses to potential NULL pointers.
mario
parents: 3
diff changeset
  1323
  return NULL;
0df673a4a561 Added some comments. Fixed some accesses to potential NULL pointers.
mario
parents: 3
diff changeset
  1324
}
0df673a4a561 Added some comments. Fixed some accesses to potential NULL pointers.
mario
parents: 3
diff changeset
  1325
0df673a4a561 Added some comments. Fixed some accesses to potential NULL pointers.
mario
parents: 3
diff changeset
  1326
/* action_qualifier [',' action_time] */
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1327
void *visit(action_qualifier_c *symbol) {
7
0df673a4a561 Added some comments. Fixed some accesses to potential NULL pointers.
mario
parents: 3
diff changeset
  1328
  symbol->action_qualifier->accept(*this);
0df673a4a561 Added some comments. Fixed some accesses to potential NULL pointers.
mario
parents: 3
diff changeset
  1329
  if(symbol->action_time != NULL){
0df673a4a561 Added some comments. Fixed some accesses to potential NULL pointers.
mario
parents: 3
diff changeset
  1330
    s4o.print(", ");
0df673a4a561 Added some comments. Fixed some accesses to potential NULL pointers.
mario
parents: 3
diff changeset
  1331
    symbol->action_time->accept(*this);
0df673a4a561 Added some comments. Fixed some accesses to potential NULL pointers.
mario
parents: 3
diff changeset
  1332
  }
0df673a4a561 Added some comments. Fixed some accesses to potential NULL pointers.
mario
parents: 3
diff changeset
  1333
  return NULL;
0df673a4a561 Added some comments. Fixed some accesses to potential NULL pointers.
mario
parents: 3
diff changeset
  1334
}
0df673a4a561 Added some comments. Fixed some accesses to potential NULL pointers.
mario
parents: 3
diff changeset
  1335
0df673a4a561 Added some comments. Fixed some accesses to potential NULL pointers.
mario
parents: 3
diff changeset
  1336
/* N | R | S | P */
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1337
void *visit(qualifier_c *symbol) {
10
66f4f7f85d0a generate_iec completed
lbessard
parents: 8
diff changeset
  1338
  print_token(symbol);
8
89902a42698e Added some more coments.
mario
parents: 7
diff changeset
  1339
  return NULL;
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1340
}
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1341
7
0df673a4a561 Added some comments. Fixed some accesses to potential NULL pointers.
mario
parents: 3
diff changeset
  1342
/* L | D | SD | DS | SL */
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1343
void *visit(timed_qualifier_c *symbol) {
10
66f4f7f85d0a generate_iec completed
lbessard
parents: 8
diff changeset
  1344
  print_token(symbol);
8
89902a42698e Added some more coments.
mario
parents: 7
diff changeset
  1345
  return NULL;
89902a42698e Added some more coments.
mario
parents: 7
diff changeset
  1346
}
89902a42698e Added some more coments.
mario
parents: 7
diff changeset
  1347
71
c2c867171c07 fixing formal function invocation in IL
mario
parents: 46
diff changeset
  1348
/* TRANSITION [transition_name] ['(''PRIORITY'':='integer')']
c2c867171c07 fixing formal function invocation in IL
mario
parents: 46
diff changeset
  1349
 *   FROMstepsTO steps 
17
38754701ac41 SFC state machine first approach generator implemented
lbessard
parents: 16
diff changeset
  1350
 *   ':' simple_instr_list | ':=' expression
8
89902a42698e Added some more coments.
mario
parents: 7
diff changeset
  1351
 * END_TRANSITION
89902a42698e Added some more coments.
mario
parents: 7
diff changeset
  1352
 */
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1353
void *visit(transition_c *symbol) {
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1354
  s4o.print(s4o.indent_spaces);
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1355
  s4o.print("TRANSITION ");
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1356
  if (symbol->transition_name != NULL){
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1357
    symbol->transition_name->accept(*this);
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1358
    s4o.print(" ");
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1359
  }
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1360
  if (symbol->integer != NULL){
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1361
    s4o.print("(PRIORITY := ");
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1362
    symbol->integer->accept(*this);
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1363
    s4o.print(") ");
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1364
  }
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1365
  s4o.print("FROM ");
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1366
  symbol->from_steps->accept(*this);
10
66f4f7f85d0a generate_iec completed
lbessard
parents: 8
diff changeset
  1367
  s4o.print(" TO ");
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1368
  symbol->to_steps->accept(*this);
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1369
  s4o.indent_right();
87
b97f9ad7b2c6 Bug on SFC transition parsing and generation fixed
lbessard
parents: 71
diff changeset
  1370
  symbol->transition_condition->accept(*this);
b97f9ad7b2c6 Bug on SFC transition parsing and generation fixed
lbessard
parents: 71
diff changeset
  1371
  s4o.indent_left();
b97f9ad7b2c6 Bug on SFC transition parsing and generation fixed
lbessard
parents: 71
diff changeset
  1372
  s4o.print(s4o.indent_spaces);
b97f9ad7b2c6 Bug on SFC transition parsing and generation fixed
lbessard
parents: 71
diff changeset
  1373
  s4o.print("END_TRANSITION\n");
b97f9ad7b2c6 Bug on SFC transition parsing and generation fixed
lbessard
parents: 71
diff changeset
  1374
  return NULL;
b97f9ad7b2c6 Bug on SFC transition parsing and generation fixed
lbessard
parents: 71
diff changeset
  1375
}
b97f9ad7b2c6 Bug on SFC transition parsing and generation fixed
lbessard
parents: 71
diff changeset
  1376
b97f9ad7b2c6 Bug on SFC transition parsing and generation fixed
lbessard
parents: 71
diff changeset
  1377
void *visit(transition_condition_c *symbol) {
3
38850ee685e6 ST and IL parsing added into flex-bison analyser
lbessard
parents: 1
diff changeset
  1378
  if (symbol->transition_condition_il != NULL) {
87
b97f9ad7b2c6 Bug on SFC transition parsing and generation fixed
lbessard
parents: 71
diff changeset
  1379
    s4o.print(":\n");
17
38754701ac41 SFC state machine first approach generator implemented
lbessard
parents: 16
diff changeset
  1380
    symbol->transition_condition_il->accept(*this);
3
38850ee685e6 ST and IL parsing added into flex-bison analyser
lbessard
parents: 1
diff changeset
  1381
  }
38850ee685e6 ST and IL parsing added into flex-bison analyser
lbessard
parents: 1
diff changeset
  1382
  if (symbol->transition_condition_st != NULL) {
87
b97f9ad7b2c6 Bug on SFC transition parsing and generation fixed
lbessard
parents: 71
diff changeset
  1383
    s4o.print("\n");
17
38754701ac41 SFC state machine first approach generator implemented
lbessard
parents: 16
diff changeset
  1384
    s4o.print(s4o.indent_spaces);
38754701ac41 SFC state machine first approach generator implemented
lbessard
parents: 16
diff changeset
  1385
    s4o.print(":= ");
38754701ac41 SFC state machine first approach generator implemented
lbessard
parents: 16
diff changeset
  1386
    symbol->transition_condition_st->accept(*this);
38754701ac41 SFC state machine first approach generator implemented
lbessard
parents: 16
diff changeset
  1387
    s4o.print(";\n");
3
38850ee685e6 ST and IL parsing added into flex-bison analyser
lbessard
parents: 1
diff changeset
  1388
  }
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1389
  return NULL;
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1390
}
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1391
8
89902a42698e Added some more coments.
mario
parents: 7
diff changeset
  1392
/* step_name | step_name_list */
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1393
void *visit(steps_c *symbol) {
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1394
  if(symbol->step_name != NULL){
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1395
    symbol->step_name->accept(*this);
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1396
  }
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1397
  if(symbol->step_name_list != NULL){
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1398
    symbol->step_name_list->accept(*this);
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1399
  }
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1400
  return NULL;
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1401
}
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1402
8
89902a42698e Added some more coments.
mario
parents: 7
diff changeset
  1403
/* '(' step_name ',' step_name {',' step_name} ')' */
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1404
void *visit(step_name_list_c *symbol) {
16
e8b99f896416 Support for struct Time data Types manipulation into ST and IL added
lbessard
parents: 10
diff changeset
  1405
  print_list(symbol, "(", ", ", ")");
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1406
  return NULL;
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1407
}
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1408
8
89902a42698e Added some more coments.
mario
parents: 7
diff changeset
  1409
/* ACTION action_name ':' function_block_body END_ACTION */
1
5d893a68be6e Changes made since Mario visit at LOLITECH. Thanks again !
etisserant
parents: 0
diff changeset
  1410
void *visit(action_c *symbol) {
8
89902a42698e Added some more coments.
mario
parents: 7
diff changeset
  1411
  s4o.print(s4o.indent_spaces);
89902a42698e Added some more coments.
mario
parents: 7
diff changeset
  1412
  s4o.print("ACTION ");
89902a42698e Added some more coments.
mario
parents: 7
diff changeset
  1413
  symbol->action_name->accept(*this);
10
66f4f7f85d0a generate_iec completed
lbessard
parents: 8
diff changeset
  1414
  s4o.print(":\n");
66f4f7f85d0a generate_iec completed
lbessard
parents: 8
diff changeset
  1415
  s4o.indent_right();
66f4f7f85d0a generate_iec completed
lbessard
parents: 8
diff changeset
  1416
  symbol->function_block_body->accept(*this);
66f4f7f85d0a generate_iec completed
lbessard
parents: 8
diff changeset
  1417
  s4o.indent_left();
8
89902a42698e Added some more coments.
mario
parents: 7
diff changeset
  1418
  s4o.print(s4o.indent_spaces);
10
66f4f7f85d0a generate_iec completed
lbessard
parents: 8
diff changeset
  1419
  s4o.print("END_ACTION\n");
8
89902a42698e Added some more coments.
mario
parents: 7
diff changeset
  1420
  return NULL;
89902a42698e Added some more coments.
mario
parents: 7
diff changeset
  1421
}
89902a42698e Added some more coments.
mario
parents: 7
diff changeset
  1422
 
89902a42698e Added some more coments.
mario
parents: 7
diff changeset
  1423
 
89902a42698e Added some more coments.
mario
parents: 7
diff changeset
  1424
 
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1425
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1426
/* 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
  1427
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1428
/*
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1429
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
  1430
   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
  1431
   (resource_declaration_list | 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
  1432
   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
  1433
   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
  1434
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
  1435
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1436
void *visit(configuration_declaration_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1437
  s4o.print("CONFIGURATION ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1438
  symbol->configuration_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1439
  s4o.print("\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1440
  s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1441
  if (symbol->global_var_declarations != NULL)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1442
    symbol->global_var_declarations->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1443
  symbol->resource_declarations->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1444
  if (symbol->access_declarations != NULL)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1445
    symbol->access_declarations->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1446
  if (symbol->instance_specific_initializations != NULL)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1447
    symbol->instance_specific_initializations->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1448
  s4o.indent_left();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1449
  s4o.print(s4o.indent_spaces + "END_CONFIGURATION\n\n\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1450
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1451
}
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
862
2b6b1202f8a8 Fix bug in standard: standard does not allow multiple VAR_GLOBAL ... END_VAR constructs in configurations and resources. This is probably a bug, so we allow it.
mjsousa
parents: 810
diff changeset
  1454
/* intermediate helper symbol for configuration_declaration  */
2b6b1202f8a8 Fix bug in standard: standard does not allow multiple VAR_GLOBAL ... END_VAR constructs in configurations and resources. This is probably a bug, so we allow it.
mjsousa
parents: 810
diff changeset
  1455
/*  { global_var_declarations_list }   */
2b6b1202f8a8 Fix bug in standard: standard does not allow multiple VAR_GLOBAL ... END_VAR constructs in configurations and resources. This is probably a bug, so we allow it.
mjsousa
parents: 810
diff changeset
  1456
void *visit(global_var_declarations_list_c *symbol) {return print_list(symbol);}
2b6b1202f8a8 Fix bug in standard: standard does not allow multiple VAR_GLOBAL ... END_VAR constructs in configurations and resources. This is probably a bug, so we allow it.
mjsousa
parents: 810
diff changeset
  1457
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1458
/* 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
  1459
/*| 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
  1460
void *visit(resource_declaration_list_c *symbol) {return print_list(symbol);}
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
RESOURCE 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
  1465
   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
  1466
   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
  1467
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
  1468
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1469
void *visit(resource_declaration_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1470
  s4o.print(s4o.indent_spaces + "RESOURCE ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1471
  symbol->resource_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1472
  s4o.print(" ON ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1473
  symbol->resource_type_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1474
  s4o.print("\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1475
  s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1476
  if (symbol->global_var_declarations != NULL)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1477
    symbol->global_var_declarations->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1478
  symbol->resource_declaration->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1479
  s4o.indent_left();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1480
  s4o.print(s4o.indent_spaces + "END_RESOURCE\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1481
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1482
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1483
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1484
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1485
/* task_configuration_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
  1486
void *visit(single_resource_declaration_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1487
  symbol->task_configuration_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1488
  symbol->program_configuration_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1489
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1490
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1491
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1492
/* 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
  1493
/*| 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
  1494
void *visit(task_configuration_list_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1495
  return print_list(symbol, s4o.indent_spaces, ";\n" + s4o.indent_spaces, ";\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1496
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1497
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1498
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1499
/* 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
  1500
/*| 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
  1501
void *visit(program_configuration_list_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1502
  return print_list(symbol, s4o.indent_spaces, ";\n" + s4o.indent_spaces, ";\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1503
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1504
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1505
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1506
/* 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
  1507
 *  - 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
  1508
 *  - 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
  1509
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1510
/* | 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
  1511
void *visit(any_fb_name_list_c *symbol) {return print_list(symbol, ".", ".");}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1512
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1513
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1514
/*  [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
  1515
void *visit(global_var_reference_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1516
  if (symbol->resource_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
  1517
    symbol->resource_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1518
    s4o.print(".");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1519
  }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1520
  symbol->global_var_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1521
  if (symbol->structure_element_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
  1522
    s4o.print(".");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1523
    symbol->structure_element_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1524
  }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1525
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1526
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1527
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1528
/* 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
  1529
void *visit(program_output_reference_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1530
  symbol->program_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1531
  s4o.print(".");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1532
  symbol->symbolic_variable->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1533
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1534
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1535
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1536
/*  TASK task_name 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
  1537
void *visit(task_configuration_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1538
  s4o.print("TASK ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1539
  symbol->task_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1540
  s4o.print(" ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1541
  symbol->task_initialization->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1542
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1543
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1544
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1545
/*  '(' [SINGLE ASSIGN data_source ','] [INTERVAL ASSIGN data_source ','] PRIORITY ASSIGN integer ')' */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1546
void *visit(task_initialization_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1547
  s4o.print("(");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1548
  if (symbol->single_data_source != NULL) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1549
    s4o.print("SINGLE := ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1550
    symbol->single_data_source->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1551
    s4o.print(", ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1552
  }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1553
  if (symbol->interval_data_source != NULL) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1554
    s4o.print("INTERVAL := ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1555
    symbol->interval_data_source->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1556
    s4o.print(", ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1557
  }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1558
  s4o.print("PRIORITY := ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1559
  symbol->priority_data_source->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1560
  s4o.print(")");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1561
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1562
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1563
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1564
/*  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
  1565
void *visit(program_configuration_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1566
  s4o.print("PROGRAM ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1567
  if (symbol->retain_option != NULL)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1568
    symbol->retain_option->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1569
  symbol->program_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1570
  if (symbol->task_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
  1571
    s4o.print(" WITH ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1572
    symbol->task_name->accept(*this);
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
  s4o.print(" : ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1575
  symbol->program_type_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1576
  if (symbol->prog_conf_elements != NULL) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1577
    s4o.print("(");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1578
    symbol->prog_conf_elements->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1579
    s4o.print(")");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1580
  }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1581
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1582
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1583
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1584
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1585
/* 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
  1586
void *visit(prog_conf_elements_c *symbol) {return print_list(symbol, "", ", ");}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1587
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1588
/*  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
  1589
void *visit(fb_task_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1590
  symbol->fb_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1591
  s4o.print(" WITH ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1592
  symbol->task_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1593
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1594
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1595
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1596
/*  any_symbolic_variable ASSIGN 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
  1597
void *visit(prog_cnxn_assign_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1598
  symbol->symbolic_variable->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1599
  s4o.print(" := ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1600
  symbol->prog_data_source->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1601
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1602
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1603
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1604
/* any_symbolic_variable SENDTO 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
  1605
void *visit(prog_cnxn_sendto_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1606
  symbol->symbolic_variable->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1607
  s4o.print(" => ");
28
5b170c9ce134 Multi-file configuration and resource generation finished
lbessard
parents: 27
diff changeset
  1608
  symbol->data_sink->accept(*this);
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1609
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1610
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1611
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1612
/* VAR_CONFIG instance_specific_init_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
  1613
void *visit(instance_specific_initializations_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1614
  s4o.print(s4o.indent_spaces + "VAR_CONFIG\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1615
  s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1616
  symbol->instance_specific_init_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1617
  s4o.indent_left();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1618
  s4o.print(s4o.indent_spaces + "END_VAR\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1619
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1620
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1621
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1622
/* 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
  1623
/*| 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
  1624
void *visit(instance_specific_init_list_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1625
  return print_list(symbol, s4o.indent_spaces, ";\n" + s4o.indent_spaces, ";\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1626
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1627
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1628
/* resource_name '.' program_name '.' optional_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
  1629
    ((variable_name [location] ':' located_var_spec_init) | (fb_name ':' 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
  1630
*/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1631
void *visit(instance_specific_init_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1632
  symbol->resource_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1633
  s4o.print(".");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1634
  symbol->program_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1635
  symbol->any_fb_name_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1636
  if (symbol->variable_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
  1637
    s4o.print(".");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1638
    symbol->variable_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1639
  }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1640
  if (symbol->location != NULL) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1641
    s4o.print(" ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1642
    symbol->location->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1643
  }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1644
  s4o.print(" : ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1645
  symbol->initialization->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1646
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1649
/* 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
  1650
/* 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
  1651
void *visit(fb_initialization_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1652
  symbol->function_block_type_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1653
  s4o.print(" := ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1654
  symbol->structure_initialization->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1655
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1656
}
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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1659
/***********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1660
/* 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
  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
/*| 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
  1663
void *visit(instruction_list_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1664
  return print_list(symbol, s4o.indent_spaces, "\n" + s4o.indent_spaces, "\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1665
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1666
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1667
/* | label ':' [il_incomplete_instruction] 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
  1668
void *visit(il_instruction_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1669
  if (symbol->label != NULL) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1670
    symbol->label->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1671
    s4o.print(": ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1672
  }
311
8fcea60029de Allow [EOL] after a label in IL.
Mario de Sousa <msousa@fe.up.pt>
parents: 279
diff changeset
  1673
  if (symbol->il_instruction != NULL) {
8fcea60029de Allow [EOL] after a label in IL.
Mario de Sousa <msousa@fe.up.pt>
parents: 279
diff changeset
  1674
    symbol->il_instruction->accept(*this);
8fcea60029de Allow [EOL] after a label in IL.
Mario de Sousa <msousa@fe.up.pt>
parents: 279
diff changeset
  1675
  }  
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1676
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1677
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1678
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1679
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1680
/* | il_simple_operator [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
  1681
void *visit(il_simple_operation_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1682
  symbol->il_simple_operator->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1683
  if (symbol->il_operand != NULL)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1684
    symbol->il_operand->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1685
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1686
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1687
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1688
/* | 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
  1689
void *visit(il_function_call_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1690
  symbol->function_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1691
  s4o.print(" ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1692
  if (symbol->il_operand_list != NULL)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1693
    symbol->il_operand_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1694
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1695
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1696
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1697
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1698
/* | il_expr_operator '(' [il_operand] eol_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
  1699
void *visit(il_expression_c *symbol) {
690
6156ee2b4e32 Correctly generate C code for IL expressions, i.e. IL instructions inside parenthesis.
Mario de Sousa <msousa@fe.up.pt>
parents: 596
diff changeset
  1700
  /* Since stage2 will insert an artificial (and equivalent) LD <il_operand> to the simple_instr_list when an 'il_operand' exists, we know
6156ee2b4e32 Correctly generate C code for IL expressions, i.e. IL instructions inside parenthesis.
Mario de Sousa <msousa@fe.up.pt>
parents: 596
diff changeset
  1701
   * that if (symbol->il_operand != NULL), then the first IL instruction in the simple_instr_list will be the equivalent and artificial
6156ee2b4e32 Correctly generate C code for IL expressions, i.e. IL instructions inside parenthesis.
Mario de Sousa <msousa@fe.up.pt>
parents: 596
diff changeset
  1702
   * 'LD <il_operand>' IL instruction.
6156ee2b4e32 Correctly generate C code for IL expressions, i.e. IL instructions inside parenthesis.
Mario de Sousa <msousa@fe.up.pt>
parents: 596
diff changeset
  1703
   * Since we do not want the extra LD instruction, we simply remove it!
6156ee2b4e32 Correctly generate C code for IL expressions, i.e. IL instructions inside parenthesis.
Mario de Sousa <msousa@fe.up.pt>
parents: 596
diff changeset
  1704
   */
6156ee2b4e32 Correctly generate C code for IL expressions, i.e. IL instructions inside parenthesis.
Mario de Sousa <msousa@fe.up.pt>
parents: 596
diff changeset
  1705
  if (symbol->il_operand != NULL)
6156ee2b4e32 Correctly generate C code for IL expressions, i.e. IL instructions inside parenthesis.
Mario de Sousa <msousa@fe.up.pt>
parents: 596
diff changeset
  1706
    ((list_c *)symbol->simple_instr_list)->remove_element(0);
6156ee2b4e32 Correctly generate C code for IL expressions, i.e. IL instructions inside parenthesis.
Mario de Sousa <msousa@fe.up.pt>
parents: 596
diff changeset
  1707
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1708
  symbol->il_expr_operator->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1709
  s4o.print("(");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1710
  if (symbol->il_operand != NULL)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1711
    symbol->il_operand->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1712
  if (symbol->simple_instr_list != NULL) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1713
    s4o.print("\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1714
    s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1715
    symbol->simple_instr_list->accept(*this);
10
66f4f7f85d0a generate_iec completed
lbessard
parents: 8
diff changeset
  1716
    s4o.print(s4o.indent_spaces);
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1717
    s4o.indent_left();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1718
  }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1719
  s4o.print(")");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1720
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1721
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1722
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1723
/*  il_jump_operator label */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1724
void *visit(il_jump_operation_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1725
  symbol->il_jump_operator->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1726
  symbol->label->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1727
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1728
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1729
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1730
/*   il_call_operator 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
  1731
 * | il_call_operator 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
  1732
 * | il_call_operator prev_declared_fb_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
  1733
 * | il_call_operator prev_declared_fb_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
  1734
 * | il_call_operator prev_declared_fb_name '(' eol_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
  1735
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1736
void *visit(il_fb_call_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1737
  symbol->il_call_operator->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1738
  symbol->fb_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1739
  s4o.print("(");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1740
  if (symbol->il_operand_list != NULL)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1741
    symbol->il_operand_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1742
  if (symbol->il_param_list != NULL) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1743
    s4o.print("\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1744
    s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1745
    symbol->il_param_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1746
    s4o.indent_left();
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
  s4o.print(")");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1749
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1750
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1751
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1752
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1753
/* | function_name '(' eol_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
  1754
void *visit(il_formal_funct_call_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1755
  symbol->function_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1756
  s4o.print("(");
71
c2c867171c07 fixing formal function invocation in IL
mario
parents: 46
diff changeset
  1757
  s4o.print("\n");
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1758
  if (symbol->il_param_list != NULL) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1759
    s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1760
    symbol->il_param_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1761
    s4o.print(")");
71
c2c867171c07 fixing formal function invocation in IL
mario
parents: 46
diff changeset
  1762
    s4o.indent_left();
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1763
  }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1764
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1765
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1766
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1767
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1768
/* | il_operand_list ',' il_operand */
71
c2c867171c07 fixing formal function invocation in IL
mario
parents: 46
diff changeset
  1769
void *visit(il_operand_list_c *symbol) {
c2c867171c07 fixing formal function invocation in IL
mario
parents: 46
diff changeset
  1770
  return print_list(symbol, "", ", ");
c2c867171c07 fixing formal function invocation in IL
mario
parents: 46
diff changeset
  1771
}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1772
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1773
/* | 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
  1774
void *visit(simple_instr_list_c *symbol) {
10
66f4f7f85d0a generate_iec completed
lbessard
parents: 8
diff changeset
  1775
  return print_list(symbol,  s4o.indent_spaces, "\n" + s4o.indent_spaces, "\n");
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
453
4733f662362a More changes for support of semantic verification of il_expressions
Mario de Sousa <msousa@fe.up.pt>
parents: 350
diff changeset
  1778
4733f662362a More changes for support of semantic verification of il_expressions
Mario de Sousa <msousa@fe.up.pt>
parents: 350
diff changeset
  1779
/* il_simple_instruction:
4733f662362a More changes for support of semantic verification of il_expressions
Mario de Sousa <msousa@fe.up.pt>
parents: 350
diff changeset
  1780
 *   il_simple_operation eol_list
4733f662362a More changes for support of semantic verification of il_expressions
Mario de Sousa <msousa@fe.up.pt>
parents: 350
diff changeset
  1781
 * | il_expression eol_list
4733f662362a More changes for support of semantic verification of il_expressions
Mario de Sousa <msousa@fe.up.pt>
parents: 350
diff changeset
  1782
 * | il_formal_funct_call eol_list
4733f662362a More changes for support of semantic verification of il_expressions
Mario de Sousa <msousa@fe.up.pt>
parents: 350
diff changeset
  1783
 */
4733f662362a More changes for support of semantic verification of il_expressions
Mario de Sousa <msousa@fe.up.pt>
parents: 350
diff changeset
  1784
void *visit(il_simple_instruction_c *symbol)	{
4733f662362a More changes for support of semantic verification of il_expressions
Mario de Sousa <msousa@fe.up.pt>
parents: 350
diff changeset
  1785
  return symbol->il_simple_instruction->accept(*this);
4733f662362a More changes for support of semantic verification of il_expressions
Mario de Sousa <msousa@fe.up.pt>
parents: 350
diff changeset
  1786
}
4733f662362a More changes for support of semantic verification of il_expressions
Mario de Sousa <msousa@fe.up.pt>
parents: 350
diff changeset
  1787
4733f662362a More changes for support of semantic verification of il_expressions
Mario de Sousa <msousa@fe.up.pt>
parents: 350
diff changeset
  1788
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1789
/* | il_initial_param_list il_param_instruction */
71
c2c867171c07 fixing formal function invocation in IL
mario
parents: 46
diff changeset
  1790
void *visit(il_param_list_c *symbol) {
c2c867171c07 fixing formal function invocation in IL
mario
parents: 46
diff changeset
  1791
// return print_list(symbol);
c2c867171c07 fixing formal function invocation in IL
mario
parents: 46
diff changeset
  1792
  return print_list(symbol,  s4o.indent_spaces, ",\n" + s4o.indent_spaces, "\n" + s4o.indent_spaces);
c2c867171c07 fixing formal function invocation in IL
mario
parents: 46
diff changeset
  1793
}
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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1795
/*  il_assign_operator 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
  1796
 * | il_assign_operator '(' eol_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
  1797
 */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1798
void *visit(il_param_assignment_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1799
  symbol->il_assign_operator->accept(*this);
71
c2c867171c07 fixing formal function invocation in IL
mario
parents: 46
diff changeset
  1800
  s4o.print(" := ");
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1801
  if (symbol->il_operand != NULL)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1802
    symbol->il_operand->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1803
  if (symbol->simple_instr_list != NULL) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1804
    s4o.print("(\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1805
    s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1806
    symbol->simple_instr_list->accept(*this);
10
66f4f7f85d0a generate_iec completed
lbessard
parents: 8
diff changeset
  1807
    s4o.print(s4o.indent_spaces);
71
c2c867171c07 fixing formal function invocation in IL
mario
parents: 46
diff changeset
  1808
    s4o.print(")");
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1809
    s4o.indent_left();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1810
  }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1811
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1812
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1813
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1814
/*  il_assign_out_operator variable */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1815
void *visit(il_param_out_assignment_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1816
  symbol->il_assign_out_operator->accept(*this);
71
c2c867171c07 fixing formal function invocation in IL
mario
parents: 46
diff changeset
  1817
  s4o.print(" => ");
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1818
  symbol->variable->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1819
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1820
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1821
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1822
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1823
/*******************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1824
/* 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
  1825
/*******************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1826
void *visit(LD_operator_c *symbol) {s4o.print("LD "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1827
void *visit(LDN_operator_c *symbol) {s4o.print("LDN "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1828
void *visit(ST_operator_c *symbol) {s4o.print("ST "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1829
void *visit(STN_operator_c *symbol) {s4o.print("STN "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1830
void *visit(NOT_operator_c *symbol) {s4o.print("NOT "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1831
void *visit(S_operator_c *symbol) {s4o.print("S "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1832
void *visit(R_operator_c *symbol) {s4o.print("R "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1833
void *visit(S1_operator_c *symbol) {s4o.print("S1 "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1834
void *visit(R1_operator_c *symbol) {s4o.print("R1 "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1835
void *visit(CLK_operator_c *symbol) {s4o.print("CLK "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1836
void *visit(CU_operator_c *symbol) {s4o.print("CU "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1837
void *visit(CD_operator_c *symbol) {s4o.print("CD "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1838
void *visit(PV_operator_c *symbol) {s4o.print("PV "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1839
void *visit(IN_operator_c *symbol) {s4o.print("IN "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1840
void *visit(PT_operator_c *symbol) {s4o.print("PT "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1841
void *visit(AND_operator_c *symbol) {s4o.print("AND "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1842
void *visit(OR_operator_c *symbol) {s4o.print("OR "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1843
void *visit(XOR_operator_c *symbol) {s4o.print("XOR "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1844
void *visit(ANDN_operator_c *symbol) {s4o.print("ANDN "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1845
void *visit(ORN_operator_c *symbol) {s4o.print("ORN "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1846
void *visit(XORN_operator_c *symbol) {s4o.print("XORN "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1847
void *visit(ADD_operator_c *symbol) {s4o.print("ADD "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1848
void *visit(SUB_operator_c *symbol) {s4o.print("SUB "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1849
void *visit(MUL_operator_c *symbol) {s4o.print("MUL "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1850
void *visit(DIV_operator_c *symbol) {s4o.print("DIV "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1851
void *visit(MOD_operator_c *symbol) {s4o.print("MOD "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1852
void *visit(GT_operator_c *symbol) {s4o.print("GT "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1853
void *visit(GE_operator_c *symbol) {s4o.print("GE "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1854
void *visit(EQ_operator_c *symbol) {s4o.print("EQ "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1855
void *visit(LT_operator_c *symbol) {s4o.print("LT "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1856
void *visit(LE_operator_c *symbol) {s4o.print("LE "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1857
void *visit(NE_operator_c *symbol) {s4o.print("NE "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1858
void *visit(CAL_operator_c *symbol) {s4o.print("CAL "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1859
void *visit(CALC_operator_c *symbol) {s4o.print("CALC "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1860
void *visit(CALCN_operator_c *symbol) {s4o.print("CALCN "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1861
void *visit(RET_operator_c *symbol) {s4o.print("RET "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1862
void *visit(RETC_operator_c *symbol) {s4o.print("RETC "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1863
void *visit(RETCN_operator_c *symbol) {s4o.print("RETCN "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1864
void *visit(JMP_operator_c *symbol) {s4o.print("JMP "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1865
void *visit(JMPC_operator_c *symbol) {s4o.print("JMPC "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1866
void *visit(JMPCN_operator_c *symbol) {s4o.print("JMPCN "); return NULL;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1867
143
73372bdeeffb Adding support for EN/ENO parameters in bison rules
lbessard
parents: 118
diff changeset
  1868
/*| any_identifier ASSIGN */
73372bdeeffb Adding support for EN/ENO parameters in bison rules
lbessard
parents: 118
diff changeset
  1869
void *visit(il_assign_operator_c *symbol) {
73372bdeeffb Adding support for EN/ENO parameters in bison rules
lbessard
parents: 118
diff changeset
  1870
  symbol->variable_name->accept(*this);
73372bdeeffb Adding support for EN/ENO parameters in bison rules
lbessard
parents: 118
diff changeset
  1871
  s4o.print(" := ");
73372bdeeffb Adding support for EN/ENO parameters in bison rules
lbessard
parents: 118
diff changeset
  1872
  return NULL;
73372bdeeffb Adding support for EN/ENO parameters in bison rules
lbessard
parents: 118
diff changeset
  1873
}
73372bdeeffb Adding support for EN/ENO parameters in bison rules
lbessard
parents: 118
diff changeset
  1874
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1875
/*| [NOT] 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
  1876
void *visit(il_assign_out_operator_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1877
  if (symbol->option != NULL)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1878
    symbol->option->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1879
  symbol->variable_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1880
  s4o.print(" => ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1881
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1882
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1883
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1884
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1885
/***********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1886
/* 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
  1887
/***********************/
873
dea39ef02847 Add limited support for the REF() operator (defined in v3 of IEC 61131-3)
mjsousa
parents: 862
diff changeset
  1888
void *visit(ref_expression_c *symbol) {return  s4o.print("REF("); symbol->exp->accept(*this); s4o.print(")");} /* an extension to the IEC 61131-3 standard - based on the IEC 61131-3 v3 standard. Returns address of the varible! */
580
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
  1889
void *visit(or_expression_c *symbol) {return print_binary_expression(symbol, symbol->l_exp, symbol->r_exp, " OR ");}
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
  1890
void *visit(xor_expression_c *symbol) {return print_binary_expression(symbol, symbol->l_exp, symbol->r_exp, " XOR ");}
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
  1891
void *visit(and_expression_c *symbol) {return print_binary_expression(symbol, symbol->l_exp, symbol->r_exp, " AND ");}
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
  1892
void *visit(equ_expression_c *symbol) {return print_binary_expression(symbol, symbol->l_exp, symbol->r_exp, " = ");}
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
  1893
void *visit(notequ_expression_c *symbol) {return print_binary_expression(symbol, symbol->l_exp, symbol->r_exp, " <> ");}
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
  1894
void *visit(lt_expression_c *symbol) {return print_binary_expression(symbol, symbol->l_exp, symbol->r_exp, " < ");}
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
  1895
void *visit(gt_expression_c *symbol) {return print_binary_expression(symbol, symbol->l_exp, symbol->r_exp, " > ");}
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
  1896
void *visit(le_expression_c *symbol) {return print_binary_expression(symbol, symbol->l_exp, symbol->r_exp, " <= ");}
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
  1897
void *visit(ge_expression_c *symbol) {return print_binary_expression(symbol, symbol->l_exp, symbol->r_exp, " >= ");}
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
  1898
void *visit(add_expression_c *symbol) {return print_binary_expression(symbol, symbol->l_exp, symbol->r_exp, " + ");}
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
  1899
void *visit(sub_expression_c *symbol) {return print_binary_expression(symbol, symbol->l_exp, symbol->r_exp, " - ");}
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
  1900
void *visit(mul_expression_c *symbol) {return print_binary_expression(symbol, symbol->l_exp, symbol->r_exp, " * ");}
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
  1901
void *visit(div_expression_c *symbol) {return print_binary_expression(symbol, symbol->l_exp, symbol->r_exp, " / ");}
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
  1902
void *visit(mod_expression_c *symbol) {return print_binary_expression(symbol, symbol->l_exp, symbol->r_exp, " MOD ");}
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
  1903
void *visit(power_expression_c *symbol) {return print_binary_expression(symbol, symbol->l_exp, symbol->r_exp, " ** ");}
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
  1904
void *visit(neg_expression_c *symbol) {return print_unary_expression(symbol, symbol->exp, "-");}
b6350d9f204d Code for debugging const_value annotations in abstract syntax tree.
Mario de Sousa <msousa@fe.up.pt>
parents: 547
diff changeset
  1905
void *visit(not_expression_c *symbol) {return print_unary_expression(symbol, symbol->exp, "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
  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
void *visit(function_invocation_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1908
  symbol->function_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1909
  s4o.print("(");
202
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
  1910
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
  1911
  /* If the syntax parser is working correctly, exactly one of the 
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
  1912
   * following two symbols will be NULL, while the other is != NULL.
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
  1913
   */
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
  1914
  if (symbol->   formal_param_list != NULL) symbol->   formal_param_list->accept(*this);
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
  1915
  if (symbol->nonformal_param_list != NULL) symbol->nonformal_param_list->accept(*this);
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
  1916
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1917
  s4o.print(")");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1918
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  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
/********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1922
/* 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
  1923
/********************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1924
void *visit(statement_list_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1925
  return print_list(symbol, s4o.indent_spaces, ";\n" + s4o.indent_spaces, ";\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1926
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1927
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
/* 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
  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
void *visit( assignment_statement_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1932
  symbol->l_exp->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1933
  s4o.print(" := ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1934
  symbol->r_exp->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1935
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1936
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1937
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
/* 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
  1940
/*****************************************/
143
73372bdeeffb Adding support for EN/ENO parameters in bison rules
lbessard
parents: 118
diff changeset
  1941
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1942
/*  RETURN */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1943
void *visit(return_statement_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1944
  s4o.print("RETURN");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1945
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1946
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1947
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1948
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1949
/* fb_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
  1950
void *visit(fb_invocation_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1951
  symbol->fb_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1952
  s4o.print("(");
202
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
  1953
  /* If the syntax parser is working correctly, at most one of the 
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
  1954
   * following two symbols will be NULL, while the other is != NULL.
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
  1955
   * The two may be NULL simultaneously!
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
  1956
   */
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
  1957
  if (symbol->   formal_param_list != NULL) symbol->   formal_param_list->accept(*this);
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
  1958
  if (symbol->nonformal_param_list != NULL) symbol->nonformal_param_list->accept(*this);
da1a8186f86f Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents: 194
diff changeset
  1959
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1960
  s4o.print(")");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1961
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1962
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1963
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1964
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1965
/* helper symbol for 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
  1966
/* param_assignment_list ',' 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
  1967
void *visit(param_assignment_list_c *symbol) {return print_list(symbol, "", ", ");}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1968
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1969
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1970
void *visit(input_variable_param_assignment_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1971
  symbol->variable_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1972
  s4o.print(" := ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1973
  symbol->expression->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1974
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1975
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1976
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1977
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1978
void *visit(output_variable_param_assignment_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1979
  if (symbol->not_param != NULL)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1980
    symbol->not_param->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1981
  symbol->variable_name->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1982
  s4o.print(" => ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1983
  symbol->variable->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1984
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1985
}
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
void *visit(not_paramassign_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1989
  s4o.print("NOT ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1990
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1991
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1992
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1993
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1994
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1995
/* 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
  1996
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1997
void *visit(if_statement_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1998
  s4o.print("IF ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  1999
  symbol->expression->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2000
  s4o.print(" THEN\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2001
  s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2002
  symbol->statement_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2003
  s4o.indent_left();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2004
  symbol->elseif_statement_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2005
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2006
  if (symbol->else_statement_list != NULL) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2007
    s4o.print(s4o.indent_spaces); s4o.print("ELSE\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2008
    s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2009
    symbol->else_statement_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2010
    s4o.indent_left();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2011
  }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2012
  s4o.print(s4o.indent_spaces); s4o.print("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
  2013
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2016
/* 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
  2017
void *visit(elseif_statement_list_c *symbol) {return print_list(symbol);}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2018
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2019
/* 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
  2020
void *visit(elseif_statement_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2021
  s4o.print(s4o.indent_spaces); s4o.print("ELSIF ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2022
  symbol->expression->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2023
  s4o.print(s4o.indent_spaces); s4o.print("THEN\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2024
  s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2025
  symbol->statement_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2026
  s4o.indent_left();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2027
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2028
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2029
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2030
void *visit(case_statement_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2031
  s4o.print("CASE ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2032
  symbol->expression->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2033
  s4o.print(" OF\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2034
  s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2035
  symbol->case_element_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2036
  if (symbol->statement_list != NULL) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2037
    s4o.print(s4o.indent_spaces + "ELSE\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2038
    s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2039
    symbol->statement_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2040
    s4o.indent_left();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2041
  }
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2042
  s4o.indent_left();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2043
  s4o.print(s4o.indent_spaces + "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
  2044
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2045
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2046
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2047
/* 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
  2048
void *visit(case_element_list_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2049
  return print_list(symbol);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2050
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2051
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2052
void *visit(case_element_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2053
  s4o.print(s4o.indent_spaces);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2054
  symbol->case_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2055
  s4o.print(":\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2056
  s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2057
  symbol->statement_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2058
  s4o.indent_left();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2059
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2060
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2061
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2062
void *visit(case_list_c *symbol) {return print_list(symbol, "", ", ");}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2063
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2064
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2065
/* 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
  2066
/********************************/
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2067
void *visit(for_statement_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2068
  s4o.print("FOR ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2069
  symbol->control_variable->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2070
  s4o.print(" := ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2071
  symbol->beg_expression->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2072
  s4o.print(" TO ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2073
  symbol->end_expression->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2074
  if (symbol->by_expression != NULL) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2075
    s4o.print(" BY ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2076
    symbol->by_expression->accept(*this);
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
  s4o.print(" DO\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2079
  s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2080
  symbol->statement_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2081
  s4o.indent_left();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2082
  s4o.print(s4o.indent_spaces); s4o.print("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
  2083
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2084
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2085
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2086
void *visit(while_statement_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2087
  s4o.print("WHILE ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2088
  symbol->expression->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2089
  s4o.print(" DO\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2090
  s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2091
  symbol->statement_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2092
  s4o.indent_left();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2093
  s4o.print(s4o.indent_spaces); s4o.print("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
  2094
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  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
void *visit(repeat_statement_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2098
  s4o.print("REPEAT\n");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2099
  s4o.indent_right();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2100
  symbol->statement_list->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2101
  s4o.indent_left();
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2102
  s4o.print(s4o.indent_spaces); s4o.print("UNTIL ");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2103
  symbol->expression->accept(*this);
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2104
  s4o.print("\n" + s4o.indent_spaces + "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
  2105
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2106
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2107
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2108
void *visit(exit_statement_c *symbol) {
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2109
  s4o.print("EXIT");
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2110
  return NULL;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2111
}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2112
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
}; /* class generate_iec_c */
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2115
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2116
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2117
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2118
/***********************************************************************/
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
/***********************************************************************/
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
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2127
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2128
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2129
46
fc1b78ea6d84 Adding support for generating files into an user-defined folder
lbessard
parents: 32
diff changeset
  2130
visitor_c *new_code_generator(stage4out_c *s4o, const char *builddir)  {return new generate_iec_c(s4o);}
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2131
void delete_code_generator(visitor_c *code_generator) {delete code_generator;}
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2132
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2133
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2134
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2135
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2136
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2137
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2138
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2139
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2140
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2141
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2142
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2143
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2144
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2145
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
  2146