Moving absyntax utility files out from stage4/generate_c
authormario
Mon, 01 Jun 2009 21:08:44 +0200
changeset 181 38d6eb056260
parent 180 64334c5a00b1
child 182 231633d1d2e4
Moving absyntax utility files out from stage4/generate_c
Makefile
absyntax_utils/Makefile
absyntax_utils/absyntax_utils.cc
absyntax_utils/absyntax_utils.hh
absyntax_utils/decompose_var_instance_name.cc
absyntax_utils/decompose_var_instance_name.hh
absyntax_utils/function_call_iterator.cc
absyntax_utils/function_call_iterator.hh
absyntax_utils/function_call_param_iterator.cc
absyntax_utils/function_call_param_iterator.hh
absyntax_utils/function_param_iterator.cc
absyntax_utils/function_param_iterator.hh
absyntax_utils/function_type_decl.h
absyntax_utils/get_function_type.cc
absyntax_utils/get_function_type.h
absyntax_utils/get_function_type_decl.c
absyntax_utils/search_base_type.cc
absyntax_utils/search_base_type.hh
absyntax_utils/search_constant_type.cc
absyntax_utils/search_constant_type.hh
absyntax_utils/search_expression_type.cc
absyntax_utils/search_expression_type.hh
absyntax_utils/search_fb_instance_decl.cc
absyntax_utils/search_fb_instance_decl.hh
absyntax_utils/search_fb_typedecl.cc
absyntax_utils/search_fb_typedecl.hh
absyntax_utils/search_type_code.c
absyntax_utils/search_var_instance_decl.cc
absyntax_utils/search_var_instance_decl.hh
absyntax_utils/search_varfb_instance_type.cc
absyntax_utils/search_varfb_instance_type.hh
absyntax_utils/spec_init_separator.cc
absyntax_utils/spec_init_separator.hh
absyntax_utils/type_initial_value.cc
absyntax_utils/type_initial_value.hh
main.cc
stage4/generate_c/decompose_var_instance_name.cc
stage4/generate_c/function_call_iterator.cc
stage4/generate_c/function_call_param_iterator.cc
stage4/generate_c/function_type_decl.h
stage4/generate_c/generate_c.cc
stage4/generate_c/get_function_type_decl.c
stage4/generate_c/search_base_type.cc
stage4/generate_c/search_constant_type.cc
stage4/generate_c/search_expression_type.cc
stage4/generate_c/search_fb_instance_decl.cc
stage4/generate_c/search_fb_typedecl.cc
stage4/generate_c/search_type_code.c
stage4/generate_c/search_var_instance_decl.cc
stage4/generate_c/search_varfb_instance_type.cc
stage4/generate_c/spec_init_separator.cc
stage4/generate_c/type_initial_value.cc
--- a/Makefile	Sat May 30 16:42:41 2009 +0200
+++ b/Makefile	Mon Jun 01 21:08:44 2009 +0200
@@ -29,7 +29,25 @@
 CXXFLAGS += -I.
 
 LIBS  = absyntax/absyntax.o absyntax/visitor.o
-LIBS += stage1_2/stage1_2.o stage1_2/iec.y.o stage1_2/iec.flex.o search_utils/search_utils.o 
+LIBS += stage1_2/stage1_2.o stage1_2/iec.y.o stage1_2/iec.flex.o
+
+LIBS += absyntax_utils/absyntax_utils.o
+LIBS += absyntax_utils/search_expression_type.o
+LIBS += absyntax_utils/decompose_var_instance_name.o
+LIBS += absyntax_utils/function_call_iterator.o
+LIBS += absyntax_utils/function_call_param_iterator.o
+LIBS += absyntax_utils/function_param_iterator.o
+LIBS += absyntax_utils/search_base_type.o
+LIBS += absyntax_utils/search_constant_type.o
+LIBS += absyntax_utils/search_fb_instance_decl.o
+LIBS += absyntax_utils/search_fb_typedecl.o
+LIBS += absyntax_utils/search_varfb_instance_type.o
+LIBS += absyntax_utils/search_var_instance_decl.o
+LIBS += absyntax_utils/spec_init_separator.o
+LIBS += absyntax_utils/type_initial_value.o
+LIBS += absyntax_utils/get_function_type.o
+
+
 
 iec2c: main.o stage4/generate_c/generate_c.o stage4/stage4.o $(LIBS)
 	$(CXX) -o iec2c main.o stage4/stage4.o stage4/generate_c/generate_c.o $(LIBS)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/Makefile	Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,42 @@
+# include the system specific Makefile
+include ../Makefile.$(shell uname)
+
+
+
+
+SEARCH_UTIL_FILES  = absyntax_utils.o
+SEARCH_UTIL_FILES += search_expression_type.o
+SEARCH_UTIL_FILES += decompose_var_instance_name.o
+SEARCH_UTIL_FILES += function_call_iterator.o
+SEARCH_UTIL_FILES += function_call_param_iterator.o
+SEARCH_UTIL_FILES += function_param_iterator.o
+SEARCH_UTIL_FILES += search_base_type.o
+SEARCH_UTIL_FILES += search_constant_type.o
+SEARCH_UTIL_FILES += search_fb_instance_decl.o
+SEARCH_UTIL_FILES += search_fb_typedecl.o
+SEARCH_UTIL_FILES += search_varfb_instance_type.o
+SEARCH_UTIL_FILES += search_var_instance_decl.o
+SEARCH_UTIL_FILES += spec_init_separator.o
+SEARCH_UTIL_FILES += type_initial_value.o
+SEARCH_UTIL_FILES += get_function_type.o
+
+
+default: all
+
+all: $(SEARCH_UTIL_FILES)
+
+
+
+clean:
+	rm -f *.o Makefile.depend
+
+
+CXXFLAGS += -I. -I../*
+
+
+
+Makefile.depend depend:
+	$(CXX) -MM -MG -I. *.cc > Makefile.depend
+	#| perl -pe 's/:/ Makefile.depend:/' > Makefile.depend
+
+include Makefile.depend
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/absyntax_utils.cc	Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,290 @@
+/*
+ * (c) 2009 Mario de Sousa
+ *
+ * Offered to the public under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 IL and ST compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+
+/*
+ * This is the main stage 3a file.
+ *
+ * In stage 3a some helpful symbol tables are instanciated and populated.
+ * These symbol tables wll then be used by stage3b and atage4 code generators.
+ */
+
+
+
+
+
+
+// #include <stdio.h>  /* required for NULL */
+#include <string>
+#include <iostream>
+#include <sstream>
+#include <typeinfo>
+#include <list>
+#include <strings.h>
+
+#include "../util/symtable.hh"
+#include "../util/dsymtable.hh"
+#include "../absyntax/visitor.hh"
+
+
+
+//#define DEBUG
+#ifdef DEBUG
+#define TRACE(classname) printf("\n____%s____\n",classname);
+#else
+#define TRACE(classname)
+#endif
+
+#define ERROR error_exit(__FILE__,__LINE__)
+/* function defined in main.cc */
+extern void error_exit(const char *file_name, int line_no);
+
+
+/***********************************************************************/
+/***********************************************************************/
+/***********************************************************************/
+/***********************************************************************/
+
+
+/* returns 0 if the names are equal!! */
+/* NOTE: it must ignore case!! */
+int compare_identifiers(symbol_c *ident1, symbol_c *ident2) {
+
+  token_c *name1 = dynamic_cast<token_c *>(ident1);
+  token_c *name2 = dynamic_cast<token_c *>(ident2);
+  
+  if ((name1 == NULL) || (name2 == NULL))
+    /* invalid identifiers... */
+    return -1;
+
+  if (strcasecmp(name1->value, name2->value) == 0)
+    return 0;
+
+  /* identifiers do not match! */
+  return 1;
+}
+
+
+
+/***********************************************************************/
+/***********************************************************************/
+/***********************************************************************/
+/***********************************************************************/
+
+
+
+/* A symbol table with all globally declared functions... */
+function_declaration_c null_symbol1(NULL,NULL,NULL,NULL);
+dsymtable_c<function_declaration_c *, &null_symbol1> function_symtable;
+
+/* A symbol table with all globally declared functions block types... */
+function_block_declaration_c null_symbol2(NULL,NULL,NULL);
+symtable_c<function_block_declaration_c *, &null_symbol2> function_block_type_symtable;
+
+/* A symbol table with all globally declared program types... */
+program_declaration_c null_symbol3(NULL,NULL,NULL);
+symtable_c<program_declaration_c *, &null_symbol3> program_type_symtable;
+
+/* A symbol table with all user declared type definitions... */
+/* Note that function block types and program types have their
+ * own symbol tables, so do not get placed in this symbol table!
+ */
+symbol_c null_symbol4;
+symtable_c<symbol_c *, &null_symbol4> type_symtable;
+
+
+
+/***********************************************************************/
+/***********************************************************************/
+/***********************************************************************/
+/***********************************************************************/
+
+
+class populate_symtables_c: public iterator_visitor_c {
+
+  public:
+    populate_symtables_c(void) {};
+    virtual ~populate_symtables_c(void) {}
+
+
+  public:
+
+  /*************************/
+  /* B.1 - Common elements */
+  /*************************/
+  /*******************************************/
+  /* B 1.1 - Letters, digits and identifiers */
+  /*******************************************/
+  /*********************/
+  /* B 1.2 - Constants */
+  /*********************/
+  /******************************/
+  /* B 1.2.1 - Numeric Literals */
+  /******************************/
+  /*******************************/
+  /* B.1.2.2   Character Strings */
+  /*******************************/
+  /***************************/
+  /* B 1.2.3 - Time Literals */
+  /***************************/
+  /************************/
+  /* B 1.2.3.1 - Duration */
+  /************************/
+  /************************************/
+  /* B 1.2.3.2 - Time of day and Date */
+  /************************************/
+  /**********************/
+  /* B.1.3 - Data types */
+  /**********************/
+  /***********************************/
+  /* B 1.3.1 - Elementary Data Types */
+  /***********************************/
+  /********************************/
+  /* B.1.3.2 - Generic data types */
+  /********************************/
+  /********************************/
+  /* B 1.3.3 - Derived data types */
+  /********************************/
+
+  /*  subrange_type_name ':' subrange_spec_init */
+  void *visit(subrange_type_declaration_c *symbol) {
+    TRACE("subrange_type_declaration_c");  
+    type_symtable.insert(symbol->subrange_type_name, symbol->subrange_spec_init);
+    return NULL;
+  }
+  
+
+  /*  enumerated_type_name ':' enumerated_spec_init */
+  void *visit(enumerated_type_declaration_c *symbol) {
+    TRACE("enumerated_type_declaration_c");
+    type_symtable.insert(symbol->enumerated_type_name, symbol->enumerated_spec_init);
+    return NULL;
+  }
+
+
+  /*  identifier ':' array_spec_init */
+  void *visit(array_type_declaration_c *symbol) {
+    TRACE("array_type_declaration_c");
+    type_symtable.insert(symbol->identifier, symbol->array_spec_init);
+    return NULL;
+  }
+
+
+  /*  simple_type_name ':' simple_spec_init */
+  void *visit(simple_type_declaration_c *symbol) {
+    TRACE("simple_type_declaration_c");
+    type_symtable.insert(symbol->simple_type_name, symbol->simple_spec_init);
+    return NULL;
+  }
+
+
+  /*  structure_type_name ':' structure_specification */
+  void *visit(structure_type_declaration_c *symbol) {
+    TRACE("structure_type_declaration_c");
+    type_symtable.insert(symbol->structure_type_name, symbol->structure_specification);
+    return NULL;
+  }
+  
+  
+  
+  /*********************/
+  /* B 1.4 - Variables */
+  /*********************/
+  /********************************************/
+  /* B.1.4.1   Directly Represented Variables */
+  /********************************************/
+  /*************************************/
+  /* B.1.4.2   Multi-element Variables */
+  /*************************************/
+  /******************************************/
+  /* B 1.4.3 - Declaration & Initialisation */
+  /******************************************/
+  /**************************************/
+  /* B.1.5 - Program organization units */
+  /**************************************/
+  /***********************/
+  /* B 1.5.1 - Functions */
+  /***********************/
+  public:
+  /*   FUNCTION derived_function_name ':' elementary_type_name io_OR_function_var_declarations_list function_body END_FUNCTION */
+  /* | FUNCTION derived_function_name ':' derived_type_name io_OR_function_var_declarations_list function_body END_FUNCTION */
+  void *visit(function_declaration_c *symbol) {
+    TRACE("function_declaration_c");
+    function_symtable.insert(symbol->derived_function_name, symbol);
+  
+    /* symbol->derived_function_name->accept(*this);  */ /* Function name */
+    /* symbol->type_name->accept(*this);              */ /* return data type */
+    /* symbol->var_declarations_list->accept(*this);  */ /* Function parameters and variables */
+    /* symbol->function_body->accept(*this);          */ /* Function body */
+    return NULL;
+  }
+  
+
+  /*****************************/
+  /* B 1.5.2 - Function Blocks */
+  /*****************************/
+  public:
+  /*  FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations function_block_body END_FUNCTION_BLOCK */
+  //SYM_REF4(function_block_declaration_c, fblock_name, var_declarations, fblock_body, unused)
+  void *visit(function_block_declaration_c *symbol) {
+    TRACE("function_block_declaration_c");
+    function_block_type_symtable.insert(symbol->fblock_name, symbol);
+  /*
+    symbol->fblock_name->accept(*this);
+    symbol->var_declarations->accept(*this);
+    symbol->fblock_body->accept(*this);
+  */
+    return NULL;
+  }
+  
+  
+  /**********************/
+  /* B 1.5.3 - Programs */
+  /**********************/
+  public:
+  /*  PROGRAM program_type_name program_var_declarations_list function_block_body END_PROGRAM */
+  //SYM_REF4(program_declaration_c, program_type_name, var_declarations, function_block_body, unused)
+  void *visit(program_declaration_c *symbol) {
+    TRACE("program_declaration_c");
+    program_type_symtable.insert(symbol->program_type_name, symbol);
+  /*
+    symbol->program_type_name->accept(*this);
+    symbol->var_declarations->accept(*this);
+    symbol->function_block_body->accept(*this);
+  */
+    return NULL;
+  }
+  
+}; /* populate_symtables_c */
+
+
+
+
+
+void absyntax_utils_init(symbol_c *tree_root) {
+  populate_symtables_c populate_symbols;
+
+  tree_root->accept(populate_symbols);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/absyntax_utils.hh	Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,104 @@
+/*
+ * (c) 2009 Mario de Sousa
+ *
+ * Offered to the public under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 IL and ST compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+
+/*
+ * This is the main stage 3a file.
+ *
+ * In stage 3a some helpful symbol tables are instanciated and populated.
+ * These symbol tables wll then be used by stage3b and atage4 code generators.
+ */
+
+
+
+
+#ifndef _SEARCH_UTILS_HH
+#define _SEARCH_UTILS_HH
+
+// #include <stdio.h>  /* required for NULL */
+#include "../util/symtable.hh"
+#include "../util/dsymtable.hh"
+#include "../absyntax/absyntax.hh"
+#include "../absyntax/visitor.hh"
+
+
+
+/* returns 0 if the names are equal!! Case is ignored. */
+int compare_identifiers(symbol_c *ident1, symbol_c *ident2);
+
+/* A symbol table with all globally declared functions... */
+extern function_declaration_c null_symbol1;
+extern dsymtable_c<function_declaration_c *, &null_symbol1> function_symtable;
+
+/* A symbol table with all globally declared functions block types... */
+extern function_block_declaration_c null_symbol2;
+extern symtable_c<function_block_declaration_c *, &null_symbol2> function_block_type_symtable;
+
+/* A symbol table with all globally declared program types... */
+extern program_declaration_c null_symbol3;
+extern symtable_c<program_declaration_c *, &null_symbol3> program_type_symtable;
+
+/* A symbol table with all user declared type definitions... */
+/* Note that function block types and program types have their
+ * own symbol tables, so do not get placed in this symbol table!
+ */
+extern symbol_c null_symbol4;
+extern symtable_c<symbol_c *, &null_symbol4> type_symtable;
+
+
+
+/***********************************************************************/
+/***********************************************************************/
+/***********************************************************************/
+/***********************************************************************/
+
+#include "spec_init_separator.hh"
+#include "function_param_iterator.hh"
+#include "function_call_iterator.hh"
+#include "function_call_param_iterator.hh"
+#include "type_initial_value.hh"
+#include "search_fb_instance_decl.hh"
+#include "search_fb_typedecl.hh"
+#include "search_base_type.hh"
+#include "search_var_instance_decl.hh"
+#include "decompose_var_instance_name.hh"
+#include "search_varfb_instance_type.hh"
+#include "search_constant_type.hh"
+#include "search_expression_type.hh"
+#include "get_function_type.h"
+
+
+/***********************************************************************/
+/***********************************************************************/
+/***********************************************************************/
+/***********************************************************************/
+/***********************************************************************/
+
+
+
+
+void absyntax_utils_init(symbol_c *tree_root);
+
+
+#endif /* _SEARCH_UTILS_HH */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/decompose_var_instance_name.cc	Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,125 @@
+/*
+ * (c) 2003 Mario de Sousa
+ *
+ * Offered to the public under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 IL and ST compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+
+/* Decomposes a variable instance name into its constituents,
+ * example:
+ *    window.points[1].coordinate.x
+ *
+ *  will succesfully return
+ *        - window
+ *        - points
+ *        - coordinate
+ *        - x
+ * on succesive calls to decompose_var_instance_name_c::next_part()
+ */
+
+
+
+#include "decompose_var_instance_name.hh"
+
+decompose_var_instance_name_c::decompose_var_instance_name_c(symbol_c *variable_instance_name) {
+  variable_name = variable_instance_name;
+  next_variable_name = NULL;
+  current_recursive_variable_name = NULL;
+  previously_returned_variable_name = NULL;
+}
+
+symbol_c *decompose_var_instance_name_c::next_part(void) {
+  /* We must always start from the top!
+   * See note in the structured_variable_c visitor
+   * to understand why...
+   */
+  symbol_c *res = (symbol_c *)variable_name->accept(*this);
+  next_variable_name = current_recursive_variable_name;
+
+  if (previously_returned_variable_name == res)
+    return NULL;
+  previously_returned_variable_name = res;
+  return res;
+}
+
+/*********************/
+/* B 1.4 - Variables */
+/*********************/
+void *decompose_var_instance_name_c::visit(symbolic_variable_c *symbol) {return (void *)(symbol->var_name);}
+
+/********************************************/
+/* B.1.4.1   Directly Represented Variables */
+/********************************************/
+void *decompose_var_instance_name_c::visit(direct_variable_c *symbol) {return (void *)symbol;}
+
+/*************************************/
+/* B.1.4.2   Multi-element Variables */
+/*************************************/
+/*  subscripted_variable '[' subscript_list ']' */
+// SYM_REF2(array_variable_c, subscripted_variable, subscript_list)
+void *decompose_var_instance_name_c::visit(array_variable_c *symbol) {
+  /* NOTE: the subscripted_variable may itself be a structure!,
+   * so we must recursevily visit!
+   */
+  return symbol->subscripted_variable->accept(*this);
+}
+
+/*  record_variable '.' field_selector */
+/*  WARNING: input and/or output variables of function blocks
+ *           may be accessed as fields of a tructured variable!
+ *           Code handling a structured_variable_c must take
+ *           this into account!
+ */
+//SYM_REF2(structured_variable_c, record_variable, field_selector)
+void *decompose_var_instance_name_c::visit(structured_variable_c *symbol) {
+  /* NOTE: The following code will not work, as structured_variable_c
+   *       are grouped on the left, and not on the right!
+   *
+   *       example: window.origin.x
+   *       will result in
+   *       s1 = structured_variable_c("window, "origin");
+   *       s2 = structured_variable_c(s1, "x");
+   *       AND NOT
+   *       s1 = structured_variable_c("origin", "x");
+   *       s2 = structured_variable_c("window", s1);
+   *
+   *       as the following code assumes!!
+   *
+  current_variable_name = symbol->field_selector;
+  return symbol->record_variable->accept(*this);
+   */
+
+  /* The correct code, is therefore more complex... */
+  if (next_variable_name == symbol) {
+    /* NOTE: field_selector is always an identifier_c,
+     * so we do not have to recursevily visit it again...
+     * return (void *)symbol->field_selector->accept(*this);  -> NOT REQUIRED!!
+     */
+     return (void *)symbol->field_selector;
+  }
+
+  current_recursive_variable_name = symbol;
+  return symbol->record_variable->accept(*this);
+}
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/decompose_var_instance_name.hh	Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,89 @@
+/*
+ * (c) 2003 Mario de Sousa
+ *
+ * Offered to the public under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 IL and ST compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+
+
+/* Decomposes a variable instance name into its constituents,
+ * example:
+ *    window.points[1].coordinate.x
+ *
+ *  will succesfully return
+ *        - window
+ *        - points
+ *        - coordinate
+ *        - x
+ * on succesive calls to decompose_var_instance_name_c::next_part()
+ */
+
+
+
+#include "../absyntax/visitor.hh"
+
+
+
+class decompose_var_instance_name_c: null_visitor_c {
+
+  private:
+    symbol_c *variable_name;
+    symbol_c *next_variable_name;
+    symbol_c *current_recursive_variable_name;
+    symbol_c *previously_returned_variable_name;
+
+  public:
+    decompose_var_instance_name_c(symbol_c *variable_instance_name);
+
+    symbol_c *next_part(void);
+
+  private:
+  /*********************/
+  /* B 1.4 - Variables */
+  /*********************/
+    void *visit(symbolic_variable_c *symbol);
+  
+  /********************************************/
+  /* B.1.4.1   Directly Represented Variables */
+  /********************************************/
+    void *visit(direct_variable_c *symbol);
+  
+  /*************************************/
+  /* B.1.4.2   Multi-element Variables */
+  /*************************************/
+  /*  subscripted_variable '[' subscript_list ']' */
+  // SYM_REF2(array_variable_c, subscripted_variable, subscript_list)
+    void *visit(array_variable_c *symbol);
+  
+  /*  record_variable '.' field_selector */
+  /*  WARNING: input and/or output variables of function blocks
+   *           may be accessed as fields of a tructured variable!
+   *           Code handling a structured_variable_c must take
+   *           this into account!
+   */
+  //SYM_REF2(structured_variable_c, record_variable, field_selector)
+    void *visit(structured_variable_c *symbol);
+
+}; // decompose_var_instance_name_c
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/function_call_iterator.cc	Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,146 @@
+/*
+ * (c) 2003 Mario de Sousa
+ *
+ * Offered to the public under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 IL and ST compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+
+/*
+ * Function call parameter iterator.
+ *
+ * This is part of the 4th stage that generates
+ * a c++ source program equivalent to the IL and ST
+ * code.
+ */
+
+/* given a function_body_c, iterate through each
+ * function in/out/inout parameter, returning the name
+ * of each parameter...
+ */
+
+
+#include "function_call_iterator.hh"
+
+
+//#define DEBUG
+#ifdef DEBUG
+#define TRACE(classname) printf("\n____%s____\n",classname);
+#else
+#define TRACE(classname)
+#endif
+
+#define ERROR error_exit(__FILE__,__LINE__)
+/* function defined in main.cc */
+extern void error_exit(const char *file_name, int line_no);
+
+
+
+
+
+/* initialise the iterator object.
+ * We must be given a reference to the function declaration
+ * that will be analysed...
+ */
+function_call_iterator_c::function_call_iterator_c(symbol_c *symbol) {
+  this->start_symbol = symbol;
+  next_fcall = fcall_count = 0;
+  current_finvocation = NULL;
+  current_fcall_name = NULL;
+}
+
+/* Skip to the next function call. After object creation,
+ * the object references _before_ the first, so
+ * this function must be called once to get the object to
+ * reference the first function call...
+ *
+ * Returns the function_invocation_c!
+ */
+//function_invocation_c *next(void) {TRACE("function_call_iterator_c::next(): called ");
+symbol_c *function_call_iterator_c::next(void) {TRACE("function_call_iterator_c::next(): called ");
+  fcall_count = 0;
+  next_fcall++;
+  current_finvocation = NULL;
+  current_fcall_name = NULL;
+
+  start_symbol->accept(*this);
+  return current_finvocation;
+}
+
+/* Returns the name of the currently referenced function invocation */
+identifier_c *function_call_iterator_c::fname(void) {
+  identifier_c *identifier = dynamic_cast<identifier_c *>(current_fcall_name);
+  if (identifier == NULL) ERROR;
+  return identifier;
+}
+
+
+/***************************************/
+/* B.3 - Language ST (Structured Text) */
+/***************************************/
+/***********************/
+/* B 3.1 - Expressions */
+/***********************/
+  void *function_call_iterator_c::visit(function_invocation_c *symbol) {
+    fcall_count++;
+    if (next_fcall == fcall_count) {
+      current_finvocation = symbol;
+      current_fcall_name = symbol->function_name;
+    }
+    return NULL;
+  }
+
+
+
+/****************************************/
+/* B.2 - Language IL (Instruction List) */
+/****************************************/
+/***********************************/
+/* B 2.1 Instructions and Operands */
+/***********************************/
+
+/* | function_name [il_operand_list] */
+// SYM_REF2(il_function_call_c, function_name, il_operand_list)
+  void *function_call_iterator_c::visit(il_function_call_c *symbol) {
+    fcall_count++;
+    if (next_fcall == fcall_count) {
+      current_finvocation = symbol;
+      current_fcall_name = symbol->function_name;
+    }
+    return NULL;
+  }
+
+
+
+/* | function_name '(' eol_list [il_param_list] ')' */
+// SYM_REF2(il_formal_funct_call_c, function_name, il_param_list)
+  void *function_call_iterator_c::visit(il_formal_funct_call_c *symbol) {
+    fcall_count++;
+    if (next_fcall == fcall_count) {
+      current_finvocation = symbol;
+      current_fcall_name = symbol->function_name;
+    }
+    return NULL;
+  }
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/function_call_iterator.hh	Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,98 @@
+/*
+ * (c) 2003 Mario de Sousa
+ *
+ * Offered to the public under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 IL and ST compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+
+/*
+ * Function call parameter iterator.
+ *
+ * This is part of the 4th stage that generates
+ * a c++ source program equivalent to the IL and ST
+ * code.
+ */
+
+
+#include "../absyntax/visitor.hh"
+
+
+
+/* given a function_body_c, iterate through each
+ * function in/out/inout parameter, returning the name
+ * of each parameter...
+ */
+class function_call_iterator_c : public iterator_visitor_c {
+
+  private:
+    symbol_c *start_symbol;
+    int next_fcall, fcall_count;
+    symbol_c *current_fcall_name;
+    symbol_c *current_finvocation;
+
+  public:
+    /* initialise the iterator object.
+     * We must be given a reference to the function declaration
+     * that will be analysed...
+     */
+    function_call_iterator_c(symbol_c *symbol);
+
+    /* Skip to the next function call. After object creation,
+     * the object references _before_ the first, so
+     * this function must be called once to get the object to
+     * reference the first function call...
+     *
+     * Returns the function_invocation_c!
+     */
+    symbol_c *next(void);
+
+    /* Returns the name of the currently referenced function invocation */
+    identifier_c *fname(void);
+
+  private:
+  /***************************************/
+  /* B.3 - Language ST (Structured Text) */
+  /***************************************/
+  /***********************/
+  /* B 3.1 - Expressions */
+  /***********************/
+    void *visit(function_invocation_c *symbol);
+  
+  /****************************************/
+  /* B.2 - Language IL (Instruction List) */
+  /****************************************/
+  /***********************************/
+  /* B 2.1 Instructions and Operands */
+  /***********************************/
+  
+  /* | function_name [il_operand_list] */
+  // SYM_REF2(il_function_call_c, function_name, il_operand_list)
+    void *visit(il_function_call_c *symbol);
+  
+  /* | function_name '(' eol_list [il_param_list] ')' */
+  // SYM_REF2(il_formal_funct_call_c, function_name, il_param_list)
+  void *visit(il_formal_funct_call_c *symbol);
+
+}; // class function_call_iterator_c 
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/function_call_param_iterator.cc	Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,512 @@
+/*
+ * (c) 2003 Mario de Sousa
+ *
+ * Offered to the public under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 IL and ST compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+/*
+ * Function call parameter iterator.
+ * It will iterate through the formal parameters of a function call
+ * (i.e. function calls using the foo(<param1>, <param2>, ...) syntax).
+ * and/or search through the non-formal parameters of a function call
+ * (i.e. function calls using the foo(<name1> = <param1>, <name2> = <param2>, ...) syntax).
+ *
+ * Calls to function blocks and programs are also supported.
+ *
+ * Note that calls to next() will only iterate through formal parameters,
+ * and calls to search()  will only serach through non-formal parameters.
+ */
+
+
+
+#include "function_call_param_iterator.hh"
+#include <strings.h>
+
+
+//#define DEBUG
+#ifdef DEBUG
+#define TRACE(classname) printf("\n____%s____\n",classname);
+#else
+#define TRACE(classname)
+#endif
+
+#define ERROR error_exit(__FILE__,__LINE__)
+/* function defined in main.cc */
+extern void error_exit(const char *file_name, int line_no);
+
+
+
+
+
+void *function_call_param_iterator_c::search_list(list_c *list) {
+  switch (current_operation) {
+    case iterate_op:
+      for(int i = 0; i < list->n; i++) {
+        void *res = list->elements[i]->accept(*this);
+        if (NULL != res) {
+          /* It went through the handle_parameter_assignment() function,
+           * and is therefore a parameter assignment (<param> = <value>),
+           * and not a simple expression (<value>).
+           */
+          /* we do nothing... */
+        } else {
+          param_count++;
+          if (param_count == next_param) {
+            return list->elements[i];
+          }
+        }
+      }
+      return NULL;
+      break;
+
+    case search_op:
+      for(int i = 0; i < list->n; i++) {
+        void *res = list->elements[i]->accept(*this);
+        if (res != NULL)
+          return res;
+      }
+      return NULL;
+      break;
+  } /* switch */
+  return NULL;
+}
+
+
+
+void *function_call_param_iterator_c::handle_parameter_assignment(symbol_c *variable_name, symbol_c *expression) {
+  switch (current_operation) {
+    case iterate_op:
+          /* UGLY HACK -> this will be detected in the search_list() function */
+      return (void *)this; /* anything, as long as it is not NULL!! */
+      break;
+
+    case search_op:
+      identifier_c *variable_name2 = dynamic_cast<identifier_c *>(variable_name);
+      
+      if (variable_name2 == NULL) {
+        en_param_c *en_param = dynamic_cast<en_param_c *>(variable_name);
+        if (en_param != NULL)
+          variable_name2 = new identifier_c("EN");
+      }
+      
+      if (variable_name2 == NULL) {
+        eno_param_c *eno_param = dynamic_cast<eno_param_c *>(variable_name);
+        if (eno_param != NULL)
+          variable_name2 = new identifier_c("ENO");
+      }
+      
+      if (variable_name2 == NULL) ERROR;
+      
+      if (strcasecmp(search_param_name->value, variable_name2->value) == 0)
+        /* FOUND! This is the same parameter!! */
+        return (void *)expression;
+      return NULL;
+      break;
+  }
+
+  ERROR;
+  return NULL;
+}
+
+
+/* start off at the first parameter once again... */
+void function_call_param_iterator_c::reset(void) {
+  next_param = param_count = 0;
+}
+
+/* initialise the iterator object.
+ * We must be given a reference to the function/program/function block call
+ * that will be analysed...
+ */
+function_call_param_iterator_c::function_call_param_iterator_c(symbol_c *f_call) {
+  /* It is expected that f_call will reference one of the following:
+   *  program_configuration_c
+   *  function_invocation_c
+   *  fb_invocation_c
+   *  il_function_call_c
+   *  il_formal_funct_call_c
+   *  ... (have I missed any?)
+   */
+  this->f_call = f_call;
+  search_param_name = NULL;
+  reset();
+}
+
+/* Skip to the next parameter. After object creation,
+ * the object references on parameter _before_ the first, so
+ * this function must be called once to get the object to
+ * reference the first parameter...
+ *
+ * Returns whatever is being passed to the parameter!
+ */
+symbol_c *function_call_param_iterator_c::next(void) {
+  param_count = 0;
+  next_param++;
+  current_operation = function_call_param_iterator_c::iterate_op;
+  void *res = f_call->accept(*this);
+  return (symbol_c *)res;
+}
+
+/* Search for the value passed to the parameter named <param_name>...  */
+symbol_c *function_call_param_iterator_c::search(symbol_c *param_name) {
+  if (NULL == param_name) ERROR;
+  search_param_name = dynamic_cast<identifier_c *>(param_name);
+  if (NULL == search_param_name) ERROR;
+  current_operation = function_call_param_iterator_c::search_op;
+  void *res = f_call->accept(*this);
+  return (symbol_c *)res;
+}
+
+
+
+/********************************/
+/* B 1.7 Configuration elements */
+/********************************/
+
+/*
+CONFIGURATION configuration_name
+   optional_global_var_declarations
+   (resource_declaration_list | single_resource_declaration)
+   optional_access_declarations
+   optional_instance_specific_initializations
+END_CONFIGURATION
+*/
+/*
+SYM_REF6(configuration_declaration_c, configuration_name, global_var_declarations, resource_declarations, access_declarations, instance_specific_initializations, unused)
+*/
+
+/* helper symbol for configuration_declaration */
+/*
+SYM_LIST(resource_declaration_list_c)
+*/
+
+/*
+RESOURCE resource_name ON resource_type_name
+   optional_global_var_declarations
+   single_resource_declaration
+END_RESOURCE
+*/
+/*
+SYM_REF4(resource_declaration_c, resource_name, resource_type_name, global_var_declarations, resource_declaration)
+*/
+
+/* task_configuration_list program_configuration_list */
+/*
+SYM_REF2(single_resource_declaration_c, task_configuration_list, program_configuration_list)
+*/
+
+/* helper symbol for single_resource_declaration */
+/*
+SYM_LIST(task_configuration_list_c)
+*/
+
+/* helper symbol for single_resource_declaration */
+/*
+SYM_LIST(program_configuration_list_c)
+*/
+
+/* helper symbol for
+ *  - access_path
+ *  - instance_specific_init
+ */
+/*
+SYM_LIST(any_fb_name_list_c)
+*/
+
+/*  [resource_name '.'] global_var_name ['.' structure_element_name] */
+/*
+SYM_REF4(global_var_reference_c, resource_name, global_var_name, structure_element_name, unused)
+*/
+
+/*  prev_declared_program_name '.' symbolic_variable */
+/*
+SYM_REF2(program_output_reference_c, program_name, symbolic_variable)
+*/
+
+/*  TASK task_name task_initialization */
+/*
+SYM_REF2(task_configuration_c, task_name, task_initialization)
+*/
+
+/*  '(' [SINGLE ASSIGN data_source ','] [INTERVAL ASSIGN data_source ','] PRIORITY ASSIGN integer ')' */
+/*
+SYM_REF4(task_initialization_c, single_data_source, interval_data_source, priority_data_source, unused)
+*/
+
+/*  PROGRAM [RETAIN | NON_RETAIN] program_name [WITH task_name] ':' program_type_name ['(' prog_conf_elements ')'] */
+// SYM_REF6(program_configuration_c, retain_option, program_name, task_name, program_type_name, prog_conf_elements, unused)
+void *function_call_param_iterator_c::visit(program_configuration_c *symbol) {
+  TRACE("program_configuration_c");
+  return symbol->prog_conf_elements->accept(*this);
+}
+
+/* prog_conf_elements ',' prog_conf_element */
+// SYM_LIST(prog_conf_elements_c)
+void *function_call_param_iterator_c::visit(prog_conf_elements_c *symbol) {
+  TRACE("prog_conf_elements_c");
+  return search_list(symbol);
+}
+
+/*  fb_name WITH task_name */
+/*
+SYM_REF2(fb_task_c, fb_name, task_name)
+*/
+
+/*  any_symbolic_variable ASSIGN prog_data_source */
+// SYM_REF2(prog_cnxn_assign_c, symbolic_variable, prog_data_source)
+void *function_call_param_iterator_c::visit(prog_cnxn_assign_c *symbol) {
+  TRACE("prog_cnxn_assign_c");
+
+  /* NOTE: symbolic_variable may be something other than a symbolic_variable_c, but I (Mario)
+   *       do not understand the semantics that should be implmeneted if it is not a
+   *        symbolic_variable, so for the moment we simply give up!
+   */
+  symbolic_variable_c *symb_var = dynamic_cast<symbolic_variable_c *>(symbol->symbolic_variable);
+  if (NULL == symb_var)
+    ERROR;
+
+  return handle_parameter_assignment(symb_var->var_name, symbol->prog_data_source);
+}
+
+/* any_symbolic_variable SENDTO data_sink */
+// SYM_REF2(prog_cnxn_sendto_c, symbolic_variable, prog_data_source)
+void *function_call_param_iterator_c::visit(prog_cnxn_sendto_c *symbol) {
+  TRACE("prog_cnxn_sendto_c");
+
+  /* NOTE: symbolic_variable may be something other than a symbolic_variable_c, but I (Mario)
+   *       do not understand the semantics that should be implmeneted if it is not a
+   *        symbolic_variable, so for the moment we simply give up!
+   */
+  symbolic_variable_c *symb_var = dynamic_cast<symbolic_variable_c *>(symbol->symbolic_variable);
+  if (NULL == symb_var)
+    ERROR;
+
+  return handle_parameter_assignment(symb_var->var_name, symbol->data_sink);
+}
+
+/* VAR_CONFIG instance_specific_init_list END_VAR */
+/*
+SYM_REF2(instance_specific_initializations_c, instance_specific_init_list, unused)
+*/
+
+/* helper symbol for instance_specific_initializations */
+/*
+SYM_LIST(instance_specific_init_list_c)
+*/
+
+/* resource_name '.' program_name '.' {fb_name '.'}
+    ((variable_name [location] ':' located_var_spec_init) | (fb_name ':' fb_initialization))
+*/
+/*
+SYM_REF6(instance_specific_init_c, resource_name, program_name, any_fb_name_list, variable_name, location, initialization)
+*/
+
+/* helper symbol for instance_specific_init */
+/* function_block_type_name ':=' structure_initialization */
+/*
+SYM_REF2(fb_initialization_c, function_block_type_name, structure_initialization)
+*/
+
+
+
+/****************************************/
+/* B.2 - Language IL (Instruction List) */
+/****************************************/
+/***********************************/
+/* B 2.1 Instructions and Operands */
+/***********************************/
+
+/* | function_name [il_operand_list] */
+// SYM_REF2(il_function_call_c, function_name, il_operand_list)
+void *function_call_param_iterator_c::visit(il_function_call_c *symbol) {
+  TRACE("il_function_call_c");
+  if (NULL != symbol->il_operand_list)
+    return symbol->il_operand_list->accept(*this);
+  return NULL;
+}
+
+
+/* | function_name '(' eol_list [il_param_list] ')' */
+// SYM_REF2(il_formal_funct_call_c, function_name, il_param_list)
+void *function_call_param_iterator_c::visit(il_formal_funct_call_c *symbol) {
+  TRACE("il_formal_funct_call_c");
+  if (NULL != symbol->il_param_list)
+    return symbol->il_param_list->accept(*this);
+  return NULL;
+}
+
+
+/*   il_call_operator prev_declared_fb_name
+ * | il_call_operator prev_declared_fb_name '(' ')'
+ * | il_call_operator prev_declared_fb_name '(' eol_list ')'
+ * | il_call_operator prev_declared_fb_name '(' il_operand_list ')'
+ * | il_call_operator prev_declared_fb_name '(' eol_list il_param_list ')'
+ */
+// SYM_REF4(il_fb_call_c, il_call_operator, fb_name, il_operand_list, il_param_list)
+void *function_call_param_iterator_c::visit(il_fb_call_c *symbol) {
+  TRACE("il_fb_call_c");
+  /* the following should never occur. In reality the syntax parser
+   * will guarantee that they never occur, but it makes it easier to
+   * understand the remaining code :-)
+   */
+  //if ((NULL == symbol->il_operand_list) && (NULL == symbol->il_param_list)) ERROR;
+  //if ((NULL != symbol->il_operand_list) && (NULL != symbol->il_param_list)) ERROR;
+
+  if (NULL != symbol->il_operand_list)
+    return symbol->il_operand_list->accept(*this);
+  if (NULL != symbol->il_param_list)
+    return symbol->il_param_list->accept(*this);
+  return NULL;
+}
+
+/* | il_operand_list ',' il_operand */
+// SYM_LIST(il_operand_list_c)
+void *function_call_param_iterator_c::visit(il_operand_list_c *symbol) {
+  TRACE("il_operand_list_c");
+  return search_list(symbol);
+}
+
+
+/* | il_initial_param_list il_param_instruction */
+// SYM_LIST(il_param_list_c)
+void *function_call_param_iterator_c::visit(il_param_list_c *symbol) {
+  TRACE("il_param_list_c");
+  return search_list(symbol);
+}
+
+/*  il_assign_operator il_operand
+ * | il_assign_operator '(' eol_list simple_instr_list ')'
+ */
+// SYM_REF4(il_param_assignment_c, il_assign_operator, il_operand, simple_instr_list, unused)
+void *function_call_param_iterator_c::visit(il_param_assignment_c *symbol) {
+  TRACE("il_param_assignment_c");
+
+  // TODO : We do not yet handle a instruction list passed as parameter !!!
+  // since we do not yet support it, it is best to simply stop than to fail silently...
+  if (NULL != symbol->simple_instr_list) ERROR;
+
+  return handle_parameter_assignment(symbol->il_assign_operator, symbol->il_operand);
+}
+
+/*  il_assign_out_operator variable */
+// SYM_REF2(il_param_out_assignment_c, il_assign_out_operator, variable);
+void *function_call_param_iterator_c::visit(il_param_out_assignment_c *symbol) {
+  TRACE("il_param_out_assignment_c");
+  return handle_parameter_assignment((symbol_c *)symbol->il_assign_out_operator->accept(*this), symbol->variable);
+}
+
+
+/*******************/
+/* B 2.2 Operators */
+/*******************/
+/*| [NOT] any_identifier SENDTO */
+// SYM_REF2(il_assign_out_operator_c, option, variable_name)
+void *function_call_param_iterator_c::visit(il_assign_out_operator_c *symbol) {
+  TRACE("il_assign_out_operator_c");
+
+  // TODO : Handle not_param !!!
+  // we do not yet support it, so it is best to simply stop than to fail silently...
+  if (NULL != symbol->option) ERROR;
+
+  return (void *)symbol->variable_name;
+}
+
+
+
+
+/***************************************/
+/* B.3 - Language ST (Structured Text) */
+/***************************************/
+/***********************/
+/* B 3.1 - Expressions */
+/***********************/
+
+/*
+SYM_REF2(function_invocation_c, function_name, parameter_assignment_list)
+*/
+void *function_call_param_iterator_c::visit(function_invocation_c *symbol) {
+  TRACE("function_invocation_c");
+  if ((symbol_c *)symbol == f_call && symbol->parameter_assignment_list != NULL)
+    return symbol->parameter_assignment_list->accept(*this);
+  else
+    return NULL;
+}
+
+
+/********************/
+/* B 3.2 Statements */
+/********************/
+
+/*********************************/
+/* B 3.2.1 Assignment Statements */
+/*********************************/
+/*
+SYM_REF2(assignment_statement_c, l_exp, r_exp)
+*/
+
+/*****************************************/
+/* B 3.2.2 Subprogram Control Statements */
+/*****************************************/
+/*  RETURN */
+// SYM_REF0(return_statement_c)
+
+
+/* fb_name '(' [param_assignment_list] ')' */
+/* param_assignment_list -> may be NULL ! */
+// SYM_REF2(fb_invocation_c, fb_name, param_assignment_list)
+void *function_call_param_iterator_c::visit(fb_invocation_c *symbol) {
+  TRACE("fb_invocation_c");
+  if (symbol->param_assignment_list != NULL)
+    return symbol->param_assignment_list->accept(*this);
+  else
+    return NULL;
+}
+
+/* helper symbol for fb_invocation */
+/* param_assignment_list ',' param_assignment */
+// SYM_LIST(param_assignment_list_c)
+void *function_call_param_iterator_c::visit(param_assignment_list_c *symbol) {
+  TRACE("param_assignment_list_c");
+  return search_list(symbol);
+}
+
+/*  variable_name ASSIGN expression */
+// SYM_REF2(input_variable_param_assignment_c, variable_name, expression)
+void *function_call_param_iterator_c::visit(input_variable_param_assignment_c *symbol) {
+  TRACE("input_variable_param_assignment_c");
+  return handle_parameter_assignment(symbol->variable_name, symbol->expression);
+}
+
+/* [NOT] variable_name '=>' variable */
+// SYM_REF4(output_variable_param_assignment_c, not_param, variable_name, variable, unused)
+void *function_call_param_iterator_c::visit(output_variable_param_assignment_c *symbol) {
+  TRACE("output_variable_param_assignment_c");
+  // TODO : Handle not_param !!!
+  if (NULL != symbol->not_param) ERROR;  // we do not yet support it, so it is best to simply stop than to fail silently...
+
+  return handle_parameter_assignment(symbol->variable_name, symbol->variable);
+}
+
+/* helper CLASS for output_variable_param_assignment */
+// SYM_REF0(not_paramassign_c)
+// TODO... ???
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/function_call_param_iterator.hh	Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,321 @@
+/*
+ * (c) 2003 Mario de Sousa
+ *
+ * Offered to the public under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 IL and ST compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+/*
+ * Function call parameter iterator.
+ * It will iterate through the formal parameters of a function call
+ * (i.e. function calls using the foo(<param1>, <param2>, ...) syntax).
+ * and/or search through the non-formal parameters of a function call
+ * (i.e. function calls using the foo(<name1> = <param1>, <name2> = <param2>, ...) syntax).
+ *
+ * Calls to function blocks and programs are also supported.
+ *
+ * Note that calls to next() will only iterate through formal parameters,
+ * and calls to search()  will only serach through non-formal parameters.
+ */
+
+
+#include "../absyntax/visitor.hh"
+
+
+class function_call_param_iterator_c : public null_visitor_c {
+
+  private:
+      /* a pointer to the function call
+       * (or function block or program call!)
+       */
+    symbol_c *f_call;
+    int next_param, param_count;
+    identifier_c *search_param_name;
+
+    /* Which operation of the class was called...
+     * Search a parameter, or iterate to the next parameter.
+     */
+    typedef enum {iterate_op, search_op} operation_t;
+    operation_t current_operation;
+
+  private:
+    void *search_list(list_c *list);
+    void *handle_parameter_assignment(symbol_c *variable_name, symbol_c *expression) ;
+
+
+  public:
+    /* start off at the first parameter once again... */
+    void reset(void);
+
+    /* initialise the iterator object.
+     * We must be given a reference to the function/program/function block call
+     * that will be analysed...
+     */
+    function_call_param_iterator_c(symbol_c *f_call);
+
+    /* Skip to the next parameter. After object creation,
+     * the object references on parameter _before_ the first, so
+     * this function must be called once to get the object to
+     * reference the first parameter...
+     *
+     * Returns whatever is being passed to the parameter!
+     */
+    symbol_c *next(void);
+
+    /* Search for the value passed to the parameter named <param_name>...  */
+    symbol_c *search(symbol_c *param_name);
+
+
+  private:
+  /********************************/
+  /* B 1.7 Configuration elements */
+  /********************************/
+ 
+  /*
+  CONFIGURATION configuration_name
+     optional_global_var_declarations
+   (resource_declaration_list | single_resource_declaration)
+   optional_access_declarations
+   optional_instance_specific_initializations
+  END_CONFIGURATION
+  */
+  /*
+  SYM_REF6(configuration_declaration_c, configuration_name, global_var_declarations, resource_declarations, access_declarations, instance_specific_initializations, unused)
+  */
+
+  /* helper symbol for configuration_declaration */
+  /*
+  SYM_LIST(resource_declaration_list_c)
+  */
+
+  /*
+  RESOURCE resource_name ON resource_type_name
+     optional_global_var_declarations
+   single_resource_declaration
+  END_RESOURCE
+  */
+  /*
+  SYM_REF4(resource_declaration_c, resource_name, resource_type_name, global_var_declarations, resource_declaration)
+  */
+
+  /* task_configuration_list program_configuration_list */
+  /*
+  SYM_REF2(single_resource_declaration_c, task_configuration_list, program_configuration_list)
+  */
+
+  /* helper symbol for single_resource_declaration */
+  /*
+  SYM_LIST(task_configuration_list_c)
+  */
+
+  /* helper symbol for single_resource_declaration */
+  /*
+  SYM_LIST(program_configuration_list_c)
+  */
+
+  /* helper symbol for
+   *  - access_path
+   *  - instance_specific_init
+   */
+  /*
+  SYM_LIST(any_fb_name_list_c)
+  */
+
+  /*  [resource_name '.'] global_var_name ['.' structure_element_name] */
+  /*
+  SYM_REF4(global_var_reference_c, resource_name, global_var_name, structure_element_name, unused)
+  */
+
+  /*  prev_declared_program_name '.' symbolic_variable */
+  /*
+  SYM_REF2(program_output_reference_c, program_name, symbolic_variable)
+  */
+ 
+  /*  TASK task_name task_initialization */
+  /*
+  SYM_REF2(task_configuration_c, task_name, task_initialization)
+  */
+
+  /*  '(' [SINGLE ASSIGN data_source ','] [INTERVAL ASSIGN data_source ','] PRIORITY ASSIGN integer ')' */
+  /*
+  SYM_REF4(task_initialization_c, single_data_source, interval_data_source, priority_data_source, unused)
+  */
+
+  /*  PROGRAM [RETAIN | NON_RETAIN] program_name [WITH task_name] ':' program_type_name ['(' prog_conf_elements ')'] */
+  // SYM_REF6(program_configuration_c, retain_option, program_name, task_name, program_type_name, prog_conf_elements, unused)
+    void *visit(program_configuration_c *symbol);
+
+  /* prog_conf_elements ',' prog_conf_element */
+  // SYM_LIST(prog_conf_elements_c)
+    void *visit(prog_conf_elements_c *symbol);
+
+  /*  fb_name WITH task_name */
+  /*
+  SYM_REF2(fb_task_c, fb_name, task_name)
+  */
+
+  /*  any_symbolic_variable ASSIGN prog_data_source */
+  // SYM_REF2(prog_cnxn_assign_c, symbolic_variable, prog_data_source)
+    void *visit(prog_cnxn_assign_c *symbol);
+
+  /* any_symbolic_variable SENDTO data_sink */
+  // SYM_REF2(prog_cnxn_sendto_c, symbolic_variable, prog_data_source)
+    void *visit(prog_cnxn_sendto_c *symbol);
+
+  /* VAR_CONFIG instance_specific_init_list END_VAR */
+  /*
+  SYM_REF2(instance_specific_initializations_c, instance_specific_init_list, unused)
+  */
+
+  /* helper symbol for instance_specific_initializations */
+  /*
+  SYM_LIST(instance_specific_init_list_c)
+  */
+
+  /* resource_name '.' program_name '.' {fb_name '.'}
+      ((variable_name [location] ':' located_var_spec_init) | (fb_name ':' fb_initialization))
+  */
+  /*
+  SYM_REF6(instance_specific_init_c, resource_name, program_name, any_fb_name_list, variable_name, location, initialization)
+  */
+
+  /* helper symbol for instance_specific_init */
+  /* function_block_type_name ':=' structure_initialization */
+  /*
+  SYM_REF2(fb_initialization_c, function_block_type_name, structure_initialization)
+  */
+
+
+  /****************************************/
+  /* B.2 - Language IL (Instruction List) */
+  /****************************************/
+  /***********************************/
+  /* B 2.1 Instructions and Operands */
+  /***********************************/
+
+  /* | function_name [il_operand_list] */
+  // SYM_REF2(il_function_call_c, function_name, il_operand_list)
+    void *visit(il_function_call_c *symbol);
+
+
+  /* | function_name '(' eol_list [il_param_list] ')' */
+  // SYM_REF2(il_formal_funct_call_c, function_name, il_param_list)
+    void *visit(il_formal_funct_call_c *symbol);
+
+
+  /*   il_call_operator prev_declared_fb_name
+   * | il_call_operator prev_declared_fb_name '(' ')'
+   * | il_call_operator prev_declared_fb_name '(' eol_list ')'
+   * | il_call_operator prev_declared_fb_name '(' il_operand_list ')'
+   * | il_call_operator prev_declared_fb_name '(' eol_list il_param_list ')'
+   */
+  // SYM_REF4(il_fb_call_c, il_call_operator, fb_name, il_operand_list, il_param_list)
+    void *visit(il_fb_call_c *symbol);
+
+
+
+  /* | il_operand_list ',' il_operand */
+  // SYM_LIST(il_operand_list_c)
+    void *visit(il_operand_list_c *symbol);
+
+
+  /* | il_initial_param_list il_param_instruction */
+  // SYM_LIST(il_param_list_c)
+    void *visit(il_param_list_c *symbol);
+
+  /*  il_assign_operator il_operand
+   * | il_assign_operator '(' eol_list simple_instr_list ')'
+   */
+  // SYM_REF4(il_param_assignment_c, il_assign_operator, il_operand, simple_instr_list, unused)
+    void *visit(il_param_assignment_c *symbol);
+
+  /*  il_assign_out_operator variable */
+  // SYM_REF2(il_param_out_assignment_c, il_assign_out_operator, variable);
+    void *visit(il_param_out_assignment_c *symbol);
+
+
+  /*******************/
+  /* B 2.2 Operators */
+  /*******************/
+  /*| [NOT] any_identifier SENDTO */
+  // SYM_REF2(il_assign_out_operator_c, option, variable_name)
+    void *visit(il_assign_out_operator_c *symbol);
+
+
+
+
+  /***************************************/
+  /* B.3 - Language ST (Structured Text) */
+  /***************************************/
+  /***********************/
+  /* B 3.1 - Expressions */
+  /***********************/
+
+  /*
+  SYM_REF2(function_invocation_c, function_name, parameter_assignment_list)
+  */
+    void *visit(function_invocation_c *symbol);
+
+
+  /********************/
+  /* B 3.2 Statements */
+  /********************/
+
+  /*********************************/
+  /* B 3.2.1 Assignment Statements */
+  /*********************************/
+  /*
+  SYM_REF2(assignment_statement_c, l_exp, r_exp)
+  */
+
+  /*****************************************/
+  /* B 3.2.2 Subprogram Control Statements */
+  /*****************************************/
+  /*  RETURN */
+  // SYM_REF0(return_statement_c)
+
+
+  /* fb_name '(' [param_assignment_list] ')' */
+  /* param_assignment_list -> may be NULL ! */
+  // SYM_REF2(fb_invocation_c, fb_name, param_assignment_list)
+    void *visit(fb_invocation_c *symbol);
+
+  /* helper symbol for fb_invocation */
+  /* param_assignment_list ',' param_assignment */
+  // SYM_LIST(param_assignment_list_c)
+    void *visit(param_assignment_list_c *symbol);
+
+  /*  variable_name ASSIGN expression */
+  // SYM_REF2(input_variable_param_assignment_c, variable_name, expression)
+    void *visit(input_variable_param_assignment_c *symbol);
+
+  /* [NOT] variable_name '=>' variable */
+  // SYM_REF4(output_variable_param_assignment_c, not_param, variable_name, variable, unused)
+    void *visit(output_variable_param_assignment_c *symbol);
+
+  /* helper CLASS for output_variable_param_assignment */
+  // SYM_REF0(not_paramassign_c)
+  // TODO... ???
+
+};  // function_call_param_iterator_c
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/function_param_iterator.cc	Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,405 @@
+/*
+ * (c) 2003 Mario de Sousa
+ *
+ * Offered to the public under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 IL and ST compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+
+/*
+ * Function parameter iterator.
+ * Iterate through the in/out parameters of a function declaration.
+ * Function blocks are also suported.
+ *
+ * This is part of the 4th stage that generates
+ * a c++ source program equivalent to the IL and ST
+ * code.
+ */
+
+/* Given a function_declaration_c, iterate through each
+ * function in/out/inout parameter, returning the name
+ * of each parameter...function_param_iterator_c
+ */
+
+
+
+#include "function_param_iterator.hh"
+#include "spec_init_separator.hh"
+#include <strings.h>
+
+
+//#define DEBUG
+#ifdef DEBUG
+#define TRACE(classname) printf("\n____%s____\n",classname);
+#else
+#define TRACE(classname)
+#endif
+
+
+#define ERROR error_exit(__FILE__,__LINE__)
+/* function defined in main.cc */
+extern void error_exit(const char *file_name, int line_no);
+
+
+
+void* function_param_iterator_c::handle_param_list(list_c *list) {
+  if (next_param <= param_count + list->n)
+    return list->elements[next_param - param_count - 1];
+
+  /* the desired param is not on this list... */
+  param_count += list->n;
+ return NULL;
+}
+
+void* function_param_iterator_c::handle_single_param(symbol_c *var_name) {
+  param_count++;
+  if (next_param == param_count)
+    return var_name;
+
+  /* not yet the desired param... */
+ return NULL;
+}
+
+void* function_param_iterator_c::iterate_list(list_c *list) {
+  void *res;
+  for (int i = 0; i < list->n; i++) {
+    res = list->elements[i]->accept(*this);
+    if (res != NULL)
+        return res;
+  }
+  return NULL;
+}
+
+/* start off at the first parameter once again... */
+void function_param_iterator_c::reset(void) {
+  next_param = param_count = 0;
+  current_param_name = NULL;
+  current_param_type = current_param_default_value = NULL;
+  en_declared = false;
+  eno_declared = false;
+}
+
+/* initialise the iterator object.
+ * We must be given a reference to the function declaration
+ * that will be analysed...
+ */
+function_param_iterator_c::function_param_iterator_c(function_declaration_c *f_decl) {
+  this->f_decl = f_decl;
+  reset();
+}
+
+/* initialise the iterator object.
+ * We must be given a reference to the function block declaration
+ * that will be analysed...
+ */
+function_param_iterator_c::function_param_iterator_c(function_block_declaration_c *fb_decl) {
+  this->f_decl = fb_decl;
+  reset();
+}
+
+/* initialise the iterator object.
+ * We must be given a reference to the program declaration
+ * that will be analysed...
+ */
+function_param_iterator_c::function_param_iterator_c(program_declaration_c *p_decl) {
+  this->f_decl = p_decl;
+  reset();
+}
+
+/* Skip to the next parameter. After object creation,
+ * the object references on parameter _before_ the first, so
+ * this function must be called once to get the object to
+ * reference the first parameter...
+ *
+ * Returns the parameter's name!
+ */
+identifier_c *function_param_iterator_c::next(void) {
+  void *res;
+  identifier_c *identifier;
+  param_count = 0;
+  next_param++;
+  res = f_decl->accept(*this);
+  if (res != NULL) {
+    symbol_c *sym = (symbol_c *)res;
+    identifier = dynamic_cast<identifier_c *>(sym);
+    if (identifier == NULL)
+      ERROR;
+  }
+  else if (!en_declared) {
+    current_param_direction = direction_in;
+    identifier = declare_en_param();
+  }
+  else if (!eno_declared) {
+    current_param_direction = direction_out;
+    identifier = declare_eno_param();
+  }
+  else
+    return NULL;
+  
+  current_param_name = identifier;
+  return current_param_name;
+}
+
+identifier_c *function_param_iterator_c::declare_en_param(void) {
+  en_declared = true;
+  identifier_c *identifier = new identifier_c("EN");
+  current_param_type = (symbol_c*)(new bool_type_name_c());
+  current_param_default_value = (symbol_c*)(new boolean_literal_c(current_param_type, new boolean_true_c()));
+  return identifier;
+}
+
+identifier_c *function_param_iterator_c::declare_eno_param(void) {
+  eno_declared = true;
+  identifier_c *identifier = new identifier_c("ENO");
+  current_param_type = (symbol_c*)(new bool_type_name_c());
+  current_param_default_value = NULL;
+  return identifier;
+}
+
+/* Returns the currently referenced parameter's default value,
+ * or NULL if none is specified in the function declrataion itself.
+ */
+symbol_c *function_param_iterator_c::default_value(void) {
+  return current_param_default_value;
+}
+
+/* Returns the currently referenced parameter's type name. */
+symbol_c *function_param_iterator_c::param_type(void) {
+  return current_param_type;
+}
+
+/* Returns the currently referenced parameter's data passing direction.
+ * i.e. VAR_INPUT, VAR_OUTPUT or VAR_INOUT
+ */
+function_param_iterator_c::param_direction_t function_param_iterator_c::param_direction(void) {
+  return current_param_direction;
+}
+
+/****************************************/
+/* 1.4.3 - Declaration & Initialisation */
+/****************************************/
+void *function_param_iterator_c::visit(input_declarations_c *symbol) {
+  TRACE("input_declarations_c");
+  current_param_direction = direction_in;
+  return symbol->input_declaration_list->accept(*this);
+}
+
+void *function_param_iterator_c::visit(input_declaration_list_c *symbol) {TRACE("input_declaration_list_c"); return iterate_list(symbol);}
+
+void *function_param_iterator_c::visit(edge_declaration_c *symbol) {TRACE("edge_declaration_c"); return symbol->var1_list->accept(*this);}
+
+void *function_param_iterator_c::visit(en_param_declaration_c *symbol) {
+  TRACE("en_param_declaration_c");
+  if (en_declared) ERROR;
+  return (void *)declare_en_param();
+}
+
+/* var1_list ':' array_spec_init */
+//SYM_REF2(array_var_init_decl_c, var1_list, array_spec_init)
+void *function_param_iterator_c::visit(array_var_init_decl_c *symbol) {TRACE("array_var_init_decl_c"); return symbol->var1_list->accept(*this);}
+
+/*  var1_list ':' initialized_structure */
+//SYM_REF2(structured_var_init_decl_c, var1_list, initialized_structure)
+void *function_param_iterator_c::visit(structured_var_init_decl_c *symbol) {TRACE("structured_var_init_decl_c"); return symbol->var1_list->accept(*this);}
+
+void *function_param_iterator_c::visit(output_declarations_c *symbol) {
+  TRACE("output_declarations_c");
+  current_param_direction = direction_out;
+  return symbol->var_init_decl_list->accept(*this);
+}
+void *function_param_iterator_c::visit(eno_param_declaration_c *symbol) {
+  TRACE("eno_param_declaration_c");
+  if (eno_declared) ERROR;
+  return (void *)declare_eno_param();
+}
+void *function_param_iterator_c::visit(input_output_declarations_c *symbol) {
+  TRACE("input_output_declarations_c");
+  current_param_direction = direction_inout;
+  return symbol->var_declaration_list->accept(*this);
+}
+void *function_param_iterator_c::visit(var_declaration_list_c *symbol) {TRACE("var_declaration_list_c"); return iterate_list(symbol);}
+
+/*  var1_list ':' array_specification */
+//SYM_REF2(array_var_declaration_c, var1_list, array_specification)
+void *function_param_iterator_c::visit(array_var_declaration_c *symbol) {TRACE("array_var_declaration_c"); return symbol->var1_list->accept(*this);}
+
+/*  var1_list ':' structure_type_name */
+//SYM_REF2(structured_var_declaration_c, var1_list, structure_type_name)
+void *function_param_iterator_c::visit(structured_var_declaration_c *symbol) {TRACE("structured_var_declaration_c"); return symbol->var1_list->accept(*this);}
+
+/* VAR [CONSTANT] var_init_decl_list END_VAR */
+void *function_param_iterator_c::visit(var_declarations_c *symbol) {TRACE("var_declarations_c"); return NULL;}
+
+/*| VAR_EXTERNAL [CONSTANT] external_declaration_list END_VAR */
+/* option -> may be NULL ! */
+// SYM_REF2(external_var_declarations_c, option, external_declaration_list)
+void *function_param_iterator_c::visit(external_var_declarations_c *symbol) {
+  TRACE("external_var_declarations_c");
+  current_param_direction = direction_extref;
+  return symbol->external_declaration_list->accept(*this);
+}
+
+/* helper symbol for external_var_declarations */
+/*| external_declaration_list external_declaration';' */
+// SYM_LIST(external_declaration_list_c)
+void *function_param_iterator_c::visit(external_declaration_list_c *symbol) {TRACE("external_declaration_list_c"); return iterate_list(symbol);}
+
+/*  global_var_name ':' (simple_specification|subrange_specification|enumerated_specification|array_specification|prev_declared_structure_type_name|function_block_type_name */
+//SYM_REF2(external_declaration_c, global_var_name, specification)
+void *function_param_iterator_c::visit(external_declaration_c *symbol) {
+  TRACE("external_declaration_c");
+  /* It is OK to store these values in the current_param_XXX
+   * variables, because if the desired parameter is not in the
+   * variable list we will be analysing, the current_param_XXXX
+   * variables will get overwritten when we visit the next
+   * var1_init_decl_c list!
+   */
+  current_param_default_value = spec_init_sperator_c::get_init(symbol->specification);
+  current_param_type = spec_init_sperator_c::get_spec(symbol->specification);
+
+  return handle_single_param(symbol->global_var_name);
+}
+
+
+#if 0
+/*| VAR_GLOBAL [CONSTANT|RETAIN] global_var_decl_list END_VAR */
+/* option -> may be NULL ! */
+SYM_REF2(global_var_declarations_c, option, global_var_decl_list)
+
+/* helper symbol for global_var_declarations */
+/*| global_var_decl_list global_var_decl ';' */
+SYM_LIST(global_var_decl_list_c)
+
+/*| global_var_spec ':' [located_var_spec_init|function_block_type_name] */
+/* type_specification ->may be NULL ! */
+SYM_REF2(global_var_decl_c, global_var_spec, type_specification)
+
+/*| global_var_name location */
+SYM_REF2(global_var_spec_c, global_var_name, location)
+
+/*  AT direct_variable */
+SYM_REF2(location_c, direct_variable, unused)
+
+/*| global_var_list ',' global_var_name */
+SYM_LIST(global_var_list_c)
+
+/*  var1_list ':' single_byte_string_spec */
+SYM_REF2(single_byte_string_var_declaration_c, var1_list, single_byte_string_spec)
+
+/*  STRING ['[' integer ']'] [ASSIGN single_byte_character_string] */
+/* integer ->may be NULL ! */
+/* single_byte_character_string ->may be NULL ! */
+SYM_REF2(single_byte_string_spec_c, integer, single_byte_character_string)
+
+/*  var1_list ':' double_byte_string_spec */
+SYM_REF2(double_byte_string_var_declaration_c, var1_list, double_byte_string_spec)
+
+/*  WSTRING ['[' integer ']'] [ASSIGN double_byte_character_string] */
+/* integer ->may be NULL ! */
+/* double_byte_character_string ->may be NULL ! */
+SYM_REF2(double_byte_string_spec_c, integer, double_byte_character_string)
+
+/*| VAR [RETAIN|NON_RETAIN] incompl_located_var_decl_list END_VAR */
+/* option ->may be NULL ! */
+SYM_REF2(incompl_located_var_declarations_c, option, incompl_located_var_decl_list)
+
+/* helper symbol for incompl_located_var_declarations */
+/*| incompl_located_var_decl_list incompl_located_var_decl ';' */
+SYM_LIST(incompl_located_var_decl_list_c)
+
+/*  variable_name incompl_location ':' var_spec */
+SYM_REF4(incompl_located_var_decl_c, variable_name, incompl_location, var_spec, unused)
+
+/*  AT incompl_location_token */
+SYM_TOKEN(incompl_location_c)
+#endif
+
+
+void *function_param_iterator_c::visit(var1_init_decl_c *symbol) {
+  TRACE("var1_init_decl_c");
+  /* It is OK to store these values in the current_param_XXX
+   * variables, because if the desired parameter is not in the
+   * variable list we will be analysing, the current_param_XXXX
+   * variables will get overwritten when we visit the next
+   * var1_init_decl_c list!
+   */
+  current_param_default_value = spec_init_sperator_c::get_init(symbol->spec_init);
+  current_param_type = spec_init_sperator_c::get_spec(symbol->spec_init);
+
+  return symbol->var1_list->accept(*this);
+}
+
+
+
+void *function_param_iterator_c::visit(var1_list_c *symbol) {
+  TRACE("var1_list_c");
+  return handle_param_list(symbol);
+}
+
+void *function_param_iterator_c::visit(var_init_decl_list_c *symbol) {TRACE("var_init_decl_list_c"); return iterate_list(symbol);}
+
+
+/***********************/
+/* B 1.5.1 - Functions */
+/***********************/
+void *function_param_iterator_c::visit(function_declaration_c *symbol) {TRACE("function_declaration_c"); return symbol->var_declarations_list->accept(*this);}
+/* intermediate helper symbol for function_declaration */
+void *function_param_iterator_c::visit(var_declarations_list_c *symbol) {TRACE("var_declarations_list_c"); return iterate_list(symbol);}
+void *function_param_iterator_c::visit(function_var_decls_c *symbol) {TRACE("function_var_decls_c"); /* ignore */ return NULL;}
+
+
+/*****************************/
+/* B 1.5.2 - Function Blocks */
+/*****************************/
+/*  FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations function_block_body END_FUNCTION_BLOCK */
+void *function_param_iterator_c::visit(function_block_declaration_c *symbol) {TRACE("function_block_declaration_c"); return symbol->var_declarations->accept(*this);}
+
+/* intermediate helper symbol for function_declaration */
+/*  { io_var_declarations | other_var_declarations }   */
+/*
+ * NOTE: we re-use the var_declarations_list_c
+ */
+
+/*  VAR_TEMP temp_var_decl_list END_VAR */
+void *function_param_iterator_c::visit(temp_var_decls_c *symbol) {TRACE("temp_var_decls_c"); /* ignore */ return NULL;}
+void *function_param_iterator_c::visit(temp_var_decls_list_c *symbol) {TRACE("temp_var_decls_list_c"); /* ignore */ return NULL;}
+
+/*  VAR NON_RETAIN var_init_decl_list END_VAR */
+void *function_param_iterator_c::visit(non_retentive_var_decls_c *symbol) {TRACE("non_retentive_var_decls_c"); /* ignore */ return NULL;}
+
+
+/**********************/
+/* B 1.5.3 - Programs */
+/**********************/
+/*  PROGRAM program_type_name program_var_declarations_list function_block_body END_PROGRAM */
+// SYM_REF4(program_declaration_c, program_type_name, var_declarations, function_block_body, unused)
+void *function_param_iterator_c::visit(program_declaration_c *symbol) {TRACE("program_declaration_c"); return symbol->var_declarations->accept(*this);}
+
+/* intermediate helper symbol for program_declaration_c */
+/*  { io_var_declarations | other_var_declarations }   */
+/*
+ * NOTE: we re-use the var_declarations_list_c
+ */
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/function_param_iterator.hh	Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,322 @@
+/*
+ * (c) 2003 Mario de Sousa
+ *
+ * Offered to the public under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 IL and ST compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+
+/*
+ * Function parameter iterator.
+ * Iterate through the in/out parameters of a function declaration.
+ * Function blocks are also suported.
+ *
+ * This is part of the 4th stage that generates
+ * a c++ source program equivalent to the IL and ST
+ * code.
+ */
+
+/* Given a function_declaration_c, iterate through each
+ * function in/out/inout parameter, returning the name
+ * of each parameter...function_param_iterator_c
+ */
+
+
+#include "../absyntax/visitor.hh"
+
+
+class function_param_iterator_c : public null_visitor_c {
+  public:
+    /* A type to specify the type of parameter.
+     * VAR_INPUT => direction_in
+     * VAR_OUTPUT => direction_out
+     * VAR_IN_OUT => direction_inout
+     * VAR_EXTERNAL => direction_extref
+     *
+     * Note that VAR_EXTERNAL declares variables that are in reality references
+     * to global variables. This is used only inside programs!
+     * These references to external variables must be correctly initialised to refer
+     * to the correct global variable. Note that the user may define which variable is to be
+     * referenced in a CONFIGURATION, and that different instantiations of a program
+     * may have the same external variable reference diffenrent global variables!
+     * The references must therefore be correctly initialised when the program instance
+     * is created. This may be done by the PROGRAM class constructor since the ST and IL
+     * languages do not allow the VAR_EXTERNAL reference to change at runtime
+     * for a specific instance.
+     *
+     * We therefore need to call a PROGRAM class constructor with the variables
+     * that should be refernced by the VAR_EXTERNAL variables. The direction_extref will
+     * be used to identify these parameters!
+     */
+    typedef enum {direction_in, direction_out, direction_inout, direction_extref} param_direction_t ;
+
+
+  private:
+      /* a pointer to the function_block_declaration_c
+       * or function_declaration_c currently being analysed.
+       */
+    symbol_c *f_decl;
+    int next_param, param_count;
+    identifier_c *current_param_name;
+    symbol_c *current_param_type;
+    symbol_c *current_param_default_value;
+    param_direction_t current_param_direction;
+    bool en_declared;
+    bool eno_declared;
+
+  private:
+    void* handle_param_list(list_c *list);
+    void* handle_single_param(symbol_c *var_name);
+
+    void* iterate_list(list_c *list);
+
+  public:
+    /* start off at the first parameter once again... */
+    void reset(void);
+
+    /* initialise the iterator object.
+     * We must be given a reference to the function declaration
+     * that will be analysed...
+     */
+    function_param_iterator_c(function_declaration_c *f_decl);
+
+    /* initialise the iterator object.
+     * We must be given a reference to the function block declaration
+     * that will be analysed...
+     */
+    function_param_iterator_c(function_block_declaration_c *fb_decl);
+
+    /* initialise the iterator object.
+     * We must be given a reference to the program declaration
+     * that will be analysed...
+     */
+    function_param_iterator_c(program_declaration_c *p_decl);
+
+    /* Skip to the next parameter. After object creation,
+     * the object references on parameter _before_ the first, so
+     * this function must be called once to get the object to
+     * reference the first parameter...
+     *
+     * Returns the parameter's name!
+     */
+    identifier_c *next(void);
+
+    identifier_c *declare_en_param(void);
+
+    identifier_c *declare_eno_param(void);
+
+    /* Returns the currently referenced parameter's default value,
+     * or NULL if none is specified in the function declrataion itself.
+     */
+    symbol_c *default_value(void);
+
+    /* Returns the currently referenced parameter's type name. */
+    symbol_c *param_type(void);
+
+    /* Returns the currently referenced parameter's data passing direction.
+     * i.e. VAR_INPUT, VAR_OUTPUT or VAR_INOUT
+     */
+    param_direction_t param_direction(void);
+
+    private:
+    /******************************************/
+    /* B 1.4.3 - Declaration & Initialisation */
+    /******************************************/
+    void *visit(input_declarations_c *symbol);
+
+    void *visit(input_declaration_list_c *symbol);
+
+    void *visit(edge_declaration_c *symbol);
+    void *visit(en_param_declaration_c *symbol);
+    /* var1_list ':' array_spec_init */
+    //SYM_REF2(array_var_init_decl_c, var1_list, array_spec_init)
+    void *visit(array_var_init_decl_c *symbol);
+    
+    /*  var1_list ':' initialized_structure */
+    //SYM_REF2(structured_var_init_decl_c, var1_list, initialized_structure)
+    void *visit(structured_var_init_decl_c *symbol);
+    
+#if 0
+/* name_list ':' function_block_type_name ASSIGN structure_initialization */
+/* structure_initialization -> may be NULL ! */
+SYM_REF4(fb_name_decl_c, fb_name_list, function_block_type_name, structure_initialization, unused)
+
+/* name_list ',' fb_name */
+SYM_LIST(fb_name_list_c)
+#endif
+
+    void *visit(output_declarations_c *symbol);
+    void *visit(eno_param_declaration_c *symbol);
+    void *visit(input_output_declarations_c *symbol);
+    void *visit(var_declaration_list_c *symbol);
+
+
+    /*  var1_list ':' array_specification */
+    //SYM_REF2(array_var_declaration_c, var1_list, array_specification)
+    void *visit(array_var_declaration_c *symbol);
+
+    /*  var1_list ':' structure_type_name */
+    //SYM_REF2(structured_var_declaration_c, var1_list, structure_type_name)
+    void *visit(structured_var_declaration_c *symbol);
+
+    /* VAR [CONSTANT] var_init_decl_list END_VAR */
+    void *visit(var_declarations_c *symbol);
+
+#if 0
+/*  VAR RETAIN var_init_decl_list END_VAR */
+SYM_REF2(retentive_var_declarations_c, var_init_decl_list, unused)
+
+/*  VAR [CONSTANT|RETAIN|NON_RETAIN] located_var_decl_list END_VAR */
+/* option -> may be NULL ! */
+SYM_REF2(located_var_declarations_c, option, located_var_decl_list)
+
+/* helper symbol for located_var_declarations */
+/* located_var_decl_list located_var_decl ';' */
+SYM_LIST(located_var_decl_list_c)
+
+/*  [variable_name] location ':' located_var_spec_init */
+/* variable_name -> may be NULL ! */
+SYM_REF4(located_var_decl_c, variable_name, location, located_var_spec_init, unused)
+#endif
+
+    /*| VAR_EXTERNAL [CONSTANT] external_declaration_list END_VAR */
+    /* option -> may be NULL ! */
+    // SYM_REF2(external_var_declarations_c, option, external_declaration_list)
+    void *visit(external_var_declarations_c *symbol);
+
+    /* helper symbol for external_var_declarations */
+    /*| external_declaration_list external_declaration';' */
+    // SYM_LIST(external_declaration_list_c)
+    void *visit(external_declaration_list_c *symbol);
+
+    /*  global_var_name ':' (simple_specification|subrange_specification|enumerated_specification|array_specification|prev_declared_structure_type_name|function_block_type_name */
+    //SYM_REF2(external_declaration_c, global_var_name, specification)
+    void *visit(external_declaration_c *symbol);
+
+
+#if 0
+/*| VAR_GLOBAL [CONSTANT|RETAIN] global_var_decl_list END_VAR */
+/* option -> may be NULL ! */
+SYM_REF2(global_var_declarations_c, option, global_var_decl_list)
+
+/* helper symbol for global_var_declarations */
+/*| global_var_decl_list global_var_decl ';' */
+SYM_LIST(global_var_decl_list_c)
+
+/*| global_var_spec ':' [located_var_spec_init|function_block_type_name] */
+/* type_specification ->may be NULL ! */
+SYM_REF2(global_var_decl_c, global_var_spec, type_specification)
+
+/*| global_var_name location */
+SYM_REF2(global_var_spec_c, global_var_name, location)
+
+/*  AT direct_variable */
+SYM_REF2(location_c, direct_variable, unused)
+
+/*| global_var_list ',' global_var_name */
+SYM_LIST(global_var_list_c)
+
+/*  var1_list ':' single_byte_string_spec */
+SYM_REF2(single_byte_string_var_declaration_c, var1_list, single_byte_string_spec)
+
+/*  STRING ['[' integer ']'] [ASSIGN single_byte_character_string] */
+/* integer ->may be NULL ! */
+/* single_byte_character_string ->may be NULL ! */
+SYM_REF2(single_byte_string_spec_c, integer, single_byte_character_string)
+
+/*  var1_list ':' double_byte_string_spec */
+SYM_REF2(double_byte_string_var_declaration_c, var1_list, double_byte_string_spec)
+
+/*  WSTRING ['[' integer ']'] [ASSIGN double_byte_character_string] */
+/* integer ->may be NULL ! */
+/* double_byte_character_string ->may be NULL ! */
+SYM_REF2(double_byte_string_spec_c, integer, double_byte_character_string)
+
+/*| VAR [RETAIN|NON_RETAIN] incompl_located_var_decl_list END_VAR */
+/* option ->may be NULL ! */
+SYM_REF2(incompl_located_var_declarations_c, option, incompl_located_var_decl_list)
+
+/* helper symbol for incompl_located_var_declarations */
+/*| incompl_located_var_decl_list incompl_located_var_decl ';' */
+SYM_LIST(incompl_located_var_decl_list_c)
+
+/*  variable_name incompl_location ':' var_spec */
+SYM_REF4(incompl_located_var_decl_c, variable_name, incompl_location, var_spec, unused)
+
+/*  AT incompl_location_token */
+SYM_TOKEN(incompl_location_c)
+#endif
+
+
+    void *visit(var1_init_decl_c *symbol);
+    void *visit(var1_list_c *symbol);
+    void *visit(var_init_decl_list_c *symbol);
+
+
+    /***********************/
+    /* B 1.5.1 - Functions */
+    /***********************/
+    void *visit(function_declaration_c *symbol);
+    /* intermediate helper symbol for function_declaration */
+    void *visit(var_declarations_list_c *symbol);
+    void *visit(function_var_decls_c *symbol);
+
+
+    /*****************************/
+    /* B 1.5.2 - Function Blocks */
+    /*****************************/
+    /*  FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations function_block_body END_FUNCTION_BLOCK */
+    void *visit(function_block_declaration_c *symbol);
+
+    /* intermediate helper symbol for function_declaration */
+    /*  { io_var_declarations | other_var_declarations }   */
+    /*
+     * NOTE: we re-use the var_declarations_list_c
+     */
+
+    /*  VAR_TEMP temp_var_decl_list END_VAR */
+    void *visit(temp_var_decls_c *symbol);
+    void *visit(temp_var_decls_list_c *symbol);
+
+    /*  VAR NON_RETAIN var_init_decl_list END_VAR */
+    void *visit(non_retentive_var_decls_c *symbol);
+
+
+    /**********************/
+    /* B 1.5.3 - Programs */
+    /**********************/
+    /*  PROGRAM program_type_name program_var_declarations_list function_block_body END_PROGRAM */
+    // SYM_REF4(program_declaration_c, program_type_name, var_declarations, function_block_body, unused)
+    void *visit(program_declaration_c *symbol);
+
+    /* intermediate helper symbol for program_declaration_c */
+    /*  { io_var_declarations | other_var_declarations }   */
+    /*
+     * NOTE: we re-use the var_declarations_list_c
+     */
+
+}; // function_param_iterator_c
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/function_type_decl.h	Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,454 @@
+/*
+ * (c) 2008 Edouard TISSERANT
+ *
+ * Offered to the public under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 IL and ST compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+/****
+ * IEC 61131-3 standard function library
+ * generated code, do not edit by hand
+ */
+ 
+ 
+typedef enum {
+    function_real_to_sint,
+    function_real_to_lint,
+    function_real_to_dint,
+    function_real_to_date,
+    function_real_to_dword,
+    function_real_to_dt,
+    function_real_to_tod,
+    function_real_to_udint,
+    function_real_to_word,
+    function_real_to_string,
+    function_real_to_lword,
+    function_real_to_uint,
+    function_real_to_lreal,
+    function_real_to_byte,
+    function_real_to_usint,
+    function_real_to_ulint,
+    function_real_to_bool,
+    function_real_to_time,
+    function_real_to_int,
+    function_sint_to_real,
+    function_sint_to_lint,
+    function_sint_to_dint,
+    function_sint_to_date,
+    function_sint_to_dword,
+    function_sint_to_dt,
+    function_sint_to_tod,
+    function_sint_to_udint,
+    function_sint_to_word,
+    function_sint_to_string,
+    function_sint_to_lword,
+    function_sint_to_uint,
+    function_sint_to_lreal,
+    function_sint_to_byte,
+    function_sint_to_usint,
+    function_sint_to_ulint,
+    function_sint_to_bool,
+    function_sint_to_time,
+    function_sint_to_int,
+    function_lint_to_real,
+    function_lint_to_sint,
+    function_lint_to_dint,
+    function_lint_to_date,
+    function_lint_to_dword,
+    function_lint_to_dt,
+    function_lint_to_tod,
+    function_lint_to_udint,
+    function_lint_to_word,
+    function_lint_to_string,
+    function_lint_to_lword,
+    function_lint_to_uint,
+    function_lint_to_lreal,
+    function_lint_to_byte,
+    function_lint_to_usint,
+    function_lint_to_ulint,
+    function_lint_to_bool,
+    function_lint_to_time,
+    function_lint_to_int,
+    function_dint_to_real,
+    function_dint_to_sint,
+    function_dint_to_lint,
+    function_dint_to_date,
+    function_dint_to_dword,
+    function_dint_to_dt,
+    function_dint_to_tod,
+    function_dint_to_udint,
+    function_dint_to_word,
+    function_dint_to_string,
+    function_dint_to_lword,
+    function_dint_to_uint,
+    function_dint_to_lreal,
+    function_dint_to_byte,
+    function_dint_to_usint,
+    function_dint_to_ulint,
+    function_dint_to_bool,
+    function_dint_to_time,
+    function_dint_to_int,
+    function_date_to_real,
+    function_date_to_sint,
+    function_date_to_lint,
+    function_date_to_dint,
+    function_date_to_dword,
+    function_date_to_udint,
+    function_date_to_word,
+    function_date_to_string,
+    function_date_to_lword,
+    function_date_to_uint,
+    function_date_to_lreal,
+    function_date_to_byte,
+    function_date_to_usint,
+    function_date_to_ulint,
+    function_date_to_int,
+    function_dword_to_real,
+    function_dword_to_sint,
+    function_dword_to_lint,
+    function_dword_to_dint,
+    function_dword_to_date,
+    function_dword_to_dt,
+    function_dword_to_tod,
+    function_dword_to_udint,
+    function_dword_to_word,
+    function_dword_to_string,
+    function_dword_to_lword,
+    function_dword_to_uint,
+    function_dword_to_lreal,
+    function_dword_to_byte,
+    function_dword_to_usint,
+    function_dword_to_ulint,
+    function_dword_to_bool,
+    function_dword_to_time,
+    function_dword_to_int,
+    function_dt_to_real,
+    function_dt_to_sint,
+    function_dt_to_lint,
+    function_dt_to_dint,
+    function_dt_to_dword,
+    function_dt_to_udint,
+    function_dt_to_word,
+    function_dt_to_string,
+    function_dt_to_lword,
+    function_dt_to_uint,
+    function_dt_to_lreal,
+    function_dt_to_byte,
+    function_dt_to_usint,
+    function_dt_to_ulint,
+    function_dt_to_int,
+    function_tod_to_real,
+    function_tod_to_sint,
+    function_tod_to_lint,
+    function_tod_to_dint,
+    function_tod_to_dword,
+    function_tod_to_udint,
+    function_tod_to_word,
+    function_tod_to_string,
+    function_tod_to_lword,
+    function_tod_to_uint,
+    function_tod_to_lreal,
+    function_tod_to_byte,
+    function_tod_to_usint,
+    function_tod_to_ulint,
+    function_tod_to_int,
+    function_udint_to_real,
+    function_udint_to_sint,
+    function_udint_to_lint,
+    function_udint_to_dint,
+    function_udint_to_date,
+    function_udint_to_dword,
+    function_udint_to_dt,
+    function_udint_to_tod,
+    function_udint_to_word,
+    function_udint_to_string,
+    function_udint_to_lword,
+    function_udint_to_uint,
+    function_udint_to_lreal,
+    function_udint_to_byte,
+    function_udint_to_usint,
+    function_udint_to_ulint,
+    function_udint_to_bool,
+    function_udint_to_time,
+    function_udint_to_int,
+    function_word_to_real,
+    function_word_to_sint,
+    function_word_to_lint,
+    function_word_to_dint,
+    function_word_to_date,
+    function_word_to_dword,
+    function_word_to_dt,
+    function_word_to_tod,
+    function_word_to_udint,
+    function_word_to_string,
+    function_word_to_lword,
+    function_word_to_uint,
+    function_word_to_lreal,
+    function_word_to_byte,
+    function_word_to_usint,
+    function_word_to_ulint,
+    function_word_to_bool,
+    function_word_to_time,
+    function_word_to_int,
+    function_string_to_real,
+    function_string_to_sint,
+    function_string_to_lint,
+    function_string_to_dint,
+    function_string_to_date,
+    function_string_to_dword,
+    function_string_to_dt,
+    function_string_to_tod,
+    function_string_to_udint,
+    function_string_to_word,
+    function_string_to_lword,
+    function_string_to_uint,
+    function_string_to_lreal,
+    function_string_to_byte,
+    function_string_to_usint,
+    function_string_to_ulint,
+    function_string_to_bool,
+    function_string_to_time,
+    function_string_to_int,
+    function_lword_to_real,
+    function_lword_to_sint,
+    function_lword_to_lint,
+    function_lword_to_dint,
+    function_lword_to_date,
+    function_lword_to_dword,
+    function_lword_to_dt,
+    function_lword_to_tod,
+    function_lword_to_udint,
+    function_lword_to_word,
+    function_lword_to_string,
+    function_lword_to_uint,
+    function_lword_to_lreal,
+    function_lword_to_byte,
+    function_lword_to_usint,
+    function_lword_to_ulint,
+    function_lword_to_bool,
+    function_lword_to_time,
+    function_lword_to_int,
+    function_uint_to_real,
+    function_uint_to_sint,
+    function_uint_to_lint,
+    function_uint_to_dint,
+    function_uint_to_date,
+    function_uint_to_dword,
+    function_uint_to_dt,
+    function_uint_to_tod,
+    function_uint_to_udint,
+    function_uint_to_word,
+    function_uint_to_string,
+    function_uint_to_lword,
+    function_uint_to_lreal,
+    function_uint_to_byte,
+    function_uint_to_usint,
+    function_uint_to_ulint,
+    function_uint_to_bool,
+    function_uint_to_time,
+    function_uint_to_int,
+    function_lreal_to_real,
+    function_lreal_to_sint,
+    function_lreal_to_lint,
+    function_lreal_to_dint,
+    function_lreal_to_date,
+    function_lreal_to_dword,
+    function_lreal_to_dt,
+    function_lreal_to_tod,
+    function_lreal_to_udint,
+    function_lreal_to_word,
+    function_lreal_to_string,
+    function_lreal_to_lword,
+    function_lreal_to_uint,
+    function_lreal_to_byte,
+    function_lreal_to_usint,
+    function_lreal_to_ulint,
+    function_lreal_to_bool,
+    function_lreal_to_time,
+    function_lreal_to_int,
+    function_byte_to_real,
+    function_byte_to_sint,
+    function_byte_to_lint,
+    function_byte_to_dint,
+    function_byte_to_date,
+    function_byte_to_dword,
+    function_byte_to_dt,
+    function_byte_to_tod,
+    function_byte_to_udint,
+    function_byte_to_word,
+    function_byte_to_string,
+    function_byte_to_lword,
+    function_byte_to_uint,
+    function_byte_to_lreal,
+    function_byte_to_usint,
+    function_byte_to_ulint,
+    function_byte_to_bool,
+    function_byte_to_time,
+    function_byte_to_int,
+    function_usint_to_real,
+    function_usint_to_sint,
+    function_usint_to_lint,
+    function_usint_to_dint,
+    function_usint_to_date,
+    function_usint_to_dword,
+    function_usint_to_dt,
+    function_usint_to_tod,
+    function_usint_to_udint,
+    function_usint_to_word,
+    function_usint_to_string,
+    function_usint_to_lword,
+    function_usint_to_uint,
+    function_usint_to_lreal,
+    function_usint_to_byte,
+    function_usint_to_ulint,
+    function_usint_to_bool,
+    function_usint_to_time,
+    function_usint_to_int,
+    function_ulint_to_real,
+    function_ulint_to_sint,
+    function_ulint_to_lint,
+    function_ulint_to_dint,
+    function_ulint_to_date,
+    function_ulint_to_dword,
+    function_ulint_to_dt,
+    function_ulint_to_tod,
+    function_ulint_to_udint,
+    function_ulint_to_word,
+    function_ulint_to_string,
+    function_ulint_to_lword,
+    function_ulint_to_uint,
+    function_ulint_to_lreal,
+    function_ulint_to_byte,
+    function_ulint_to_usint,
+    function_ulint_to_bool,
+    function_ulint_to_time,
+    function_ulint_to_int,
+    function_bool_to_real,
+    function_bool_to_sint,
+    function_bool_to_lint,
+    function_bool_to_dint,
+    function_bool_to_date,
+    function_bool_to_dword,
+    function_bool_to_dt,
+    function_bool_to_tod,
+    function_bool_to_udint,
+    function_bool_to_word,
+    function_bool_to_string,
+    function_bool_to_lword,
+    function_bool_to_uint,
+    function_bool_to_lreal,
+    function_bool_to_byte,
+    function_bool_to_usint,
+    function_bool_to_ulint,
+    function_bool_to_time,
+    function_bool_to_int,
+    function_time_to_real,
+    function_time_to_sint,
+    function_time_to_lint,
+    function_time_to_dint,
+    function_time_to_dword,
+    function_time_to_udint,
+    function_time_to_word,
+    function_time_to_string,
+    function_time_to_lword,
+    function_time_to_uint,
+    function_time_to_lreal,
+    function_time_to_byte,
+    function_time_to_usint,
+    function_time_to_ulint,
+    function_time_to_int,
+    function_int_to_real,
+    function_int_to_sint,
+    function_int_to_lint,
+    function_int_to_dint,
+    function_int_to_date,
+    function_int_to_dword,
+    function_int_to_dt,
+    function_int_to_tod,
+    function_int_to_udint,
+    function_int_to_word,
+    function_int_to_string,
+    function_int_to_lword,
+    function_int_to_uint,
+    function_int_to_lreal,
+    function_int_to_byte,
+    function_int_to_usint,
+    function_int_to_ulint,
+    function_int_to_bool,
+    function_int_to_time,
+    function_trunc,
+    function_bcd_to_udint,
+    function_bcd_to_uint,
+    function_bcd_to_ulint,
+    function_bcd_to_usint,
+    function_udint_to_bcd,
+    function_uint_to_bcd,
+    function_usint_to_bcd,
+    function_ulint_to_bcd,
+    function_date_and_time_to_time_of_day,
+    function_date_and_time_to_date,
+    function_abs,
+    function_sqrt,
+    function_ln,
+    function_log,
+    function_exp,
+    function_sin,
+    function_cos,
+    function_tan,
+    function_asin,
+    function_acos,
+    function_atan,
+    function_add,
+    function_mul,
+    function_sub,
+    function_div,
+    function_mod,
+    function_expt,
+    function_move,
+    function_shl,
+    function_shr,
+    function_ror,
+    function_rol,
+    function_and,
+    function_or,
+    function_xor,
+    function_not,
+    function_sel,
+    function_max,
+    function_min,
+    function_limit,
+    function_mux,
+    function_gt,
+    function_ge,
+    function_eq,
+    function_lt,
+    function_le,
+    function_ne,
+    function_len,
+    function_left,
+    function_right,
+    function_mid,
+    function_concat,
+    function_insert,
+    function_delete,
+    function_replace,
+    function_find,
+    function_none
+} function_type_t;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/get_function_type.cc	Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,31 @@
+/*
+ * (c) 2008 Edouard TISSERANT
+ *
+ * Offered to the public under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 IL and ST compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+
+#include "../absyntax/absyntax.hh"
+#include "function_type_decl.h"
+#include <strings.h>
+
+
+#include "get_function_type_decl.c"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/get_function_type.h	Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,28 @@
+/*
+ * (c) 2008 Edouard TISSERANT
+ *
+ * Offered to the public under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 IL and ST compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+#include "function_type_decl.h"
+
+function_type_t get_function_type(identifier_c *function_name);
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/get_function_type_decl.c	Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,1298 @@
+/*
+ * (c) 2008 Edouard TISSERANT
+ *
+ * Offered to the public under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 IL and ST compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+/****
+ * IEC 61131-3 standard function library
+ * generated code, do not edit by hand
+ */
+
+
+function_type_t get_function_type(identifier_c *function_name) {
+
+if (!strcasecmp(function_name->value, "REAL_TO_SINT"))
+    return function_real_to_sint;
+
+if (!strcasecmp(function_name->value, "REAL_TO_LINT"))
+    return function_real_to_lint;
+
+if (!strcasecmp(function_name->value, "REAL_TO_DINT"))
+    return function_real_to_dint;
+
+if (!strcasecmp(function_name->value, "REAL_TO_DATE"))
+    return function_real_to_date;
+
+if (!strcasecmp(function_name->value, "REAL_TO_DWORD"))
+    return function_real_to_dword;
+
+if (!strcasecmp(function_name->value, "REAL_TO_DT"))
+    return function_real_to_dt;
+
+if (!strcasecmp(function_name->value, "REAL_TO_TOD"))
+    return function_real_to_tod;
+
+if (!strcasecmp(function_name->value, "REAL_TO_UDINT"))
+    return function_real_to_udint;
+
+if (!strcasecmp(function_name->value, "REAL_TO_WORD"))
+    return function_real_to_word;
+
+if (!strcasecmp(function_name->value, "REAL_TO_STRING"))
+    return function_real_to_string;
+
+if (!strcasecmp(function_name->value, "REAL_TO_LWORD"))
+    return function_real_to_lword;
+
+if (!strcasecmp(function_name->value, "REAL_TO_UINT"))
+    return function_real_to_uint;
+
+if (!strcasecmp(function_name->value, "REAL_TO_LREAL"))
+    return function_real_to_lreal;
+
+if (!strcasecmp(function_name->value, "REAL_TO_BYTE"))
+    return function_real_to_byte;
+
+if (!strcasecmp(function_name->value, "REAL_TO_USINT"))
+    return function_real_to_usint;
+
+if (!strcasecmp(function_name->value, "REAL_TO_ULINT"))
+    return function_real_to_ulint;
+
+if (!strcasecmp(function_name->value, "REAL_TO_BOOL"))
+    return function_real_to_bool;
+
+if (!strcasecmp(function_name->value, "REAL_TO_TIME"))
+    return function_real_to_time;
+
+if (!strcasecmp(function_name->value, "REAL_TO_INT"))
+    return function_real_to_int;
+
+if (!strcasecmp(function_name->value, "SINT_TO_REAL"))
+    return function_sint_to_real;
+
+if (!strcasecmp(function_name->value, "SINT_TO_LINT"))
+    return function_sint_to_lint;
+
+if (!strcasecmp(function_name->value, "SINT_TO_DINT"))
+    return function_sint_to_dint;
+
+if (!strcasecmp(function_name->value, "SINT_TO_DATE"))
+    return function_sint_to_date;
+
+if (!strcasecmp(function_name->value, "SINT_TO_DWORD"))
+    return function_sint_to_dword;
+
+if (!strcasecmp(function_name->value, "SINT_TO_DT"))
+    return function_sint_to_dt;
+
+if (!strcasecmp(function_name->value, "SINT_TO_TOD"))
+    return function_sint_to_tod;
+
+if (!strcasecmp(function_name->value, "SINT_TO_UDINT"))
+    return function_sint_to_udint;
+
+if (!strcasecmp(function_name->value, "SINT_TO_WORD"))
+    return function_sint_to_word;
+
+if (!strcasecmp(function_name->value, "SINT_TO_STRING"))
+    return function_sint_to_string;
+
+if (!strcasecmp(function_name->value, "SINT_TO_LWORD"))
+    return function_sint_to_lword;
+
+if (!strcasecmp(function_name->value, "SINT_TO_UINT"))
+    return function_sint_to_uint;
+
+if (!strcasecmp(function_name->value, "SINT_TO_LREAL"))
+    return function_sint_to_lreal;
+
+if (!strcasecmp(function_name->value, "SINT_TO_BYTE"))
+    return function_sint_to_byte;
+
+if (!strcasecmp(function_name->value, "SINT_TO_USINT"))
+    return function_sint_to_usint;
+
+if (!strcasecmp(function_name->value, "SINT_TO_ULINT"))
+    return function_sint_to_ulint;
+
+if (!strcasecmp(function_name->value, "SINT_TO_BOOL"))
+    return function_sint_to_bool;
+
+if (!strcasecmp(function_name->value, "SINT_TO_TIME"))
+    return function_sint_to_time;
+
+if (!strcasecmp(function_name->value, "SINT_TO_INT"))
+    return function_sint_to_int;
+
+if (!strcasecmp(function_name->value, "LINT_TO_REAL"))
+    return function_lint_to_real;
+
+if (!strcasecmp(function_name->value, "LINT_TO_SINT"))
+    return function_lint_to_sint;
+
+if (!strcasecmp(function_name->value, "LINT_TO_DINT"))
+    return function_lint_to_dint;
+
+if (!strcasecmp(function_name->value, "LINT_TO_DATE"))
+    return function_lint_to_date;
+
+if (!strcasecmp(function_name->value, "LINT_TO_DWORD"))
+    return function_lint_to_dword;
+
+if (!strcasecmp(function_name->value, "LINT_TO_DT"))
+    return function_lint_to_dt;
+
+if (!strcasecmp(function_name->value, "LINT_TO_TOD"))
+    return function_lint_to_tod;
+
+if (!strcasecmp(function_name->value, "LINT_TO_UDINT"))
+    return function_lint_to_udint;
+
+if (!strcasecmp(function_name->value, "LINT_TO_WORD"))
+    return function_lint_to_word;
+
+if (!strcasecmp(function_name->value, "LINT_TO_STRING"))
+    return function_lint_to_string;
+
+if (!strcasecmp(function_name->value, "LINT_TO_LWORD"))
+    return function_lint_to_lword;
+
+if (!strcasecmp(function_name->value, "LINT_TO_UINT"))
+    return function_lint_to_uint;
+
+if (!strcasecmp(function_name->value, "LINT_TO_LREAL"))
+    return function_lint_to_lreal;
+
+if (!strcasecmp(function_name->value, "LINT_TO_BYTE"))
+    return function_lint_to_byte;
+
+if (!strcasecmp(function_name->value, "LINT_TO_USINT"))
+    return function_lint_to_usint;
+
+if (!strcasecmp(function_name->value, "LINT_TO_ULINT"))
+    return function_lint_to_ulint;
+
+if (!strcasecmp(function_name->value, "LINT_TO_BOOL"))
+    return function_lint_to_bool;
+
+if (!strcasecmp(function_name->value, "LINT_TO_TIME"))
+    return function_lint_to_time;
+
+if (!strcasecmp(function_name->value, "LINT_TO_INT"))
+    return function_lint_to_int;
+
+if (!strcasecmp(function_name->value, "DINT_TO_REAL"))
+    return function_dint_to_real;
+
+if (!strcasecmp(function_name->value, "DINT_TO_SINT"))
+    return function_dint_to_sint;
+
+if (!strcasecmp(function_name->value, "DINT_TO_LINT"))
+    return function_dint_to_lint;
+
+if (!strcasecmp(function_name->value, "DINT_TO_DATE"))
+    return function_dint_to_date;
+
+if (!strcasecmp(function_name->value, "DINT_TO_DWORD"))
+    return function_dint_to_dword;
+
+if (!strcasecmp(function_name->value, "DINT_TO_DT"))
+    return function_dint_to_dt;
+
+if (!strcasecmp(function_name->value, "DINT_TO_TOD"))
+    return function_dint_to_tod;
+
+if (!strcasecmp(function_name->value, "DINT_TO_UDINT"))
+    return function_dint_to_udint;
+
+if (!strcasecmp(function_name->value, "DINT_TO_WORD"))
+    return function_dint_to_word;
+
+if (!strcasecmp(function_name->value, "DINT_TO_STRING"))
+    return function_dint_to_string;
+
+if (!strcasecmp(function_name->value, "DINT_TO_LWORD"))
+    return function_dint_to_lword;
+
+if (!strcasecmp(function_name->value, "DINT_TO_UINT"))
+    return function_dint_to_uint;
+
+if (!strcasecmp(function_name->value, "DINT_TO_LREAL"))
+    return function_dint_to_lreal;
+
+if (!strcasecmp(function_name->value, "DINT_TO_BYTE"))
+    return function_dint_to_byte;
+
+if (!strcasecmp(function_name->value, "DINT_TO_USINT"))
+    return function_dint_to_usint;
+
+if (!strcasecmp(function_name->value, "DINT_TO_ULINT"))
+    return function_dint_to_ulint;
+
+if (!strcasecmp(function_name->value, "DINT_TO_BOOL"))
+    return function_dint_to_bool;
+
+if (!strcasecmp(function_name->value, "DINT_TO_TIME"))
+    return function_dint_to_time;
+
+if (!strcasecmp(function_name->value, "DINT_TO_INT"))
+    return function_dint_to_int;
+
+if (!strcasecmp(function_name->value, "DATE_TO_REAL"))
+    return function_date_to_real;
+
+if (!strcasecmp(function_name->value, "DATE_TO_SINT"))
+    return function_date_to_sint;
+
+if (!strcasecmp(function_name->value, "DATE_TO_LINT"))
+    return function_date_to_lint;
+
+if (!strcasecmp(function_name->value, "DATE_TO_DINT"))
+    return function_date_to_dint;
+
+if (!strcasecmp(function_name->value, "DATE_TO_DWORD"))
+    return function_date_to_dword;
+
+if (!strcasecmp(function_name->value, "DATE_TO_UDINT"))
+    return function_date_to_udint;
+
+if (!strcasecmp(function_name->value, "DATE_TO_WORD"))
+    return function_date_to_word;
+
+if (!strcasecmp(function_name->value, "DATE_TO_STRING"))
+    return function_date_to_string;
+
+if (!strcasecmp(function_name->value, "DATE_TO_LWORD"))
+    return function_date_to_lword;
+
+if (!strcasecmp(function_name->value, "DATE_TO_UINT"))
+    return function_date_to_uint;
+
+if (!strcasecmp(function_name->value, "DATE_TO_LREAL"))
+    return function_date_to_lreal;
+
+if (!strcasecmp(function_name->value, "DATE_TO_BYTE"))
+    return function_date_to_byte;
+
+if (!strcasecmp(function_name->value, "DATE_TO_USINT"))
+    return function_date_to_usint;
+
+if (!strcasecmp(function_name->value, "DATE_TO_ULINT"))
+    return function_date_to_ulint;
+
+if (!strcasecmp(function_name->value, "DATE_TO_INT"))
+    return function_date_to_int;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_REAL"))
+    return function_dword_to_real;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_SINT"))
+    return function_dword_to_sint;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_LINT"))
+    return function_dword_to_lint;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_DINT"))
+    return function_dword_to_dint;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_DATE"))
+    return function_dword_to_date;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_DT"))
+    return function_dword_to_dt;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_TOD"))
+    return function_dword_to_tod;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_UDINT"))
+    return function_dword_to_udint;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_WORD"))
+    return function_dword_to_word;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_STRING"))
+    return function_dword_to_string;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_LWORD"))
+    return function_dword_to_lword;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_UINT"))
+    return function_dword_to_uint;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_LREAL"))
+    return function_dword_to_lreal;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_BYTE"))
+    return function_dword_to_byte;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_USINT"))
+    return function_dword_to_usint;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_ULINT"))
+    return function_dword_to_ulint;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_BOOL"))
+    return function_dword_to_bool;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_TIME"))
+    return function_dword_to_time;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_INT"))
+    return function_dword_to_int;
+
+if (!strcasecmp(function_name->value, "DT_TO_REAL"))
+    return function_dt_to_real;
+
+if (!strcasecmp(function_name->value, "DT_TO_SINT"))
+    return function_dt_to_sint;
+
+if (!strcasecmp(function_name->value, "DT_TO_LINT"))
+    return function_dt_to_lint;
+
+if (!strcasecmp(function_name->value, "DT_TO_DINT"))
+    return function_dt_to_dint;
+
+if (!strcasecmp(function_name->value, "DT_TO_DWORD"))
+    return function_dt_to_dword;
+
+if (!strcasecmp(function_name->value, "DT_TO_UDINT"))
+    return function_dt_to_udint;
+
+if (!strcasecmp(function_name->value, "DT_TO_WORD"))
+    return function_dt_to_word;
+
+if (!strcasecmp(function_name->value, "DT_TO_STRING"))
+    return function_dt_to_string;
+
+if (!strcasecmp(function_name->value, "DT_TO_LWORD"))
+    return function_dt_to_lword;
+
+if (!strcasecmp(function_name->value, "DT_TO_UINT"))
+    return function_dt_to_uint;
+
+if (!strcasecmp(function_name->value, "DT_TO_LREAL"))
+    return function_dt_to_lreal;
+
+if (!strcasecmp(function_name->value, "DT_TO_BYTE"))
+    return function_dt_to_byte;
+
+if (!strcasecmp(function_name->value, "DT_TO_USINT"))
+    return function_dt_to_usint;
+
+if (!strcasecmp(function_name->value, "DT_TO_ULINT"))
+    return function_dt_to_ulint;
+
+if (!strcasecmp(function_name->value, "DT_TO_INT"))
+    return function_dt_to_int;
+
+if (!strcasecmp(function_name->value, "TOD_TO_REAL"))
+    return function_tod_to_real;
+
+if (!strcasecmp(function_name->value, "TOD_TO_SINT"))
+    return function_tod_to_sint;
+
+if (!strcasecmp(function_name->value, "TOD_TO_LINT"))
+    return function_tod_to_lint;
+
+if (!strcasecmp(function_name->value, "TOD_TO_DINT"))
+    return function_tod_to_dint;
+
+if (!strcasecmp(function_name->value, "TOD_TO_DWORD"))
+    return function_tod_to_dword;
+
+if (!strcasecmp(function_name->value, "TOD_TO_UDINT"))
+    return function_tod_to_udint;
+
+if (!strcasecmp(function_name->value, "TOD_TO_WORD"))
+    return function_tod_to_word;
+
+if (!strcasecmp(function_name->value, "TOD_TO_STRING"))
+    return function_tod_to_string;
+
+if (!strcasecmp(function_name->value, "TOD_TO_LWORD"))
+    return function_tod_to_lword;
+
+if (!strcasecmp(function_name->value, "TOD_TO_UINT"))
+    return function_tod_to_uint;
+
+if (!strcasecmp(function_name->value, "TOD_TO_LREAL"))
+    return function_tod_to_lreal;
+
+if (!strcasecmp(function_name->value, "TOD_TO_BYTE"))
+    return function_tod_to_byte;
+
+if (!strcasecmp(function_name->value, "TOD_TO_USINT"))
+    return function_tod_to_usint;
+
+if (!strcasecmp(function_name->value, "TOD_TO_ULINT"))
+    return function_tod_to_ulint;
+
+if (!strcasecmp(function_name->value, "TOD_TO_INT"))
+    return function_tod_to_int;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_REAL"))
+    return function_udint_to_real;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_SINT"))
+    return function_udint_to_sint;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_LINT"))
+    return function_udint_to_lint;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_DINT"))
+    return function_udint_to_dint;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_DATE"))
+    return function_udint_to_date;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_DWORD"))
+    return function_udint_to_dword;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_DT"))
+    return function_udint_to_dt;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_TOD"))
+    return function_udint_to_tod;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_WORD"))
+    return function_udint_to_word;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_STRING"))
+    return function_udint_to_string;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_LWORD"))
+    return function_udint_to_lword;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_UINT"))
+    return function_udint_to_uint;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_LREAL"))
+    return function_udint_to_lreal;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_BYTE"))
+    return function_udint_to_byte;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_USINT"))
+    return function_udint_to_usint;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_ULINT"))
+    return function_udint_to_ulint;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_BOOL"))
+    return function_udint_to_bool;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_TIME"))
+    return function_udint_to_time;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_INT"))
+    return function_udint_to_int;
+
+if (!strcasecmp(function_name->value, "WORD_TO_REAL"))
+    return function_word_to_real;
+
+if (!strcasecmp(function_name->value, "WORD_TO_SINT"))
+    return function_word_to_sint;
+
+if (!strcasecmp(function_name->value, "WORD_TO_LINT"))
+    return function_word_to_lint;
+
+if (!strcasecmp(function_name->value, "WORD_TO_DINT"))
+    return function_word_to_dint;
+
+if (!strcasecmp(function_name->value, "WORD_TO_DATE"))
+    return function_word_to_date;
+
+if (!strcasecmp(function_name->value, "WORD_TO_DWORD"))
+    return function_word_to_dword;
+
+if (!strcasecmp(function_name->value, "WORD_TO_DT"))
+    return function_word_to_dt;
+
+if (!strcasecmp(function_name->value, "WORD_TO_TOD"))
+    return function_word_to_tod;
+
+if (!strcasecmp(function_name->value, "WORD_TO_UDINT"))
+    return function_word_to_udint;
+
+if (!strcasecmp(function_name->value, "WORD_TO_STRING"))
+    return function_word_to_string;
+
+if (!strcasecmp(function_name->value, "WORD_TO_LWORD"))
+    return function_word_to_lword;
+
+if (!strcasecmp(function_name->value, "WORD_TO_UINT"))
+    return function_word_to_uint;
+
+if (!strcasecmp(function_name->value, "WORD_TO_LREAL"))
+    return function_word_to_lreal;
+
+if (!strcasecmp(function_name->value, "WORD_TO_BYTE"))
+    return function_word_to_byte;
+
+if (!strcasecmp(function_name->value, "WORD_TO_USINT"))
+    return function_word_to_usint;
+
+if (!strcasecmp(function_name->value, "WORD_TO_ULINT"))
+    return function_word_to_ulint;
+
+if (!strcasecmp(function_name->value, "WORD_TO_BOOL"))
+    return function_word_to_bool;
+
+if (!strcasecmp(function_name->value, "WORD_TO_TIME"))
+    return function_word_to_time;
+
+if (!strcasecmp(function_name->value, "WORD_TO_INT"))
+    return function_word_to_int;
+
+if (!strcasecmp(function_name->value, "STRING_TO_REAL"))
+    return function_string_to_real;
+
+if (!strcasecmp(function_name->value, "STRING_TO_SINT"))
+    return function_string_to_sint;
+
+if (!strcasecmp(function_name->value, "STRING_TO_LINT"))
+    return function_string_to_lint;
+
+if (!strcasecmp(function_name->value, "STRING_TO_DINT"))
+    return function_string_to_dint;
+
+if (!strcasecmp(function_name->value, "STRING_TO_DATE"))
+    return function_string_to_date;
+
+if (!strcasecmp(function_name->value, "STRING_TO_DWORD"))
+    return function_string_to_dword;
+
+if (!strcasecmp(function_name->value, "STRING_TO_DT"))
+    return function_string_to_dt;
+
+if (!strcasecmp(function_name->value, "STRING_TO_TOD"))
+    return function_string_to_tod;
+
+if (!strcasecmp(function_name->value, "STRING_TO_UDINT"))
+    return function_string_to_udint;
+
+if (!strcasecmp(function_name->value, "STRING_TO_WORD"))
+    return function_string_to_word;
+
+if (!strcasecmp(function_name->value, "STRING_TO_LWORD"))
+    return function_string_to_lword;
+
+if (!strcasecmp(function_name->value, "STRING_TO_UINT"))
+    return function_string_to_uint;
+
+if (!strcasecmp(function_name->value, "STRING_TO_LREAL"))
+    return function_string_to_lreal;
+
+if (!strcasecmp(function_name->value, "STRING_TO_BYTE"))
+    return function_string_to_byte;
+
+if (!strcasecmp(function_name->value, "STRING_TO_USINT"))
+    return function_string_to_usint;
+
+if (!strcasecmp(function_name->value, "STRING_TO_ULINT"))
+    return function_string_to_ulint;
+
+if (!strcasecmp(function_name->value, "STRING_TO_BOOL"))
+    return function_string_to_bool;
+
+if (!strcasecmp(function_name->value, "STRING_TO_TIME"))
+    return function_string_to_time;
+
+if (!strcasecmp(function_name->value, "STRING_TO_INT"))
+    return function_string_to_int;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_REAL"))
+    return function_lword_to_real;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_SINT"))
+    return function_lword_to_sint;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_LINT"))
+    return function_lword_to_lint;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_DINT"))
+    return function_lword_to_dint;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_DATE"))
+    return function_lword_to_date;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_DWORD"))
+    return function_lword_to_dword;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_DT"))
+    return function_lword_to_dt;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_TOD"))
+    return function_lword_to_tod;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_UDINT"))
+    return function_lword_to_udint;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_WORD"))
+    return function_lword_to_word;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_STRING"))
+    return function_lword_to_string;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_UINT"))
+    return function_lword_to_uint;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_LREAL"))
+    return function_lword_to_lreal;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_BYTE"))
+    return function_lword_to_byte;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_USINT"))
+    return function_lword_to_usint;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_ULINT"))
+    return function_lword_to_ulint;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_BOOL"))
+    return function_lword_to_bool;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_TIME"))
+    return function_lword_to_time;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_INT"))
+    return function_lword_to_int;
+
+if (!strcasecmp(function_name->value, "UINT_TO_REAL"))
+    return function_uint_to_real;
+
+if (!strcasecmp(function_name->value, "UINT_TO_SINT"))
+    return function_uint_to_sint;
+
+if (!strcasecmp(function_name->value, "UINT_TO_LINT"))
+    return function_uint_to_lint;
+
+if (!strcasecmp(function_name->value, "UINT_TO_DINT"))
+    return function_uint_to_dint;
+
+if (!strcasecmp(function_name->value, "UINT_TO_DATE"))
+    return function_uint_to_date;
+
+if (!strcasecmp(function_name->value, "UINT_TO_DWORD"))
+    return function_uint_to_dword;
+
+if (!strcasecmp(function_name->value, "UINT_TO_DT"))
+    return function_uint_to_dt;
+
+if (!strcasecmp(function_name->value, "UINT_TO_TOD"))
+    return function_uint_to_tod;
+
+if (!strcasecmp(function_name->value, "UINT_TO_UDINT"))
+    return function_uint_to_udint;
+
+if (!strcasecmp(function_name->value, "UINT_TO_WORD"))
+    return function_uint_to_word;
+
+if (!strcasecmp(function_name->value, "UINT_TO_STRING"))
+    return function_uint_to_string;
+
+if (!strcasecmp(function_name->value, "UINT_TO_LWORD"))
+    return function_uint_to_lword;
+
+if (!strcasecmp(function_name->value, "UINT_TO_LREAL"))
+    return function_uint_to_lreal;
+
+if (!strcasecmp(function_name->value, "UINT_TO_BYTE"))
+    return function_uint_to_byte;
+
+if (!strcasecmp(function_name->value, "UINT_TO_USINT"))
+    return function_uint_to_usint;
+
+if (!strcasecmp(function_name->value, "UINT_TO_ULINT"))
+    return function_uint_to_ulint;
+
+if (!strcasecmp(function_name->value, "UINT_TO_BOOL"))
+    return function_uint_to_bool;
+
+if (!strcasecmp(function_name->value, "UINT_TO_TIME"))
+    return function_uint_to_time;
+
+if (!strcasecmp(function_name->value, "UINT_TO_INT"))
+    return function_uint_to_int;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_REAL"))
+    return function_lreal_to_real;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_SINT"))
+    return function_lreal_to_sint;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_LINT"))
+    return function_lreal_to_lint;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_DINT"))
+    return function_lreal_to_dint;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_DATE"))
+    return function_lreal_to_date;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_DWORD"))
+    return function_lreal_to_dword;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_DT"))
+    return function_lreal_to_dt;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_TOD"))
+    return function_lreal_to_tod;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_UDINT"))
+    return function_lreal_to_udint;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_WORD"))
+    return function_lreal_to_word;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_STRING"))
+    return function_lreal_to_string;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_LWORD"))
+    return function_lreal_to_lword;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_UINT"))
+    return function_lreal_to_uint;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_BYTE"))
+    return function_lreal_to_byte;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_USINT"))
+    return function_lreal_to_usint;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_ULINT"))
+    return function_lreal_to_ulint;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_BOOL"))
+    return function_lreal_to_bool;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_TIME"))
+    return function_lreal_to_time;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_INT"))
+    return function_lreal_to_int;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_REAL"))
+    return function_byte_to_real;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_SINT"))
+    return function_byte_to_sint;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_LINT"))
+    return function_byte_to_lint;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_DINT"))
+    return function_byte_to_dint;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_DATE"))
+    return function_byte_to_date;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_DWORD"))
+    return function_byte_to_dword;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_DT"))
+    return function_byte_to_dt;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_TOD"))
+    return function_byte_to_tod;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_UDINT"))
+    return function_byte_to_udint;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_WORD"))
+    return function_byte_to_word;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_STRING"))
+    return function_byte_to_string;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_LWORD"))
+    return function_byte_to_lword;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_UINT"))
+    return function_byte_to_uint;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_LREAL"))
+    return function_byte_to_lreal;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_USINT"))
+    return function_byte_to_usint;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_ULINT"))
+    return function_byte_to_ulint;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_BOOL"))
+    return function_byte_to_bool;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_TIME"))
+    return function_byte_to_time;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_INT"))
+    return function_byte_to_int;
+
+if (!strcasecmp(function_name->value, "USINT_TO_REAL"))
+    return function_usint_to_real;
+
+if (!strcasecmp(function_name->value, "USINT_TO_SINT"))
+    return function_usint_to_sint;
+
+if (!strcasecmp(function_name->value, "USINT_TO_LINT"))
+    return function_usint_to_lint;
+
+if (!strcasecmp(function_name->value, "USINT_TO_DINT"))
+    return function_usint_to_dint;
+
+if (!strcasecmp(function_name->value, "USINT_TO_DATE"))
+    return function_usint_to_date;
+
+if (!strcasecmp(function_name->value, "USINT_TO_DWORD"))
+    return function_usint_to_dword;
+
+if (!strcasecmp(function_name->value, "USINT_TO_DT"))
+    return function_usint_to_dt;
+
+if (!strcasecmp(function_name->value, "USINT_TO_TOD"))
+    return function_usint_to_tod;
+
+if (!strcasecmp(function_name->value, "USINT_TO_UDINT"))
+    return function_usint_to_udint;
+
+if (!strcasecmp(function_name->value, "USINT_TO_WORD"))
+    return function_usint_to_word;
+
+if (!strcasecmp(function_name->value, "USINT_TO_STRING"))
+    return function_usint_to_string;
+
+if (!strcasecmp(function_name->value, "USINT_TO_LWORD"))
+    return function_usint_to_lword;
+
+if (!strcasecmp(function_name->value, "USINT_TO_UINT"))
+    return function_usint_to_uint;
+
+if (!strcasecmp(function_name->value, "USINT_TO_LREAL"))
+    return function_usint_to_lreal;
+
+if (!strcasecmp(function_name->value, "USINT_TO_BYTE"))
+    return function_usint_to_byte;
+
+if (!strcasecmp(function_name->value, "USINT_TO_ULINT"))
+    return function_usint_to_ulint;
+
+if (!strcasecmp(function_name->value, "USINT_TO_BOOL"))
+    return function_usint_to_bool;
+
+if (!strcasecmp(function_name->value, "USINT_TO_TIME"))
+    return function_usint_to_time;
+
+if (!strcasecmp(function_name->value, "USINT_TO_INT"))
+    return function_usint_to_int;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_REAL"))
+    return function_ulint_to_real;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_SINT"))
+    return function_ulint_to_sint;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_LINT"))
+    return function_ulint_to_lint;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_DINT"))
+    return function_ulint_to_dint;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_DATE"))
+    return function_ulint_to_date;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_DWORD"))
+    return function_ulint_to_dword;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_DT"))
+    return function_ulint_to_dt;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_TOD"))
+    return function_ulint_to_tod;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_UDINT"))
+    return function_ulint_to_udint;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_WORD"))
+    return function_ulint_to_word;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_STRING"))
+    return function_ulint_to_string;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_LWORD"))
+    return function_ulint_to_lword;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_UINT"))
+    return function_ulint_to_uint;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_LREAL"))
+    return function_ulint_to_lreal;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_BYTE"))
+    return function_ulint_to_byte;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_USINT"))
+    return function_ulint_to_usint;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_BOOL"))
+    return function_ulint_to_bool;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_TIME"))
+    return function_ulint_to_time;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_INT"))
+    return function_ulint_to_int;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_REAL"))
+    return function_bool_to_real;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_SINT"))
+    return function_bool_to_sint;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_LINT"))
+    return function_bool_to_lint;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_DINT"))
+    return function_bool_to_dint;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_DATE"))
+    return function_bool_to_date;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_DWORD"))
+    return function_bool_to_dword;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_DT"))
+    return function_bool_to_dt;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_TOD"))
+    return function_bool_to_tod;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_UDINT"))
+    return function_bool_to_udint;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_WORD"))
+    return function_bool_to_word;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_STRING"))
+    return function_bool_to_string;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_LWORD"))
+    return function_bool_to_lword;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_UINT"))
+    return function_bool_to_uint;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_LREAL"))
+    return function_bool_to_lreal;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_BYTE"))
+    return function_bool_to_byte;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_USINT"))
+    return function_bool_to_usint;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_ULINT"))
+    return function_bool_to_ulint;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_TIME"))
+    return function_bool_to_time;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_INT"))
+    return function_bool_to_int;
+
+if (!strcasecmp(function_name->value, "TIME_TO_REAL"))
+    return function_time_to_real;
+
+if (!strcasecmp(function_name->value, "TIME_TO_SINT"))
+    return function_time_to_sint;
+
+if (!strcasecmp(function_name->value, "TIME_TO_LINT"))
+    return function_time_to_lint;
+
+if (!strcasecmp(function_name->value, "TIME_TO_DINT"))
+    return function_time_to_dint;
+
+if (!strcasecmp(function_name->value, "TIME_TO_DWORD"))
+    return function_time_to_dword;
+
+if (!strcasecmp(function_name->value, "TIME_TO_UDINT"))
+    return function_time_to_udint;
+
+if (!strcasecmp(function_name->value, "TIME_TO_WORD"))
+    return function_time_to_word;
+
+if (!strcasecmp(function_name->value, "TIME_TO_STRING"))
+    return function_time_to_string;
+
+if (!strcasecmp(function_name->value, "TIME_TO_LWORD"))
+    return function_time_to_lword;
+
+if (!strcasecmp(function_name->value, "TIME_TO_UINT"))
+    return function_time_to_uint;
+
+if (!strcasecmp(function_name->value, "TIME_TO_LREAL"))
+    return function_time_to_lreal;
+
+if (!strcasecmp(function_name->value, "TIME_TO_BYTE"))
+    return function_time_to_byte;
+
+if (!strcasecmp(function_name->value, "TIME_TO_USINT"))
+    return function_time_to_usint;
+
+if (!strcasecmp(function_name->value, "TIME_TO_ULINT"))
+    return function_time_to_ulint;
+
+if (!strcasecmp(function_name->value, "TIME_TO_INT"))
+    return function_time_to_int;
+
+if (!strcasecmp(function_name->value, "INT_TO_REAL"))
+    return function_int_to_real;
+
+if (!strcasecmp(function_name->value, "INT_TO_SINT"))
+    return function_int_to_sint;
+
+if (!strcasecmp(function_name->value, "INT_TO_LINT"))
+    return function_int_to_lint;
+
+if (!strcasecmp(function_name->value, "INT_TO_DINT"))
+    return function_int_to_dint;
+
+if (!strcasecmp(function_name->value, "INT_TO_DATE"))
+    return function_int_to_date;
+
+if (!strcasecmp(function_name->value, "INT_TO_DWORD"))
+    return function_int_to_dword;
+
+if (!strcasecmp(function_name->value, "INT_TO_DT"))
+    return function_int_to_dt;
+
+if (!strcasecmp(function_name->value, "INT_TO_TOD"))
+    return function_int_to_tod;
+
+if (!strcasecmp(function_name->value, "INT_TO_UDINT"))
+    return function_int_to_udint;
+
+if (!strcasecmp(function_name->value, "INT_TO_WORD"))
+    return function_int_to_word;
+
+if (!strcasecmp(function_name->value, "INT_TO_STRING"))
+    return function_int_to_string;
+
+if (!strcasecmp(function_name->value, "INT_TO_LWORD"))
+    return function_int_to_lword;
+
+if (!strcasecmp(function_name->value, "INT_TO_UINT"))
+    return function_int_to_uint;
+
+if (!strcasecmp(function_name->value, "INT_TO_LREAL"))
+    return function_int_to_lreal;
+
+if (!strcasecmp(function_name->value, "INT_TO_BYTE"))
+    return function_int_to_byte;
+
+if (!strcasecmp(function_name->value, "INT_TO_USINT"))
+    return function_int_to_usint;
+
+if (!strcasecmp(function_name->value, "INT_TO_ULINT"))
+    return function_int_to_ulint;
+
+if (!strcasecmp(function_name->value, "INT_TO_BOOL"))
+    return function_int_to_bool;
+
+if (!strcasecmp(function_name->value, "INT_TO_TIME"))
+    return function_int_to_time;
+
+if (!strcasecmp(function_name->value, "TRUNC"))
+    return function_trunc;
+
+if (!strcasecmp(function_name->value, "BCD_TO_UDINT"))
+    return function_bcd_to_udint;
+
+if (!strcasecmp(function_name->value, "BCD_TO_UINT"))
+    return function_bcd_to_uint;
+
+if (!strcasecmp(function_name->value, "BCD_TO_ULINT"))
+    return function_bcd_to_ulint;
+
+if (!strcasecmp(function_name->value, "BCD_TO_USINT"))
+    return function_bcd_to_usint;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_BCD"))
+    return function_udint_to_bcd;
+
+if (!strcasecmp(function_name->value, "UINT_TO_BCD"))
+    return function_uint_to_bcd;
+
+if (!strcasecmp(function_name->value, "USINT_TO_BCD"))
+    return function_usint_to_bcd;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_BCD"))
+    return function_ulint_to_bcd;
+
+if (!strcasecmp(function_name->value, "DATE_AND_TIME_TO_TIME_OF_DAY"))
+    return function_date_and_time_to_time_of_day;
+
+if (!strcasecmp(function_name->value, "DATE_AND_TIME_TO_DATE"))
+    return function_date_and_time_to_date;
+
+if (!strcasecmp(function_name->value, "ABS"))
+    return function_abs;
+
+if (!strcasecmp(function_name->value, "SQRT"))
+    return function_sqrt;
+
+if (!strcasecmp(function_name->value, "LN"))
+    return function_ln;
+
+if (!strcasecmp(function_name->value, "LOG"))
+    return function_log;
+
+if (!strcasecmp(function_name->value, "EXP"))
+    return function_exp;
+
+if (!strcasecmp(function_name->value, "SIN"))
+    return function_sin;
+
+if (!strcasecmp(function_name->value, "COS"))
+    return function_cos;
+
+if (!strcasecmp(function_name->value, "TAN"))
+    return function_tan;
+
+if (!strcasecmp(function_name->value, "ASIN"))
+    return function_asin;
+
+if (!strcasecmp(function_name->value, "ACOS"))
+    return function_acos;
+
+if (!strcasecmp(function_name->value, "ATAN"))
+    return function_atan;
+
+if (!strcasecmp(function_name->value, "ADD"))
+    return function_add;
+
+if (!strcasecmp(function_name->value, "MUL"))
+    return function_mul;
+
+if (!strcasecmp(function_name->value, "SUB"))
+    return function_sub;
+
+if (!strcasecmp(function_name->value, "DIV"))
+    return function_div;
+
+if (!strcasecmp(function_name->value, "MOD"))
+    return function_mod;
+
+if (!strcasecmp(function_name->value, "EXPT"))
+    return function_expt;
+
+if (!strcasecmp(function_name->value, "MOVE"))
+    return function_move;
+
+if (!strcasecmp(function_name->value, "SHL"))
+    return function_shl;
+
+if (!strcasecmp(function_name->value, "SHR"))
+    return function_shr;
+
+if (!strcasecmp(function_name->value, "ROR"))
+    return function_ror;
+
+if (!strcasecmp(function_name->value, "ROL"))
+    return function_rol;
+
+if (!strcasecmp(function_name->value, "AND"))
+    return function_and;
+
+if (!strcasecmp(function_name->value, "OR"))
+    return function_or;
+
+if (!strcasecmp(function_name->value, "XOR"))
+    return function_xor;
+
+if (!strcasecmp(function_name->value, "NOT"))
+    return function_not;
+
+if (!strcasecmp(function_name->value, "SEL"))
+    return function_sel;
+
+if (!strcasecmp(function_name->value, "MAX"))
+    return function_max;
+
+if (!strcasecmp(function_name->value, "MIN"))
+    return function_min;
+
+if (!strcasecmp(function_name->value, "LIMIT"))
+    return function_limit;
+
+if (!strcasecmp(function_name->value, "MUX"))
+    return function_mux;
+
+if (!strcasecmp(function_name->value, "GT"))
+    return function_gt;
+
+if (!strcasecmp(function_name->value, "GE"))
+    return function_ge;
+
+if (!strcasecmp(function_name->value, "EQ"))
+    return function_eq;
+
+if (!strcasecmp(function_name->value, "LT"))
+    return function_lt;
+
+if (!strcasecmp(function_name->value, "LE"))
+    return function_le;
+
+if (!strcasecmp(function_name->value, "NE"))
+    return function_ne;
+
+if (!strcasecmp(function_name->value, "LEN"))
+    return function_len;
+
+if (!strcasecmp(function_name->value, "LEFT"))
+    return function_left;
+
+if (!strcasecmp(function_name->value, "RIGHT"))
+    return function_right;
+
+if (!strcasecmp(function_name->value, "MID"))
+    return function_mid;
+
+if (!strcasecmp(function_name->value, "CONCAT"))
+    return function_concat;
+
+if (!strcasecmp(function_name->value, "INSERT"))
+    return function_insert;
+
+if (!strcasecmp(function_name->value, "DELETE"))
+    return function_delete;
+
+if (!strcasecmp(function_name->value, "REPLACE"))
+    return function_replace;
+
+if (!strcasecmp(function_name->value, "FIND"))
+    return function_find;
+
+    else return function_none;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/search_base_type.cc	Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,235 @@
+/*
+ * (c) 2003 Mario de Sousa
+ *
+ * Offered to the public under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 IL and ST compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+/* Determine the data type on which another data type is based on.
+ * If a new default initial value is given, we DO NOT consider it a
+ * new base class, and continue looking further!
+ *
+ * E.g. TYPE new_int_t : INT; END_TYPE;
+ *      TYPE new_int2_t : INT = 2; END_TYPE;
+ *      TYPE new_subr_t : INT (4..5); END_TYPE;
+ *
+ *    new_int_t is really an INT!!
+ *    new_int2_t is also really an INT!!
+ *    new_subr_t is also really an INT!!
+ */
+#include "absyntax_utils.hh"
+
+#define ERROR error_exit(__FILE__,__LINE__)
+/* function defined in main.cc */
+extern void error_exit(const char *file_name, int line_no);
+
+
+
+search_base_type_c::search_base_type_c(void) {current_type_name = NULL;}
+
+void *search_base_type_c::visit(identifier_c *type_name) {
+  this->current_type_name = type_name;
+  /* look up the type declaration... */
+  symbol_c *type_decl = type_symtable.find_value(type_name);
+  if (type_decl == type_symtable.end_value())
+    /* Type declaration not found!! */
+    ERROR;
+
+  return type_decl->accept(*this);
+}
+
+bool search_base_type_c::type_is_subrange(symbol_c* type_decl) {
+  this->is_subrange = false;
+  type_decl->accept(*this);
+  return this->is_subrange;
+}
+
+bool search_base_type_c::type_is_enumerated(symbol_c* type_decl) {
+  this->is_enumerated = false;
+  type_decl->accept(*this);
+  return this->is_enumerated;
+}
+
+/***********************************/
+/* B 1.3.1 - Elementary Data Types */
+/***********************************/
+void *search_base_type_c::visit(time_type_name_c *symbol)	{return (void *)symbol;}
+void *search_base_type_c::visit(bool_type_name_c *symbol)	{return (void *)symbol;}
+void *search_base_type_c::visit(sint_type_name_c *symbol)	{return (void *)symbol;}
+void *search_base_type_c::visit(int_type_name_c *symbol)	{return (void *)symbol;}
+void *search_base_type_c::visit(dint_type_name_c *symbol)	{return (void *)symbol;}
+void *search_base_type_c::visit(lint_type_name_c *symbol)	{return (void *)symbol;}
+void *search_base_type_c::visit(usint_type_name_c *symbol)	{return (void *)symbol;}
+void *search_base_type_c::visit(uint_type_name_c *symbol)	{return (void *)symbol;}
+void *search_base_type_c::visit(udint_type_name_c *symbol)	{return (void *)symbol;}
+void *search_base_type_c::visit(ulint_type_name_c *symbol)	{return (void *)symbol;}
+void *search_base_type_c::visit(real_type_name_c *symbol)	{return (void *)symbol;}
+void *search_base_type_c::visit(lreal_type_name_c *symbol)	{return (void *)symbol;}
+void *search_base_type_c::visit(date_type_name_c *symbol)	{return (void *)symbol;}
+void *search_base_type_c::visit(tod_type_name_c *symbol)	{return (void *)symbol;}
+void *search_base_type_c::visit(dt_type_name_c *symbol)		{return (void *)symbol;}
+void *search_base_type_c::visit(byte_type_name_c *symbol)	{return (void *)symbol;}
+void *search_base_type_c::visit(word_type_name_c *symbol)	{return (void *)symbol;}
+void *search_base_type_c::visit(dword_type_name_c *symbol)	{return (void *)symbol;}
+void *search_base_type_c::visit(lword_type_name_c *symbol)	{return (void *)symbol;}
+void *search_base_type_c::visit(string_type_name_c *symbol)	{return (void *)symbol;}
+void *search_base_type_c::visit(wstring_type_name_c *symbol)	{return (void *)symbol;}
+void *search_base_type_c::visit(constant_int_type_name_c *symbol)    {return (void *)symbol;}
+void *search_base_type_c::visit(constant_real_type_name_c *symbol)    {return (void *)symbol;}
+void *search_base_type_c::visit(direct_variable_type_name_c *symbol)    {return (void *)symbol;}
+/******************************************************/
+/* Extensions to the base standard as defined in      */
+/* "Safety Software Technical Specification,          */
+/*  Part 1: Concepts and Function Blocks,             */
+/*  Version 1.0 – Official Release"                   */
+/* by PLCopen - Technical Committee 5 - 2006-01-31    */
+/******************************************************/
+void *search_base_type_c::visit(safebool_type_name_c *symbol)	{return (void *)symbol;}
+
+/********************************/
+/* B 1.3.3 - Derived data types */
+/********************************/
+/*  simple_type_name ':' simple_spec_init */
+void *search_base_type_c::visit(simple_type_declaration_c *symbol) {
+  return symbol->simple_spec_init->accept(*this);
+}
+/* simple_specification ASSIGN constant */
+void *search_base_type_c::visit(simple_spec_init_c *symbol) {
+  return symbol->simple_specification->accept(*this);
+}
+
+/*  subrange_type_name ':' subrange_spec_init */
+void *search_base_type_c::visit(subrange_type_declaration_c *symbol) {
+  return symbol->subrange_spec_init->accept(*this);
+}
+
+/* subrange_specification ASSIGN signed_integer */
+void *search_base_type_c::visit(subrange_spec_init_c *symbol) {
+  this->is_subrange = true;
+  return symbol->subrange_specification->accept(*this);
+}
+
+/*  integer_type_name '(' subrange')' */
+void *search_base_type_c::visit(subrange_specification_c *symbol) {
+  return symbol->integer_type_name->accept(*this);
+}
+
+/*  signed_integer DOTDOT signed_integer */
+void *search_base_type_c::visit(subrange_c *symbol) {ERROR; return NULL;} /* should never get called... */
+
+/*  enumerated_type_name ':' enumerated_spec_init */
+void *search_base_type_c::visit(enumerated_type_declaration_c *symbol) {
+  this->current_type_name = symbol->enumerated_type_name;
+  return symbol->enumerated_spec_init->accept(*this);
+}
+
+/* enumerated_specification ASSIGN enumerated_value */
+void *search_base_type_c::visit(enumerated_spec_init_c *symbol) {
+  this->is_enumerated = true;
+  return symbol->enumerated_specification->accept(*this);
+}
+
+/* helper symbol for enumerated_specification->enumerated_spec_init */
+/* enumerated_value_list ',' enumerated_value */
+void *search_base_type_c::visit(enumerated_value_list_c *symbol) {
+  if (NULL == this->current_type_name) ERROR;
+  return (void *)this->current_type_name;
+}
+
+/* enumerated_type_name '#' identifier */
+// SYM_REF2(enumerated_value_c, type, value)
+void *search_base_type_c::visit(enumerated_value_c *symbol) {ERROR; return NULL;} /* should never get called... */
+
+/*  identifier ':' array_spec_init */
+void *search_base_type_c::visit(array_type_declaration_c *symbol) {
+  this->current_type_name = symbol->identifier;
+  return symbol->array_spec_init->accept(*this);
+}
+
+/* array_specification [ASSIGN array_initialization} */
+/* array_initialization may be NULL ! */
+void *search_base_type_c::visit(array_spec_init_c *symbol) {
+  return symbol->array_specification->accept(*this);
+}
+
+/* ARRAY '[' array_subrange_list ']' OF non_generic_type_name */
+void *search_base_type_c::visit(array_specification_c *symbol)	{
+  if (NULL == this->current_type_name) ERROR;
+  return symbol->non_generic_type_name->accept(*this);
+}
+
+/* helper symbol for array_specification */
+/* array_subrange_list ',' subrange */
+void *search_base_type_c::visit(array_subrange_list_c *symbol)	{ERROR; return NULL;} /* should never get called... */
+
+/* array_initialization:  '[' array_initial_elements_list ']' */
+/* helper symbol for array_initialization */
+/* array_initial_elements_list ',' array_initial_elements */
+void *search_base_type_c::visit(array_initial_elements_list_c *symbol)	{ERROR; return NULL;} /* should never get called... */
+
+/* integer '(' [array_initial_element] ')' */
+/* array_initial_element may be NULL ! */
+void *search_base_type_c::visit(array_initial_elements_c *symbol)	{ERROR; return NULL;} /* should never get called... */
+
+/*  structure_type_name ':' structure_specification */
+/* NOTE: structure_specification will point to either a
+ *       initialized_structure_c
+ *       OR A
+ *       structure_element_declaration_list_c
+ */
+void *search_base_type_c::visit(structure_type_declaration_c *symbol)  {
+  this->current_type_name = symbol->structure_type_name;
+  return symbol->structure_specification->accept(*this);
+}
+
+/* structure_type_name ASSIGN structure_initialization */
+/* structure_initialization may be NULL ! */
+void *search_base_type_c::visit(initialized_structure_c *symbol)	{
+  return symbol->structure_type_name->accept(*this);
+}
+
+/* helper symbol for structure_declaration */
+/* structure_declaration:  STRUCT structure_element_declaration_list END_STRUCT */
+/* structure_element_declaration_list structure_element_declaration ';' */
+void *search_base_type_c::visit(structure_element_declaration_list_c *symbol)	{
+  if (NULL == this->current_type_name) ERROR;
+  return (void *)symbol;
+}
+
+/*  structure_element_name ':' *_spec_init */
+void *search_base_type_c::visit(structure_element_declaration_c *symbol) {ERROR; return NULL;} /* should never get called... */
+
+/* helper symbol for structure_initialization */
+/* structure_initialization: '(' structure_element_initialization_list ')' */
+/* structure_element_initialization_list ',' structure_element_initialization */
+void *search_base_type_c::visit(structure_element_initialization_list_c *symbol) {ERROR; return NULL;} /* should never get called... */
+
+/*  structure_element_name ASSIGN value */
+void *search_base_type_c::visit(structure_element_initialization_c *symbol) {ERROR; return NULL;} /* should never get called... */
+
+/*  string_type_name ':' elementary_string_type_name string_type_declaration_size string_type_declaration_init */
+/*
+SYM_REF4(string_type_declaration_c,	string_type_name,
+					elementary_string_type_name,
+					string_type_declaration_size,
+					string_type_declaration_init) // may be == NULL!
+*/
+void *search_base_type_c::visit(string_type_declaration_c *symbol)	{return symbol;}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/search_base_type.hh	Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,170 @@
+/*
+ * (c) 2003 Mario de Sousa
+ *
+ * Offered to the public under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 IL and ST compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+
+/* Determine the data type on which another data type is based on.
+ * If a new default initial value is given, we DO NOT consider it a
+ * new base class, and continue looking further!
+ *
+ * E.g. TYPE new_int_t : INT; END_TYPE;
+ *      TYPE new_int2_t : INT = 2; END_TYPE;
+ *      TYPE new_subr_t : INT (4..5); END_TYPE;
+ *
+ *    new_int_t is really an INT!!
+ *    new_int2_t is also really an INT!!
+ *    new_subr_t is also really an INT!!
+ */
+
+
+class search_base_type_c: public null_visitor_c {
+
+  private:
+    symbol_c *current_type_name;
+    bool is_subrange;
+    bool is_enumerated;
+
+  public:
+    search_base_type_c(void);
+
+  public:
+    void *visit(identifier_c *type_name);
+    bool type_is_subrange(symbol_c* type_decl);
+    bool type_is_enumerated(symbol_c* type_decl);
+
+  public:
+  /***********************************/
+  /* B 1.3.1 - Elementary Data Types */
+  /***********************************/
+    void *visit(time_type_name_c *symbol);
+    void *visit(bool_type_name_c *symbol);
+    void *visit(sint_type_name_c *symbol);
+    void *visit(int_type_name_c *symbol);
+    void *visit(dint_type_name_c *symbol);
+    void *visit(lint_type_name_c *symbol);
+    void *visit(usint_type_name_c *symbol);
+    void *visit(uint_type_name_c *symbol);
+    void *visit(udint_type_name_c *symbol);
+    void *visit(ulint_type_name_c *symbol);
+    void *visit(real_type_name_c *symbol);
+    void *visit(lreal_type_name_c *symbol);
+    void *visit(date_type_name_c *symbol);
+    void *visit(tod_type_name_c *symbol);
+    void *visit(dt_type_name_c *symbol)	;
+    void *visit(byte_type_name_c *symbol);
+    void *visit(word_type_name_c *symbol);
+    void *visit(dword_type_name_c *symbol);
+    void *visit(lword_type_name_c *symbol);
+    void *visit(string_type_name_c *symbol);
+    void *visit(wstring_type_name_c *symbol);
+    void *visit(constant_int_type_name_c *symbol);
+    void *visit(constant_real_type_name_c *symbol);
+    void *visit(direct_variable_type_name_c *symbol);
+
+    /******************************************************/
+    /* Extensions to the base standard as defined in      */
+    /* "Safety Software Technical Specification,          */
+    /*  Part 1: Concepts and Function Blocks,             */
+    /*  Version 1.0 – Official Release"                   */
+    /* by PLCopen - Technical Committee 5 - 2006-01-31    */
+    /******************************************************/
+    void *visit(safebool_type_name_c *symbol);
+
+  /********************************/
+  /* B 1.3.3 - Derived data types */
+  /********************************/
+  /*  simple_type_name ':' simple_spec_init */
+    void *visit(simple_type_declaration_c *symbol);
+  /* simple_specification ASSIGN constant */
+    void *visit(simple_spec_init_c *symbol);
+  /*  subrange_type_name ':' subrange_spec_init */
+    void *visit(subrange_type_declaration_c *symbol);
+  /* subrange_specification ASSIGN signed_integer */
+    void *visit(subrange_spec_init_c *symbol);
+  /*  integer_type_name '(' subrange')' */
+    void *visit(subrange_specification_c *symbol);
+  /*  signed_integer DOTDOT signed_integer */
+    void *visit(subrange_c *symbol);
+
+  /*  enumerated_type_name ':' enumerated_spec_init */
+    void *visit(enumerated_type_declaration_c *symbol);
+  /* enumerated_specification ASSIGN enumerated_value */
+    void *visit(enumerated_spec_init_c *symbol);
+  /* helper symbol for enumerated_specification->enumerated_spec_init */
+  /* enumerated_value_list ',' enumerated_value */
+    void *visit(enumerated_value_list_c *symbol);
+  /* enumerated_type_name '#' identifier */
+  // SYM_REF2(enumerated_value_c, type, value)
+    void *visit(enumerated_value_c *symbol);
+  /*  identifier ':' array_spec_init */
+    void *visit(array_type_declaration_c *symbol);
+  /* array_specification [ASSIGN array_initialization} */
+  /* array_initialization may be NULL ! */
+    void *visit(array_spec_init_c *symbol);
+  /* ARRAY '[' array_subrange_list ']' OF non_generic_type_name */
+    void *visit(array_specification_c *symbol);
+  /* helper symbol for array_specification */
+  /* array_subrange_list ',' subrange */
+    void *visit(array_subrange_list_c *symbol);
+  /* array_initialization:  '[' array_initial_elements_list ']' */
+  /* helper symbol for array_initialization */
+  /* array_initial_elements_list ',' array_initial_elements */
+    void *visit(array_initial_elements_list_c *symbol);
+  /* integer '(' [array_initial_element] ')' */
+  /* array_initial_element may be NULL ! */
+    void *visit(array_initial_elements_c *symbol);
+  /*  structure_type_name ':' structure_specification */
+      /* NOTE: structure_specification will point to either a
+       *       initialized_structure_c
+       *       OR A
+       *       structure_element_declaration_list_c
+       */
+    void *visit(structure_type_declaration_c *symbol);
+  /* structure_type_name ASSIGN structure_initialization */
+  /* structure_initialization may be NULL ! */
+    void *visit(initialized_structure_c *symbol);
+  /* helper symbol for structure_declaration */
+  /* structure_declaration:  STRUCT structure_element_declaration_list END_STRUCT */
+  /* structure_element_declaration_list structure_element_declaration ';' */
+    void *visit(structure_element_declaration_list_c *symbol);
+  /*  structure_element_name ':' *_spec_init */
+    void *visit(structure_element_declaration_c *symbol);
+  /* helper symbol for structure_initialization */
+  /* structure_initialization: '(' structure_element_initialization_list ')' */
+  /* structure_element_initialization_list ',' structure_element_initialization */
+    void *visit(structure_element_initialization_list_c *symbol);
+  /*  structure_element_name ASSIGN value */
+    void *visit(structure_element_initialization_c *symbol);
+  /*  string_type_name ':' elementary_string_type_name string_type_declaration_size string_type_declaration_init */
+  /*
+  SYM_REF4(string_type_declaration_c,	string_type_name,
+  					elementary_string_type_name,
+  					string_type_declaration_size,
+  					string_type_declaration_init) // may be == NULL!
+  */
+    void *visit(string_type_declaration_c *symbol);
+}; // search_base_type_c
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/search_constant_type.cc	Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,125 @@
+/*
+ * (c) 2003 Mario de Sousa
+ *
+ * Offered to the public under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 IL and ST compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+/* Determine the data type of a specific constant or variable.
+ * A reference to the relevant type definition is returned.
+ *
+ * For example:
+ *       22          -> returns reference to a int_type_name_c object.
+ *       22.2        -> returns reference to a real_type_name_c object.
+ *       LREAL#22.2  -> returns reference to a lreal_type_name_c object.
+ *       etc...
+ */
+
+
+#include "search_constant_type.hh"
+
+#define ERROR error_exit(__FILE__,__LINE__)
+/* function defined in main.cc */
+extern void error_exit(const char *file_name, int line_no);
+
+symbol_c *search_constant_type_c::get_type(symbol_c *constant) {
+  return (symbol_c *)constant->accept(*this);
+}
+
+
+/*********************/
+/* B 1.2 - Constants */
+/*********************/
+
+/******************************/
+/* B 1.2.1 - Numeric Literals */
+/******************************/
+void *search_constant_type_c::visit(real_c *symbol) {return (void *)&constant_real_type_name;}
+void *search_constant_type_c::visit(integer_c *symbol) {return (void *)&constant_int_type_name;}
+void *search_constant_type_c::visit(binary_integer_c *symbol) {return (void *)&constant_int_type_name;}
+void *search_constant_type_c::visit(octal_integer_c *symbol) {return (void *)&constant_int_type_name;}
+void *search_constant_type_c::visit(hex_integer_c *symbol) {return (void *)&constant_int_type_name;}
+
+void *search_constant_type_c::visit(numeric_literal_c *symbol)
+  {return (void *)((symbol->type!=NULL)?symbol->type:symbol->value->accept(*this));}
+void *search_constant_type_c::visit(integer_literal_c *symbol)
+  {return (void *)((symbol->type!=NULL)?symbol->type:symbol->value->accept(*this));}
+void *search_constant_type_c::visit(real_literal_c *symbol)
+  {return (void *)((symbol->type!=NULL)?symbol->type:symbol->value->accept(*this));}
+void *search_constant_type_c::visit(bit_string_literal_c *symbol)
+  {return (void *)((symbol->type!=NULL)?symbol->type:symbol->value->accept(*this));}
+void *search_constant_type_c::visit(boolean_literal_c *symbol)
+  {return (void *)((symbol->type!=NULL)?symbol->type:symbol->value->accept(*this));}
+
+/*******************************/
+/* B.1.2.2   Character Strings */
+/*******************************/
+void *search_constant_type_c::visit(double_byte_character_string_c *symbol) {return (void *)&wstring_type_name;}
+void *search_constant_type_c::visit(single_byte_character_string_c *symbol) {return (void *)&string_type_name;}
+
+/***************************/
+/* B 1.2.3 - Time Literals */
+/***************************/
+/************************/
+/* B 1.2.3.1 - Duration */
+/************************/
+void *search_constant_type_c::visit(neg_time_c *symbol) {ERROR; return NULL;}  /* this member function should never be called. */
+void *search_constant_type_c::visit(duration_c *symbol) {return (void *)&time_type_name;}
+void *search_constant_type_c::visit(fixed_point_c *symbol) {ERROR; return NULL;}  /* this member function should never be called. */
+void *search_constant_type_c::visit(days_c *symbol) {ERROR; return NULL;}  /* this member function should never be called. */
+void *search_constant_type_c::visit(hours_c *symbol) {ERROR; return NULL;}  /* this member function should never be called. */
+void *search_constant_type_c::visit(minutes_c *symbol) {ERROR; return NULL;}  /* this member function should never be called. */
+void *search_constant_type_c::visit(seconds_c *symbol) {ERROR; return NULL;}  /* this member function should never be called. */
+void *search_constant_type_c::visit(milliseconds_c *symbol) {ERROR; return NULL;}  /* this member function should never be called. */
+
+/************************************/
+/* B 1.2.3.2 - Time of day and Date */
+/************************************/
+void *search_constant_type_c::visit(time_of_day_c *symbol) {return (void *)&tod_type_name;}
+void *search_constant_type_c::visit(daytime_c *symbol) {ERROR; return NULL;}  /* this member function should never be called. */
+void *search_constant_type_c::visit(date_c *symbol) {return (void *)&date_type_name;}
+void *search_constant_type_c::visit(date_literal_c *symbol) {ERROR; return NULL;}  /* this member function should never be called. */
+void *search_constant_type_c::visit(date_and_time_c *symbol) {return (void *)&dt_type_name;}
+
+real_type_name_c     search_constant_type_c::real_type_name;
+sint_type_name_c     search_constant_type_c::sint_type_name;
+lint_type_name_c     search_constant_type_c::lint_type_name;
+dint_type_name_c     search_constant_type_c::dint_type_name;
+date_type_name_c     search_constant_type_c::date_type_name;
+dword_type_name_c     search_constant_type_c::dword_type_name;
+dt_type_name_c     search_constant_type_c::dt_type_name;
+tod_type_name_c     search_constant_type_c::tod_type_name;
+udint_type_name_c     search_constant_type_c::udint_type_name;
+word_type_name_c     search_constant_type_c::word_type_name;
+wstring_type_name_c     search_constant_type_c::wstring_type_name;
+string_type_name_c     search_constant_type_c::string_type_name;
+lword_type_name_c     search_constant_type_c::lword_type_name;
+uint_type_name_c     search_constant_type_c::uint_type_name;
+lreal_type_name_c     search_constant_type_c::lreal_type_name;
+byte_type_name_c     search_constant_type_c::byte_type_name;
+usint_type_name_c     search_constant_type_c::usint_type_name;
+ulint_type_name_c     search_constant_type_c::ulint_type_name;
+bool_type_name_c     search_constant_type_c::bool_type_name;
+time_type_name_c     search_constant_type_c::time_type_name;
+int_type_name_c     search_constant_type_c::int_type_name;
+
+constant_real_type_name_c     search_constant_type_c::constant_real_type_name;
+constant_int_type_name_c      search_constant_type_c::constant_int_type_name;
+direct_variable_type_name_c   search_constant_type_c::direct_variable_type_name;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/search_constant_type.hh	Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,140 @@
+/*
+ * (c) 2003 Mario de Sousa
+ *
+ * Offered to the public under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 IL and ST compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+/* Determine the data type of a specific constant or variable.
+ * A reference to the relevant type definition is returned.
+ *
+ * For example:
+ *       22          -> returns reference to a int_type_name_c object.
+ *       22.2        -> returns reference to a real_type_name_c object.
+ *       LREAL#22.2  -> returns reference to a lreal_type_name_c object.
+ *       etc...
+ */
+
+
+#include "../absyntax/visitor.hh"
+
+
+class search_constant_type_c: public search_visitor_c {
+
+  public:
+  /**********************/
+  /* B.1.3 - Data types */
+  /**********************/
+  /***********************************/
+  /* B 1.3.1 - Elementary Data Types */
+  /***********************************/
+  static real_type_name_c     real_type_name;
+  static sint_type_name_c     sint_type_name;
+  static lint_type_name_c     lint_type_name;
+  static dint_type_name_c     dint_type_name;
+  static date_type_name_c     date_type_name;
+  static dword_type_name_c    dword_type_name;
+  static dt_type_name_c       dt_type_name;
+  static tod_type_name_c      tod_type_name;
+  static udint_type_name_c    udint_type_name;
+  static word_type_name_c     word_type_name;
+  static wstring_type_name_c  wstring_type_name;
+  static string_type_name_c   string_type_name;
+  static lword_type_name_c    lword_type_name;
+  static uint_type_name_c     uint_type_name;
+  static lreal_type_name_c    lreal_type_name;
+  static byte_type_name_c     byte_type_name;
+  static usint_type_name_c    usint_type_name;
+  static ulint_type_name_c    ulint_type_name;
+  static bool_type_name_c     bool_type_name;
+  static time_type_name_c     time_type_name;
+  static int_type_name_c      int_type_name;
+
+  static constant_real_type_name_c     constant_real_type_name;
+  static constant_int_type_name_c      constant_int_type_name;
+  static direct_variable_type_name_c   direct_variable_type_name;
+
+  /******************************************************/
+  /* Extensions to the base standard as defined in      */
+  /* "Safety Software Technical Specification,          */
+  /*  Part 1: Concepts and Function Blocks,             */
+  /*  Version 1.0 – Official Release"                   */
+  /* by PLCopen - Technical Committee 5 - 2006-01-31    */
+  /******************************************************/
+  static safebool_type_name_c          safebool_type_name;
+
+
+  public:
+    symbol_c *get_type(symbol_c *constant);
+
+
+  private:
+    /*********************/
+    /* B 1.2 - Constants */
+    /*********************/
+
+    /******************************/
+    /* B 1.2.1 - Numeric Literals */
+    /******************************/
+    void *visit(real_c *symbol);
+    void *visit(integer_c *symbol);
+    void *visit(binary_integer_c *symbol);
+    void *visit(octal_integer_c *symbol);
+    void *visit(hex_integer_c *symbol);
+
+    void *visit(numeric_literal_c *symbol);
+    void *visit(integer_literal_c *symbol);
+    void *visit(real_literal_c *symbol);
+    void *visit(bit_string_literal_c *symbol);
+    void *visit(boolean_literal_c *symbol);
+
+    /*******************************/
+    /* B.1.2.2   Character Strings */
+    /*******************************/
+    void *visit(double_byte_character_string_c *symbol);
+    void *visit(single_byte_character_string_c *symbol);
+
+    /***************************/
+    /* B 1.2.3 - Time Literals */
+    /***************************/
+    /************************/
+    /* B 1.2.3.1 - Duration */
+    /************************/
+    void *visit(neg_time_c *symbol);
+    void *visit(duration_c *symbol);
+    void *visit(fixed_point_c *symbol);
+    void *visit(days_c *symbol);
+    void *visit(hours_c *symbol);
+    void *visit(minutes_c *symbol);
+    void *visit(seconds_c *symbol);
+    void *visit(milliseconds_c *symbol);
+
+    /************************************/
+    /* B 1.2.3.2 - Time of day and Date */
+    /************************************/
+    void *visit(time_of_day_c *symbol);
+    void *visit(daytime_c *symbol);
+    void *visit(date_c *symbol);
+    void *visit(date_literal_c *symbol);
+    void *visit(date_and_time_c *symbol);
+};  // search_constant_type_c
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/search_expression_type.cc	Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,344 @@
+/*
+ * (c) 2003 Mario de Sousa
+ *
+ * Offered to the public under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 IL and ST compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+
+/* Determine the data type of an ST expression.
+ * A reference to the relevant type definition is returned.
+ *
+ * For example:
+ *       2 + 3       -> returns reference to a int_type_name_c object.
+ *       22.2 - 5    -> returns reference to a real_type_name_c object.
+ *       etc...
+ */
+
+
+
+#include "absyntax_utils.hh"
+#include <typeinfo>
+
+search_expression_type_c::search_expression_type_c(symbol_c *search_scope) {
+  search_varfb_instance_type = new search_varfb_instance_type_c(search_scope);
+}
+
+search_expression_type_c::~search_expression_type_c(void) {
+  delete search_varfb_instance_type;
+}
+
+/* A helper function... */
+bool search_expression_type_c::is_bool_type(symbol_c *type_symbol) {
+  bool_type_name_c tt;
+  if (type_symbol == NULL) {return true;}
+  return (typeid(*type_symbol) == typeid(bool_type_name_c));
+}
+
+/* A helper function... */
+bool search_expression_type_c::is_time_type(symbol_c *type_symbol) {
+  if (type_symbol == NULL) {return true;}
+  if (typeid(*type_symbol) == typeid(time_type_name_c)) {return true;}
+  if (typeid(*type_symbol) == typeid(date_type_name_c)) {return true;}
+  if (typeid(*type_symbol) == typeid(tod_type_name_c)) {return true;}
+  if (typeid(*type_symbol) == typeid(dt_type_name_c)) {return true;}
+  return false;
+}
+
+/* A helper function... */
+bool search_expression_type_c::is_string_type(symbol_c *type_symbol) {
+  if (type_symbol == NULL) {return true;}
+  if (typeid(*type_symbol) == typeid(string_type_name_c)) {return true;}
+  if (typeid(*type_symbol) == typeid(wstring_type_name_c)) {return true;}
+  return false;
+}
+
+/* A helper function... */
+bool search_expression_type_c::is_integer_type(symbol_c *type_symbol) {
+  if (type_symbol == NULL) {return true;}
+  if (typeid(*type_symbol) == typeid(sint_type_name_c)) {return true;}
+  if (typeid(*type_symbol) == typeid(int_type_name_c)) {return true;}
+  if (typeid(*type_symbol) == typeid(dint_type_name_c)) {return true;}
+  if (typeid(*type_symbol) == typeid(lint_type_name_c)) {return true;}
+  if (typeid(*type_symbol) == typeid(usint_type_name_c)) {return true;}
+  if (typeid(*type_symbol) == typeid(uint_type_name_c)) {return true;}
+  if (typeid(*type_symbol) == typeid(udint_type_name_c)) {return true;}
+  if (typeid(*type_symbol) == typeid(ulint_type_name_c)) {return true;}
+  if (typeid(*type_symbol) == typeid(constant_int_type_name_c)) {return true;}
+  if (typeid(*type_symbol) == typeid(direct_variable_type_name_c)) {return true;}
+  return false;
+}
+
+bool search_expression_type_c::is_real_type(symbol_c *type_symbol) {
+  if (type_symbol == NULL) {return true;}
+  if (typeid(*type_symbol) == typeid(real_type_name_c)) {return true;}
+  if (typeid(*type_symbol) == typeid(lreal_type_name_c)) {return true;}
+  if (typeid(*type_symbol) == typeid(constant_real_type_name_c)) {return true;}
+  if (typeid(*type_symbol) == typeid(direct_variable_type_name_c)) {return true;}
+  return false;
+}
+
+bool search_expression_type_c::is_num_type(symbol_c *type_symbol) {
+  if (type_symbol == NULL) {return true;}
+  return is_real_type(type_symbol) || is_integer_type(type_symbol);
+}
+
+bool search_expression_type_c::is_nbinary_type(symbol_c *type_symbol) {
+  if (type_symbol == NULL) {return true;}
+  if (typeid(*type_symbol) == typeid(byte_type_name_c)) {return true;}
+  if (typeid(*type_symbol) == typeid(word_type_name_c)) {return true;}
+  if (typeid(*type_symbol) == typeid(dword_type_name_c)) {return true;}
+  if (typeid(*type_symbol) == typeid(lword_type_name_c)) {return true;}
+  if (typeid(*type_symbol) == typeid(constant_int_type_name_c)) {return true;}
+  if (typeid(*type_symbol) == typeid(direct_variable_type_name_c)) {return true;}
+  return false;
+}
+
+bool search_expression_type_c::is_binary_type(symbol_c *type_symbol) {
+  if (type_symbol == NULL) {return true;}
+  if (typeid(*type_symbol) == typeid(bool_type_name_c)) {return true;}
+  return is_nbinary_type(type_symbol);
+}
+
+bool search_expression_type_c::is_same_type(symbol_c *first_type, symbol_c *second_type) {
+  if (first_type == NULL || second_type == NULL) {return true;}
+  if (typeid(*first_type) == typeid(*second_type)) {return true;}
+  if (is_integer_type(first_type) && (typeid(*second_type) == typeid(constant_int_type_name_c))) {return true;}
+  if ((typeid(*first_type) == typeid(constant_int_type_name_c) && is_integer_type(second_type))) {return true;}
+  if (is_binary_type(first_type) && (typeid(*second_type) == typeid(constant_int_type_name_c))) {return true;}
+  if ((typeid(*first_type) == typeid(constant_int_type_name_c) && is_binary_type(second_type))) {return true;}
+  if (is_real_type(first_type) && (typeid(*second_type) == typeid(constant_real_type_name_c))) {return true;}
+  if ((typeid(*first_type) == typeid(constant_real_type_name_c) && is_real_type(second_type))) {return true;}
+  if (typeid(*first_type) == typeid(direct_variable_type_name_c)) {return true;}
+  if (typeid(*second_type) == typeid(direct_variable_type_name_c)) {return true;}
+  return false;
+}
+
+symbol_c* search_expression_type_c::common_type(symbol_c *first_type, symbol_c *second_type) {
+  if (first_type == NULL && second_type == NULL) {return NULL;}
+  if (first_type == NULL) {return second_type;}
+  if (second_type == NULL) {return first_type;}
+  if (typeid(*first_type) == typeid(*second_type)) {return first_type;}
+  if (is_integer_type(first_type) && (typeid(*second_type) == typeid(constant_int_type_name_c) || typeid(*second_type) == typeid(direct_variable_type_name_c))) {return first_type;}
+  if ((typeid(*first_type) == typeid(constant_int_type_name_c) || typeid(*second_type) == typeid(direct_variable_type_name_c)) && is_integer_type(second_type)) {return second_type;}
+  if (is_binary_type(first_type) && (typeid(*second_type) == typeid(constant_int_type_name_c) || typeid(*second_type) == typeid(direct_variable_type_name_c))) {return first_type;}
+  if ((typeid(*first_type) == typeid(constant_int_type_name_c) || typeid(*second_type) == typeid(direct_variable_type_name_c)) && is_binary_type(second_type)) {return second_type;}
+  if (is_real_type(first_type) && (typeid(*second_type) == typeid(constant_real_type_name_c) || typeid(*second_type) == typeid(direct_variable_type_name_c))) {return first_type;}
+  if ((typeid(*first_type) == typeid(constant_real_type_name_c) || typeid(*second_type) == typeid(direct_variable_type_name_c)) && is_real_type(second_type)) {return second_type;}
+  return NULL;
+}
+
+#define compute_standard_function_default search_expression_type_c::compute_standard_function_default
+#define compute_standard_function_il search_expression_type_c::compute_standard_function_il
+#include "search_type_code.c"
+#undef compute_standard_function_default
+#undef compute_standard_function_il
+
+/*static bool_type_name_c bool_type_name;*/
+
+/* A helper function... */
+void *search_expression_type_c::compute_boolean_expression(symbol_c *left_type, symbol_c *right_type) {
+  if (!is_same_type(left_type, right_type))
+    ERROR;
+  if (!is_bool_type(left_type) && !is_binary_type(left_type))
+    ERROR;
+  if (typeid(*left_type) == typeid(constant_int_type_name_c)) {return (void *)right_type;}
+  else {return (void *)left_type;}
+}
+
+/* A helper function... */
+void *search_expression_type_c::compute_numeric_expression(symbol_c *left_type, symbol_c *right_type) {
+  if (!is_same_type(left_type, right_type))
+    ERROR;
+  if (!is_integer_type(left_type) && !is_real_type(left_type))
+    ERROR;
+  if ((typeid(*left_type) == typeid(constant_int_type_name_c)) || (typeid(*left_type) == typeid(constant_real_type_name_c))) {return (void *)right_type;}
+  else {return (void *)left_type;}
+  return NULL;
+}
+
+/* a helper function... */
+symbol_c *search_expression_type_c::base_type(symbol_c *symbol) {
+  return (symbol_c *)symbol->accept(search_base_type);
+}
+
+/*********************/
+/* B 1.4 - Variables */
+/*********************/
+
+void *search_expression_type_c::visit(symbolic_variable_c *symbol) {
+  symbol_c *res;
+  
+  /* Nope, now we assume it is a variable, and determine its type... */
+  res = search_varfb_instance_type->get_type(symbol);
+  if (NULL != res) return res;
+  
+  return NULL;
+}
+
+/********************************************/
+/* B 1.4.1 - Directly Represented Variables */
+/********************************************/
+void *search_expression_type_c::visit(direct_variable_c *symbol) {
+  switch (symbol->value[2]) {
+    case 'X': // bit
+      return (void *)&bool_type_name;
+    default:
+      return (void *)&direct_variable_type_name;
+   }
+}
+
+/*************************************/
+/* B 1.4.2 - Multi-element variables */
+/*************************************/
+
+void *search_expression_type_c::visit(array_variable_c *symbol) {
+  symbol_c *res;
+  
+  /* Nope, now we assume it is a variable, and determine its type... */
+  res = search_varfb_instance_type->get_type(symbol);
+  if (NULL != res) return res;
+  
+  return NULL;
+}
+
+void *search_expression_type_c::visit(structured_variable_c *symbol) {
+  symbol_c *res;
+  
+  /* Nope, now we assume it is a variable, and determine its type... */
+  res = search_varfb_instance_type->get_type(symbol);
+  if (NULL != res) return res;
+  
+  return NULL;
+}
+
+/***************************************/
+/* B.3 - Language ST (Structured Text) */
+/***************************************/
+/***********************/
+/* B 3.1 - Expressions */
+/***********************/
+void *search_expression_type_c::visit(or_expression_c *symbol) {
+  symbol_c *left_type = base_type((symbol_c *)symbol->l_exp->accept(*this));
+  symbol_c *right_type = base_type((symbol_c *)symbol->r_exp->accept(*this));
+  return compute_boolean_expression(left_type, right_type);
+}
+
+void *search_expression_type_c::visit(xor_expression_c *symbol) {
+  symbol_c *left_type = base_type((symbol_c *)symbol->l_exp->accept(*this));
+  symbol_c *right_type = base_type((symbol_c *)symbol->r_exp->accept(*this));
+  return compute_boolean_expression(left_type, right_type);
+}
+
+void *search_expression_type_c::visit(and_expression_c *symbol) {
+  symbol_c *left_type = base_type((symbol_c *)symbol->l_exp->accept(*this));
+  symbol_c *right_type = base_type((symbol_c *)symbol->r_exp->accept(*this));
+  return compute_boolean_expression(left_type, right_type); 
+}
+
+void *search_expression_type_c::visit(equ_expression_c *symbol) {return (void *)&bool_type_name;}
+void *search_expression_type_c::visit(notequ_expression_c *symbol) {return (void *)&bool_type_name;}
+void *search_expression_type_c::visit(lt_expression_c *symbol) {return (void *)&bool_type_name;}
+void *search_expression_type_c::visit(gt_expression_c *symbol) {return (void *)&bool_type_name;}
+void *search_expression_type_c::visit(le_expression_c *symbol) {return (void *)&bool_type_name;}
+void *search_expression_type_c::visit(ge_expression_c *symbol) {return (void *)&bool_type_name;}
+
+void *search_expression_type_c::visit(add_expression_c *symbol) {
+  symbol_c *left_type = base_type((symbol_c *)symbol->l_exp->accept(*this));
+  symbol_c *right_type = base_type((symbol_c *)symbol->r_exp->accept(*this));
+  if (typeid(*left_type) == typeid(time_type_name_c) && typeid(*right_type) == typeid(time_type_name_c)) {return (void *)&time_type_name;}
+  if (typeid(*left_type) == typeid(tod_type_name_c) && typeid(*right_type) == typeid(time_type_name_c)) {return (void *)&tod_type_name;}
+  if (typeid(*left_type) == typeid(dt_type_name_c) && typeid(*right_type) == typeid(time_type_name_c)) {return (void *)&dt_type_name;}
+  return compute_numeric_expression(left_type, right_type);
+}
+
+void *search_expression_type_c::visit(sub_expression_c *symbol) {
+  symbol_c *left_type = base_type((symbol_c *)symbol->l_exp->accept(*this));
+  symbol_c *right_type = base_type((symbol_c *)symbol->r_exp->accept(*this));
+  if (typeid(*left_type) == typeid(time_type_name_c) && typeid(*right_type) == typeid(time_type_name_c)) {return (void *)&time_type_name;}
+  if (typeid(*left_type) == typeid(date_type_name_c) && typeid(*right_type) == typeid(date_type_name_c)) {return (void *)&time_type_name;}
+  if (typeid(*left_type) == typeid(tod_type_name_c) && typeid(*right_type) == typeid(time_type_name_c)) {return (void *)&tod_type_name;}
+  if (typeid(*left_type) == typeid(tod_type_name_c) && typeid(*right_type) == typeid(tod_type_name_c)) {return (void *)&time_type_name;}
+  if (typeid(*left_type) == typeid(dt_type_name_c) && typeid(*right_type) == typeid(time_type_name_c)) {return (void *)&dt_type_name;}
+  if (typeid(*left_type) == typeid(dt_type_name_c) && typeid(*right_type) == typeid(dt_type_name_c)) {return (void *)&time_type_name;}
+  return compute_numeric_expression(left_type, right_type);
+}
+
+void *search_expression_type_c::visit(mul_expression_c *symbol) {
+  symbol_c *left_type = base_type((symbol_c *)symbol->l_exp->accept(*this));
+  symbol_c *right_type = base_type((symbol_c *)symbol->r_exp->accept(*this));
+  if (typeid(*left_type) == typeid(time_type_name_c) && is_num_type(right_type)) {
+      return (void *)&time_type_name;
+  }
+  return compute_numeric_expression(left_type, right_type);
+}
+
+void *search_expression_type_c::visit(div_expression_c *symbol) {
+  symbol_c *left_type = base_type((symbol_c *)symbol->l_exp->accept(*this));
+  symbol_c *right_type = base_type((symbol_c *)symbol->r_exp->accept(*this));
+  if (typeid(*left_type) == typeid(time_type_name_c) && is_num_type(right_type)){
+      return (void *)&time_type_name;
+  }
+  return compute_numeric_expression(left_type, right_type);
+}
+
+void *search_expression_type_c::visit(mod_expression_c *symbol) {
+  symbol_c *left_type = base_type((symbol_c *)symbol->l_exp->accept(*this));
+  symbol_c *right_type = base_type((symbol_c *)symbol->r_exp->accept(*this));
+  return compute_numeric_expression(left_type, right_type);
+}
+
+void *search_expression_type_c::visit(power_expression_c *symbol) {
+  symbol_c *left_type = base_type((symbol_c *)symbol->l_exp->accept(*this));
+  symbol_c *right_type = base_type((symbol_c *)symbol->r_exp->accept(*this));
+  if (is_real_type(left_type) && is_num_type(right_type)) {
+      return (void *)left_type;
+  }
+  ERROR;
+  return NULL;
+}
+
+void *search_expression_type_c::visit(neg_expression_c *symbol) {
+  symbol_c *exp_type = base_type((symbol_c *)symbol->exp->accept(*this));
+  if (is_num_type(exp_type) || typeid(*exp_type) == typeid(time_type_name_c)){
+      return (void *)exp_type;
+  }
+  ERROR;
+  return NULL;
+}
+
+void *search_expression_type_c::visit(not_expression_c *symbol) {
+  symbol_c *exp_type = base_type((symbol_c *)symbol->exp->accept(*this));
+  return compute_boolean_expression(exp_type, exp_type);
+}
+
+void *search_expression_type_c::visit(function_invocation_c *symbol) {
+  function_declaration_c *f_decl = function_symtable.find_value(symbol->function_name);
+  if (f_decl == function_symtable.end_value()) {
+    void *res = compute_standard_function_default(symbol);
+    if (res == NULL)
+       ERROR;
+    return res;
+  }
+  return base_type(f_decl->type_name);
+}
+
+/*bool_type_name_c     search_expression_type_c::bool_type_name;*/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/search_expression_type.hh	Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,126 @@
+/*
+ * (c) 2003 Mario de Sousa
+ *
+ * Offered to the public under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 IL and ST compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+/* Determine the data type of an ST expression.
+ * A reference to the relevant type definition is returned.
+ *
+ * For example:
+ *       2 + 3       -> returns reference to a int_type_name_c object.
+ *       22.2 - 5    -> returns reference to a real_type_name_c object.
+ *       etc...
+ */
+
+class search_expression_type_c: public search_constant_type_c {
+
+  private:
+    search_varfb_instance_type_c *search_varfb_instance_type;
+    search_base_type_c search_base_type;
+
+
+  public:
+    search_expression_type_c(symbol_c *search_scope);
+    virtual ~search_expression_type_c(void);
+
+    /* A helper function... */
+    bool is_bool_type(symbol_c *type_symbol);
+    bool is_time_type(symbol_c *type_symbol);
+    bool is_string_type(symbol_c *type_symbol);
+    bool is_integer_type(symbol_c *type_symbol);
+    bool is_real_type(symbol_c *type_symbol);
+    bool is_num_type(symbol_c *type_symbol);
+    bool is_nbinary_type(symbol_c *type_symbol);
+    bool is_binary_type(symbol_c *type_symbol);
+
+    bool is_same_type(symbol_c *first_type, symbol_c *second_type);
+    symbol_c* common_type(symbol_c *first_type, symbol_c *second_type);
+
+    /*
+    #include "search_type_code.c"
+    */
+    void *compute_standard_function_default(function_invocation_c *st_symbol, il_formal_funct_call_c *il_symbol);
+    /*
+    void *compute_standard_function_default(function_invocation_c *st_symbol = NULL, il_formal_funct_call_c *il_symbol = NULL);
+    */
+    void *compute_standard_function_il(il_function_call_c *symbol, symbol_c *param_data_type);
+
+
+
+    /*static bool_type_name_c bool_type_name;*/
+
+    /* A helper function... */
+    void *compute_boolean_expression(symbol_c *left_type, symbol_c *right_type);
+
+    /* A helper function... */
+    void *compute_numeric_expression(symbol_c *left_type, symbol_c *right_type);
+
+    /* a helper function... */
+    symbol_c *base_type(symbol_c *symbol);
+
+    /*********************/
+    /* B 1.4 - Variables */
+    /*********************/
+    
+    void *visit(symbolic_variable_c *symbol);
+
+    /********************************************/
+    /* B 1.4.1 - Directly Represented Variables */
+    /********************************************/
+    void *visit(direct_variable_c *symbol);
+
+    /*************************************/
+    /* B 1.4.2 - Multi-element variables */
+    /*************************************/
+ 
+    void *visit(array_variable_c *symbol);
+    void *visit(structured_variable_c *symbol);
+
+    /***************************************/
+    /* B.3 - Language ST (Structured Text) */
+    /***************************************/
+    /***********************/
+    /* B 3.1 - Expressions */
+    /***********************/
+    void *visit(or_expression_c *symbol);
+    void *visit(xor_expression_c *symbol);
+    void *visit(and_expression_c *symbol);
+    void *visit(equ_expression_c *symbol);
+    void *visit(notequ_expression_c *symbol);
+    void *visit(lt_expression_c *symbol);
+    void *visit(gt_expression_c *symbol);
+    void *visit(le_expression_c *symbol);
+    void *visit(ge_expression_c *symbol);
+    
+    void *visit(add_expression_c *symbol);
+    void *visit(sub_expression_c *symbol);
+    void *visit(mul_expression_c *symbol);
+    void *visit(div_expression_c *symbol);
+    void *visit(mod_expression_c *symbol);
+    void *visit(power_expression_c *symbol);
+    void *visit(neg_expression_c *symbol);
+    void *visit(not_expression_c *symbol);
+    void *visit(function_invocation_c *symbol);
+}; // search_expression_type_c
+
+/*bool_type_name_c     search_expression_type_c::bool_type_name;*/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/search_fb_instance_decl.cc	Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,128 @@
+/*
+ * (c) 2003 Mario de Sousa
+ *
+ * Offered to the public under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 IL and ST compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+#include "absyntax_utils.hh"
+
+
+/* Returns the function block type declaration
+ * of a specific function block instance.
+ */
+
+
+
+/* Returns the type name of a specific function block
+ * instance. This class will search the variable
+ * declarations inside the scope given to it
+ * searching for the declaration of the function
+ * block instance.
+ *
+ * The class constructor must be given the search scope
+ * (function, function block or program within which
+ * the function block instance was declared).
+ *
+ * This class will search the tree from the root given to the
+ * constructor. Another option would be to build a symbol table,
+ * and search that instead. Building the symbol table would be done
+ * while visiting the variable declaration objects in the parse
+ * tree. Unfortuantely, generate_c_c does not visit these
+ * objects, delegating it to another class. This means that
+ * we would need another specialised class just to build the
+ * symbol table. We might just as well have a specialised class
+ * that searches the tree itself for the relevant info. This
+ * class is exactly that...!
+ */
+search_fb_instance_decl_c::search_fb_instance_decl_c(symbol_c *search_scope) {
+  this->search_scope = search_scope;
+  this->current_fb_type_name = NULL;
+}
+
+symbol_c *search_fb_instance_decl_c::get_type_name(symbol_c *fb_instance_name) {
+  this->search_name = fb_instance_name;
+  return (symbol_c *)search_scope->accept(*this);
+}
+
+/***************************/
+/* B 0 - Programming Model */
+/***************************/
+void *search_fb_instance_decl_c::visit(library_c *symbol) {
+  /* we do not want to search multiple declaration scopes,
+   * so we do not visit all the functions, fucntion blocks, etc...
+   */
+  return NULL;
+}
+
+/******************************************/
+/* B 1.4.3 - Declaration & Initialisation */
+/******************************************/
+
+/* name_list ':' function_block_type_name ASSIGN structure_initialization */
+/* structure_initialization -> may be NULL ! */
+void *search_fb_instance_decl_c::visit(fb_name_decl_c *symbol) {
+  current_fb_type_name = symbol->function_block_type_name;
+  return symbol->fb_name_list->accept(*this);
+}
+
+/* name_list ',' fb_name */
+void *search_fb_instance_decl_c::visit(fb_name_list_c *symbol) {
+  list_c *list = symbol;
+  for(int i = 0; i < list->n; i++) {
+    if (compare_identifiers(list->elements[i], search_name) == 0)
+  /* by now, current_fb_declaration should be != NULL */
+      return current_fb_type_name;
+  }
+  return NULL;
+}
+
+/**************************************/
+/* B.1.5 - Program organization units */
+/**************************************/
+/***********************/
+/* B 1.5.1 - Functions */
+/***********************/
+void *search_fb_instance_decl_c::visit(function_declaration_c *symbol) {
+  /* no need to search through all the body, so we only
+   * visit the variable declarations...!
+   */
+  return symbol->var_declarations_list->accept(*this);
+}
+
+/*****************************/
+/* B 1.5.2 - Function Blocks */
+/*****************************/
+void *search_fb_instance_decl_c::visit(function_block_declaration_c *symbol) {
+  /* no need to search through all the body, so we only
+   * visit the variable declarations...!
+   */
+  return symbol->var_declarations->accept(*this);
+}
+
+/**********************/
+/* B 1.5.3 - Programs */
+/**********************/
+void *search_fb_instance_decl_c::visit(program_declaration_c *symbol) {
+  /* no need to search through all the body, so we only
+   * visit the variable declarations...!
+   */
+  return symbol->var_declarations->accept(*this);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/search_fb_instance_decl.hh	Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,105 @@
+/*
+ * (c) 2003 Mario de Sousa
+ *
+ * Offered to the public under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 IL and ST compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+
+
+/* Returns the function block type declaration
+ * of a specific function block instance.
+ */
+
+
+
+/* Returns the type name of a specific function block
+ * instance. This class will search the variable
+ * declarations inside the scope given to it
+ * searching for the declaration of the function
+ * block instance.
+ *
+ * The class constructor must be given the search scope
+ * (function, function block or program within which
+ * the function block instance was declared).
+ *
+ * This class will search the tree from the root given to the
+ * constructor. Another option would be to build a symbol table,
+ * and search that instead. Building the symbol table would be done
+ * while visiting the variable declaration objects in the parse
+ * tree. Unfortuantely, generate_c_c does not visit these
+ * objects, delegating it to another class. This means that
+ * we would need another specialised class just to build the
+ * symbol table. We might just as well have a specialised class
+ * that searches the tree itself for the relevant info. This
+ * class is exactly that...!
+ */
+
+
+class search_fb_instance_decl_c: public search_visitor_c {
+
+  private:
+    symbol_c *search_scope;
+
+    symbol_c *search_name;
+    symbol_c *current_fb_type_name;
+
+  public:
+    search_fb_instance_decl_c(symbol_c *search_scope);
+    symbol_c *get_type_name(symbol_c *fb_instance_name);
+
+  public:
+  /***************************/
+  /* B 0 - Programming Model */
+  /***************************/
+    void *visit(library_c *symbol);
+
+  /******************************************/
+  /* B 1.4.3 - Declaration & Initialisation */
+  /******************************************/
+  
+  /* name_list ':' function_block_type_name ASSIGN structure_initialization */
+  /* structure_initialization -> may be NULL ! */
+    void *visit(fb_name_decl_c *symbol);
+  /* name_list ',' fb_name */
+    void *visit(fb_name_list_c *symbol);
+
+  /**************************************/
+  /* B.1.5 - Program organization units */
+  /**************************************/
+  /***********************/
+  /* B 1.5.1 - Functions */
+  /***********************/
+    void *visit(function_declaration_c *symbol);
+
+  /*****************************/
+  /* B 1.5.2 - Function Blocks */
+  /*****************************/
+    void *visit(function_block_declaration_c *symbol);
+
+  /**********************/
+  /* B 1.5.3 - Programs */
+  /**********************/
+    void *visit(program_declaration_c *symbol);
+}; // search_fb_instance_decl_c
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/search_fb_typedecl.cc	Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,61 @@
+/*
+ * (c) 2003 Mario de Sousa
+ *
+ * Offered to the public under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 IL and ST compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+/* Returns the function block declaration symbol
+ * of a specific function block type.
+ */
+
+#include "absyntax_utils.hh"
+
+
+search_fb_typedecl_c::search_fb_typedecl_c(symbol_c *search_scope) {
+  this->search_scope = search_scope;
+}
+
+symbol_c *search_fb_typedecl_c::get_decl(symbol_c *fb_type_name) {
+  this->search_name = fb_type_name;
+  return (symbol_c *)search_scope->accept(*this);
+}
+/**************************************/
+/* B.1.5 - Program organization units */
+/**************************************/
+
+/*****************************/
+/* B 1.5.2 - Function Blocks */
+/*****************************/
+void *search_fb_typedecl_c::visit(function_block_declaration_c *symbol) {
+  if (compare_identifiers(symbol->fblock_name, search_name) == 0)
+    return symbol;
+  return NULL;
+}
+
+/**********************/
+/* B 1.5.3 - Programs */
+/**********************/
+void *search_fb_typedecl_c::visit(program_declaration_c *symbol) {
+  if (compare_identifiers(symbol->program_type_name, search_name) == 0)
+    return symbol;
+  return NULL;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/search_fb_typedecl.hh	Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,55 @@
+/*
+ * (c) 2003 Mario de Sousa
+ *
+ * Offered to the public under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 IL and ST compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+
+/* Returns the function block declaration symbol
+ * of a specific function block type.
+ */
+
+class search_fb_typedecl_c: public search_visitor_c {
+
+  private:
+    symbol_c *search_scope;
+
+    symbol_c *search_name;
+
+  public:
+    search_fb_typedecl_c(symbol_c *search_scope);
+    symbol_c *get_decl(symbol_c *fb_type_name);
+
+  private:
+    /**************************************/
+    /* B.1.5 - Program organization units */
+    /**************************************/
+
+    /*****************************/
+    /* B 1.5.2 - Function Blocks */
+    /*****************************/
+    void *visit(function_block_declaration_c *symbol);
+
+    /**********************/
+    /* B 1.5.3 - Programs */
+    /**********************/
+    void *visit(program_declaration_c *symbol);
+}; // search_fb_typedecl_c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/search_type_code.c	Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,28662 @@
+/*
+ * (c) 2008 Edouard TISSERANT
+ *
+ * Offered to the public under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 IL and ST compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+/****
+ * IEC 61131-3 standard function library
+ * generated code, do not edit by hand
+ */
+ 
+ 
+
+void *compute_standard_function_default(function_invocation_c *st_symbol = NULL, il_formal_funct_call_c *il_symbol = NULL) {
+  function_type_t current_function_type;
+  function_call_param_iterator_c *tmp_function_call_param_iterator;
+  if (st_symbol != NULL && il_symbol == NULL) {
+    current_function_type = get_function_type((identifier_c *)st_symbol->function_name);
+    tmp_function_call_param_iterator = new function_call_param_iterator_c(st_symbol);
+  }
+  else if (st_symbol == NULL && il_symbol != NULL) {
+    current_function_type = get_function_type((identifier_c *)il_symbol->function_name);
+    tmp_function_call_param_iterator = new function_call_param_iterator_c(il_symbol);
+  }
+  else
+    ERROR;
+  function_call_param_iterator_c function_call_param_iterator(*tmp_function_call_param_iterator);
+  search_expression_type_c* search_expression_type = this;
+
+  switch(current_function_type){
+
+/****
+ *REAL_TO_SINT
+ */
+    case function_real_to_sint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_real_to_sint*/
+    break;
+
+/****
+ *REAL_TO_LINT
+ */
+    case function_real_to_lint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_real_to_lint*/
+    break;
+
+/****
+ *REAL_TO_DINT
+ */
+    case function_real_to_dint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_real_to_dint*/
+    break;
+
+/****
+ *REAL_TO_DATE
+ */
+    case function_real_to_date :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_real_to_date*/
+    break;
+
+/****
+ *REAL_TO_DWORD
+ */
+    case function_real_to_dword :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_real_to_dword*/
+    break;
+
+/****
+ *REAL_TO_DT
+ */
+    case function_real_to_dt :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_real_to_dt*/
+    break;
+
+/****
+ *REAL_TO_TOD
+ */
+    case function_real_to_tod :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_real_to_tod*/
+    break;
+
+/****
+ *REAL_TO_UDINT
+ */
+    case function_real_to_udint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_real_to_udint*/
+    break;
+
+/****
+ *REAL_TO_WORD
+ */
+    case function_real_to_word :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_real_to_word*/
+    break;
+
+/****
+ *REAL_TO_STRING
+ */
+    case function_real_to_string :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_real_to_string*/
+    break;
+
+/****
+ *REAL_TO_LWORD
+ */
+    case function_real_to_lword :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_real_to_lword*/
+    break;
+
+/****
+ *REAL_TO_UINT
+ */
+    case function_real_to_uint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_real_to_uint*/
+    break;
+
+/****
+ *REAL_TO_LREAL
+ */
+    case function_real_to_lreal :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_real_to_lreal*/
+    break;
+
+/****
+ *REAL_TO_BYTE
+ */
+    case function_real_to_byte :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_real_to_byte*/
+    break;
+
+/****
+ *REAL_TO_USINT
+ */
+    case function_real_to_usint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_real_to_usint*/
+    break;
+
+/****
+ *REAL_TO_ULINT
+ */
+    case function_real_to_ulint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_real_to_ulint*/
+    break;
+
+/****
+ *REAL_TO_BOOL
+ */
+    case function_real_to_bool :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_real_to_bool*/
+    break;
+
+/****
+ *REAL_TO_TIME
+ */
+    case function_real_to_time :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_real_to_time*/
+    break;
+
+/****
+ *REAL_TO_INT
+ */
+    case function_real_to_int :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_real_to_int*/
+    break;
+
+/****
+ *SINT_TO_REAL
+ */
+    case function_sint_to_real :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_sint_to_real*/
+    break;
+
+/****
+ *SINT_TO_LINT
+ */
+    case function_sint_to_lint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_sint_to_lint*/
+    break;
+
+/****
+ *SINT_TO_DINT
+ */
+    case function_sint_to_dint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_sint_to_dint*/
+    break;
+
+/****
+ *SINT_TO_DATE
+ */
+    case function_sint_to_date :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_sint_to_date*/
+    break;
+
+/****
+ *SINT_TO_DWORD
+ */
+    case function_sint_to_dword :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_sint_to_dword*/
+    break;
+
+/****
+ *SINT_TO_DT
+ */
+    case function_sint_to_dt :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_sint_to_dt*/
+    break;
+
+/****
+ *SINT_TO_TOD
+ */
+    case function_sint_to_tod :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_sint_to_tod*/
+    break;
+
+/****
+ *SINT_TO_UDINT
+ */
+    case function_sint_to_udint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_sint_to_udint*/
+    break;
+
+/****
+ *SINT_TO_WORD
+ */
+    case function_sint_to_word :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_sint_to_word*/
+    break;
+
+/****
+ *SINT_TO_STRING
+ */
+    case function_sint_to_string :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_sint_to_string*/
+    break;
+
+/****
+ *SINT_TO_LWORD
+ */
+    case function_sint_to_lword :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_sint_to_lword*/
+    break;
+
+/****
+ *SINT_TO_UINT
+ */
+    case function_sint_to_uint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_sint_to_uint*/
+    break;
+
+/****
+ *SINT_TO_LREAL
+ */
+    case function_sint_to_lreal :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_sint_to_lreal*/
+    break;
+
+/****
+ *SINT_TO_BYTE
+ */
+    case function_sint_to_byte :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_sint_to_byte*/
+    break;
+
+/****
+ *SINT_TO_USINT
+ */
+    case function_sint_to_usint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_sint_to_usint*/
+    break;
+
+/****
+ *SINT_TO_ULINT
+ */
+    case function_sint_to_ulint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_sint_to_ulint*/
+    break;
+
+/****
+ *SINT_TO_BOOL
+ */
+    case function_sint_to_bool :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_sint_to_bool*/
+    break;
+
+/****
+ *SINT_TO_TIME
+ */
+    case function_sint_to_time :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_sint_to_time*/
+    break;
+
+/****
+ *SINT_TO_INT
+ */
+    case function_sint_to_int :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_sint_to_int*/
+    break;
+
+/****
+ *LINT_TO_REAL
+ */
+    case function_lint_to_real :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_lint_to_real*/
+    break;
+
+/****
+ *LINT_TO_SINT
+ */
+    case function_lint_to_sint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_lint_to_sint*/
+    break;
+
+/****
+ *LINT_TO_DINT
+ */
+    case function_lint_to_dint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_lint_to_dint*/
+    break;
+
+/****
+ *LINT_TO_DATE
+ */
+    case function_lint_to_date :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_lint_to_date*/
+    break;
+
+/****
+ *LINT_TO_DWORD
+ */
+    case function_lint_to_dword :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_lint_to_dword*/
+    break;
+
+/****
+ *LINT_TO_DT
+ */
+    case function_lint_to_dt :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_lint_to_dt*/
+    break;
+
+/****
+ *LINT_TO_TOD
+ */
+    case function_lint_to_tod :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_lint_to_tod*/
+    break;
+
+/****
+ *LINT_TO_UDINT
+ */
+    case function_lint_to_udint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_lint_to_udint*/
+    break;
+
+/****
+ *LINT_TO_WORD
+ */
+    case function_lint_to_word :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_lint_to_word*/
+    break;
+
+/****
+ *LINT_TO_STRING
+ */
+    case function_lint_to_string :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_lint_to_string*/
+    break;
+
+/****
+ *LINT_TO_LWORD
+ */
+    case function_lint_to_lword :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_lint_to_lword*/
+    break;
+
+/****
+ *LINT_TO_UINT
+ */
+    case function_lint_to_uint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_lint_to_uint*/
+    break;
+
+/****
+ *LINT_TO_LREAL
+ */
+    case function_lint_to_lreal :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_lint_to_lreal*/
+    break;
+
+/****
+ *LINT_TO_BYTE
+ */
+    case function_lint_to_byte :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_lint_to_byte*/
+    break;
+
+/****
+ *LINT_TO_USINT
+ */
+    case function_lint_to_usint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_lint_to_usint*/
+    break;
+
+/****
+ *LINT_TO_ULINT
+ */
+    case function_lint_to_ulint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_lint_to_ulint*/
+    break;
+
+/****
+ *LINT_TO_BOOL
+ */
+    case function_lint_to_bool :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_lint_to_bool*/
+    break;
+
+/****
+ *LINT_TO_TIME
+ */
+    case function_lint_to_time :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_lint_to_time*/
+    break;
+
+/****
+ *LINT_TO_INT
+ */
+    case function_lint_to_int :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_lint_to_int*/
+    break;
+
+/****
+ *DINT_TO_REAL
+ */
+    case function_dint_to_real :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_dint_to_real*/
+    break;
+
+/****
+ *DINT_TO_SINT
+ */
+    case function_dint_to_sint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_dint_to_sint*/
+    break;
+
+/****
+ *DINT_TO_LINT
+ */
+    case function_dint_to_lint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_dint_to_lint*/
+    break;
+
+/****
+ *DINT_TO_DATE
+ */
+    case function_dint_to_date :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_dint_to_date*/
+    break;
+
+/****
+ *DINT_TO_DWORD
+ */
+    case function_dint_to_dword :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_dint_to_dword*/
+    break;
+
+/****
+ *DINT_TO_DT
+ */
+    case function_dint_to_dt :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_dint_to_dt*/
+    break;
+
+/****
+ *DINT_TO_TOD
+ */
+    case function_dint_to_tod :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_dint_to_tod*/
+    break;
+
+/****
+ *DINT_TO_UDINT
+ */
+    case function_dint_to_udint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_dint_to_udint*/
+    break;
+
+/****
+ *DINT_TO_WORD
+ */
+    case function_dint_to_word :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_dint_to_word*/
+    break;
+
+/****
+ *DINT_TO_STRING
+ */
+    case function_dint_to_string :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_dint_to_string*/
+    break;
+
+/****
+ *DINT_TO_LWORD
+ */
+    case function_dint_to_lword :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_dint_to_lword*/
+    break;
+
+/****
+ *DINT_TO_UINT
+ */
+    case function_dint_to_uint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_dint_to_uint*/
+    break;
+
+/****
+ *DINT_TO_LREAL
+ */
+    case function_dint_to_lreal :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_dint_to_lreal*/
+    break;
+
+/****
+ *DINT_TO_BYTE
+ */
+    case function_dint_to_byte :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_dint_to_byte*/
+    break;
+
+/****
+ *DINT_TO_USINT
+ */
+    case function_dint_to_usint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_dint_to_usint*/
+    break;
+
+/****
+ *DINT_TO_ULINT
+ */
+    case function_dint_to_ulint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_dint_to_ulint*/
+    break;
+
+/****
+ *DINT_TO_BOOL
+ */
+    case function_dint_to_bool :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_dint_to_bool*/
+    break;
+
+/****
+ *DINT_TO_TIME
+ */
+    case function_dint_to_time :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_dint_to_time*/
+    break;
+
+/****
+ *DINT_TO_INT
+ */
+    case function_dint_to_int :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_dint_to_int*/
+    break;
+
+/****
+ *DATE_TO_REAL
+ */
+    case function_date_to_real :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_date_to_real*/
+    break;
+
+/****
+ *DATE_TO_SINT
+ */
+    case function_date_to_sint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_date_to_sint*/
+    break;
+
+/****
+ *DATE_TO_LINT
+ */
+    case function_date_to_lint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_date_to_lint*/
+    break;
+
+/****
+ *DATE_TO_DINT
+ */
+    case function_date_to_dint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_date_to_dint*/
+    break;
+
+/****
+ *DATE_TO_DWORD
+ */
+    case function_date_to_dword :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_date_to_dword*/
+    break;
+
+/****
+ *DATE_TO_UDINT
+ */
+    case function_date_to_udint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_date_to_udint*/
+    break;
+
+/****
+ *DATE_TO_WORD
+ */
+    case function_date_to_word :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_date_to_word*/
+    break;
+
+/****
+ *DATE_TO_STRING
+ */
+    case function_date_to_string :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_date_to_string*/
+    break;
+
+/****
+ *DATE_TO_LWORD
+ */
+    case function_date_to_lword :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_date_to_lword*/
+    break;
+
+/****
+ *DATE_TO_UINT
+ */
+    case function_date_to_uint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_date_to_uint*/
+    break;
+
+/****
+ *DATE_TO_LREAL
+ */
+    case function_date_to_lreal :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_date_to_lreal*/
+    break;
+
+/****
+ *DATE_TO_BYTE
+ */
+    case function_date_to_byte :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_date_to_byte*/
+    break;
+
+/****
+ *DATE_TO_USINT
+ */
+    case function_date_to_usint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_date_to_usint*/
+    break;
+
+/****
+ *DATE_TO_ULINT
+ */
+    case function_date_to_ulint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_date_to_ulint*/
+    break;
+
+/****
+ *DATE_TO_INT
+ */
+    case function_date_to_int :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_date_to_int*/
+    break;
+
+/****
+ *DWORD_TO_REAL
+ */
+    case function_dword_to_real :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_dword_to_real*/
+    break;
+
+/****
+ *DWORD_TO_SINT
+ */
+    case function_dword_to_sint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_dword_to_sint*/
+    break;
+
+/****
+ *DWORD_TO_LINT
+ */
+    case function_dword_to_lint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_dword_to_lint*/
+    break;
+
+/****
+ *DWORD_TO_DINT
+ */
+    case function_dword_to_dint :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_dword_to_dint*/
+    break;
+
+/****
+ *DWORD_TO_DATE
+ */
+    case function_dword_to_date :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_dword_to_date*/
+    break;
+
+/****
+ *DWORD_TO_DT
+ */
+    case function_dword_to_dt :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */
+            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
+            symbol_c *IN_type_symbol = NULL;
+            
+            /* Get the value from a foo(<param_value>) style call */
+            if (IN_param_value == NULL)
+              IN_param_value = function_call_param_iterator.next();
+            if (IN_param_value != NULL) {
+              IN_type_symbol = search_expression_type->get_type(IN_param_value);
+              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
+            }
+            
+            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
+            {
+        
+                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+                return return_type_symbol;
+                
+            }
+            
+            
+            ERROR;
+        }
+        
+    }/*function_dword_to_dt*/
+    break;
+
+/****
+ *DWORD_TO_TOD
+ */
+    case function_dword_to_tod :
+    {
+        symbol_c *last_type_symbol = NULL;
+
+        {
+            identifier_c param_name("IN");
+            /* Get the value from a foo(<param_name> = <param_value>) style call */