--- 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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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 */
+ symbol_c *IN_param_value = function_call_param_iterator.search(¶m_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::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dword_to_tod*/
+ break;
+
+/****
+ *DWORD_TO_UDINT
+ */
+ case function_dword_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(¶m_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::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dword_to_udint*/
+ break;
+
+/****
+ *DWORD_TO_WORD
+ */
+ case function_dword_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(¶m_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::word_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dword_to_word*/
+ break;
+
+/****
+ *DWORD_TO_STRING
+ */
+ case function_dword_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(¶m_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::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dword_to_string*/
+ break;
+
+/****
+ *DWORD_TO_LWORD
+ */
+ case function_dword_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(¶m_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::lword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dword_to_lword*/
+ break;
+
+/****
+ *DWORD_TO_UINT
+ */
+ case function_dword_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(¶m_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::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dword_to_uint*/
+ break;
+
+/****
+ *DWORD_TO_LREAL
+ */
+ case function_dword_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(¶m_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::lreal_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dword_to_lreal*/
+ break;
+
+/****
+ *DWORD_TO_BYTE
+ */
+ case function_dword_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(¶m_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::byte_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dword_to_byte*/
+ break;
+
+/****
+ *DWORD_TO_USINT
+ */
+ case function_dword_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(¶m_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::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dword_to_usint*/
+ break;
+
+/****
+ *DWORD_TO_ULINT
+ */
+ case function_dword_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(¶m_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::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dword_to_ulint*/
+ break;
+
+/****
+ *DWORD_TO_BOOL
+ */
+ case function_dword_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(¶m_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::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dword_to_bool*/
+ break;
+
+/****
+ *DWORD_TO_TIME
+ */
+ case function_dword_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(¶m_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::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dword_to_time*/
+ break;
+
+/****
+ *DWORD_TO_INT
+ */
+ case function_dword_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(¶m_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::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dword_to_int*/
+ break;
+
+/****
+ *DT_TO_REAL
+ */
+ case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_real*/
+ break;
+
+/****
+ *DT_TO_SINT
+ */
+ case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_sint*/
+ break;
+
+/****
+ *DT_TO_LINT
+ */
+ case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_lint*/
+ break;
+
+/****
+ *DT_TO_DINT
+ */
+ case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_dint*/
+ break;
+
+/****
+ *DT_TO_DWORD
+ */
+ case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_dword*/
+ break;
+
+/****
+ *DT_TO_UDINT
+ */
+ case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_udint*/
+ break;
+
+/****
+ *DT_TO_WORD
+ */
+ case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_word*/
+ break;
+
+/****
+ *DT_TO_STRING
+ */
+ case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_string*/
+ break;
+
+/****
+ *DT_TO_LWORD
+ */
+ case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_lword*/
+ break;
+
+/****
+ *DT_TO_UINT
+ */
+ case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_uint*/
+ break;
+
+/****
+ *DT_TO_LREAL
+ */
+ case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_lreal*/
+ break;
+
+/****
+ *DT_TO_BYTE
+ */
+ case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_byte*/
+ break;
+
+/****
+ *DT_TO_USINT
+ */
+ case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_usint*/
+ break;
+
+/****
+ *DT_TO_ULINT
+ */
+ case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_ulint*/
+ break;
+
+/****
+ *DT_TO_INT
+ */
+ case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_int*/
+ break;
+
+/****
+ *TOD_TO_REAL
+ */
+ case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_real*/
+ break;
+
+/****
+ *TOD_TO_SINT
+ */
+ case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_sint*/
+ break;
+
+/****
+ *TOD_TO_LINT
+ */
+ case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_lint*/
+ break;
+
+/****
+ *TOD_TO_DINT
+ */
+ case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_dint*/
+ break;
+
+/****
+ *TOD_TO_DWORD
+ */
+ case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_dword*/
+ break;
+
+/****
+ *TOD_TO_UDINT
+ */
+ case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_udint*/
+ break;
+
+/****
+ *TOD_TO_WORD
+ */
+ case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_word*/
+ break;
+
+/****
+ *TOD_TO_STRING
+ */
+ case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_string*/
+ break;
+
+/****
+ *TOD_TO_LWORD
+ */
+ case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_lword*/
+ break;
+
+/****
+ *TOD_TO_UINT
+ */
+ case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_uint*/
+ break;
+
+/****
+ *TOD_TO_LREAL
+ */
+ case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_lreal*/
+ break;
+
+/****
+ *TOD_TO_BYTE
+ */
+ case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_byte*/
+ break;
+
+/****
+ *TOD_TO_USINT
+ */
+ case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_usint*/
+ break;
+
+/****
+ *TOD_TO_ULINT
+ */
+ case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_ulint*/
+ break;
+
+/****
+ *TOD_TO_INT
+ */
+ case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_int*/
+ break;
+
+/****
+ *UDINT_TO_REAL
+ */
+ case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_real*/
+ break;
+
+/****
+ *UDINT_TO_SINT
+ */
+ case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_sint*/
+ break;
+
+/****
+ *UDINT_TO_LINT
+ */
+ case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_lint*/
+ break;
+
+/****
+ *UDINT_TO_DINT
+ */
+ case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_dint*/
+ break;
+
+/****
+ *UDINT_TO_DATE
+ */
+ case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_date*/
+ break;
+
+/****
+ *UDINT_TO_DWORD
+ */
+ case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_dword*/
+ break;
+
+/****
+ *UDINT_TO_DT
+ */
+ case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_dt*/
+ break;
+
+/****
+ *UDINT_TO_TOD
+ */
+ case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_tod*/
+ break;
+
+/****
+ *UDINT_TO_WORD
+ */
+ case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_word*/
+ break;
+
+/****
+ *UDINT_TO_STRING
+ */
+ case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_string*/
+ break;
+
+/****
+ *UDINT_TO_LWORD
+ */
+ case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_lword*/
+ break;
+
+/****
+ *UDINT_TO_UINT
+ */
+ case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_uint*/
+ break;
+
+/****
+ *UDINT_TO_LREAL
+ */
+ case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_lreal*/
+ break;
+
+/****
+ *UDINT_TO_BYTE
+ */
+ case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_byte*/
+ break;
+
+/****
+ *UDINT_TO_USINT
+ */
+ case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_usint*/
+ break;
+
+/****
+ *UDINT_TO_ULINT
+ */
+ case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_ulint*/
+ break;
+
+/****
+ *UDINT_TO_BOOL
+ */
+ case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_bool*/
+ break;
+
+/****
+ *UDINT_TO_TIME
+ */
+ case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_time*/
+ break;
+
+/****
+ *UDINT_TO_INT
+ */
+ case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_int*/
+ break;
+
+/****
+ *WORD_TO_REAL
+ */
+ case function_word_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(¶m_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::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_real*/
+ break;
+
+/****
+ *WORD_TO_SINT
+ */
+ case function_word_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(¶m_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::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_sint*/
+ break;
+
+/****
+ *WORD_TO_LINT
+ */
+ case function_word_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(¶m_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::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_lint*/
+ break;
+
+/****
+ *WORD_TO_DINT
+ */
+ case function_word_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(¶m_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::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_dint*/
+ break;
+
+/****
+ *WORD_TO_DATE
+ */
+ case function_word_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(¶m_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::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_date*/
+ break;
+
+/****
+ *WORD_TO_DWORD
+ */
+ case function_word_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(¶m_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::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_dword*/
+ break;
+
+/****
+ *WORD_TO_DT
+ */
+ case function_word_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(¶m_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::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_dt*/
+ break;
+
+/****
+ *WORD_TO_TOD
+ */
+ case function_word_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(¶m_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::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_tod*/
+ break;
+
+/****
+ *WORD_TO_UDINT
+ */
+ case function_word_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(¶m_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::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_udint*/
+ break;
+
+/****
+ *WORD_TO_STRING
+ */
+ case function_word_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(¶m_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::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_string*/
+ break;
+
+/****
+ *WORD_TO_LWORD
+ */
+ case function_word_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(¶m_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::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_lword*/
+ break;
+
+/****
+ *WORD_TO_UINT
+ */
+ case function_word_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(¶m_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::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_uint*/
+ break;
+
+/****
+ *WORD_TO_LREAL
+ */
+ case function_word_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(¶m_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::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_lreal*/
+ break;
+
+/****
+ *WORD_TO_BYTE
+ */
+ case function_word_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(¶m_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::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_byte*/
+ break;
+
+/****
+ *WORD_TO_USINT
+ */
+ case function_word_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(¶m_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::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_usint*/
+ break;
+
+/****
+ *WORD_TO_ULINT
+ */
+ case function_word_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(¶m_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::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_ulint*/
+ break;
+
+/****
+ *WORD_TO_BOOL
+ */
+ case function_word_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(¶m_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::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_bool*/
+ break;
+
+/****
+ *WORD_TO_TIME
+ */
+ case function_word_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(¶m_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::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_time*/
+ break;
+
+/****
+ *WORD_TO_INT
+ */
+ case function_word_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(¶m_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::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_int*/
+ break;
+
+/****
+ *STRING_TO_REAL
+ */
+ case function_string_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(¶m_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::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_real*/
+ break;
+
+/****
+ *STRING_TO_SINT
+ */
+ case function_string_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(¶m_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::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_sint*/
+ break;
+
+/****
+ *STRING_TO_LINT
+ */
+ case function_string_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(¶m_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::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_lint*/
+ break;
+
+/****
+ *STRING_TO_DINT
+ */
+ case function_string_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(¶m_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::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_dint*/
+ break;
+
+/****
+ *STRING_TO_DATE
+ */
+ case function_string_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(¶m_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::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_date*/
+ break;
+
+/****
+ *STRING_TO_DWORD
+ */
+ case function_string_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(¶m_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::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_dword*/
+ break;
+
+/****
+ *STRING_TO_DT
+ */
+ case function_string_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(¶m_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::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_dt*/
+ break;
+
+/****
+ *STRING_TO_TOD
+ */
+ case function_string_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(¶m_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::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_tod*/
+ break;
+
+/****
+ *STRING_TO_UDINT
+ */
+ case function_string_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(¶m_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::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_udint*/
+ break;
+
+/****
+ *STRING_TO_WORD
+ */
+ case function_string_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(¶m_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::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_word*/
+ break;
+
+/****
+ *STRING_TO_LWORD
+ */
+ case function_string_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(¶m_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::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_lword*/
+ break;
+
+/****
+ *STRING_TO_UINT
+ */
+ case function_string_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(¶m_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::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_uint*/
+ break;
+
+/****
+ *STRING_TO_LREAL
+ */
+ case function_string_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(¶m_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::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_lreal*/
+ break;
+
+/****
+ *STRING_TO_BYTE
+ */
+ case function_string_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(¶m_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::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_byte*/
+ break;
+
+/****
+ *STRING_TO_USINT
+ */
+ case function_string_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(¶m_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::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_usint*/
+ break;
+
+/****
+ *STRING_TO_ULINT
+ */
+ case function_string_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(¶m_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::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_ulint*/
+ break;
+
+/****
+ *STRING_TO_BOOL
+ */
+ case function_string_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(¶m_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::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_bool*/
+ break;
+
+/****
+ *STRING_TO_TIME
+ */
+ case function_string_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(¶m_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::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_time*/
+ break;
+
+/****
+ *STRING_TO_INT
+ */
+ case function_string_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(¶m_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::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_int*/
+ break;
+
+/****
+ *LWORD_TO_REAL
+ */
+ case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_real*/
+ break;
+
+/****
+ *LWORD_TO_SINT
+ */
+ case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_sint*/
+ break;
+
+/****
+ *LWORD_TO_LINT
+ */
+ case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_lint*/
+ break;
+
+/****
+ *LWORD_TO_DINT
+ */
+ case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_dint*/
+ break;
+
+/****
+ *LWORD_TO_DATE
+ */
+ case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_date*/
+ break;
+
+/****
+ *LWORD_TO_DWORD
+ */
+ case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_dword*/
+ break;
+
+/****
+ *LWORD_TO_DT
+ */
+ case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_dt*/
+ break;
+
+/****
+ *LWORD_TO_TOD
+ */
+ case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_tod*/
+ break;
+
+/****
+ *LWORD_TO_UDINT
+ */
+ case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_udint*/
+ break;
+
+/****
+ *LWORD_TO_WORD
+ */
+ case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_word*/
+ break;
+
+/****
+ *LWORD_TO_STRING
+ */
+ case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_string*/
+ break;
+
+/****
+ *LWORD_TO_UINT
+ */
+ case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_uint*/
+ break;
+
+/****
+ *LWORD_TO_LREAL
+ */
+ case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_lreal*/
+ break;
+
+/****
+ *LWORD_TO_BYTE
+ */
+ case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_byte*/
+ break;
+
+/****
+ *LWORD_TO_USINT
+ */
+ case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_usint*/
+ break;
+
+/****
+ *LWORD_TO_ULINT
+ */
+ case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_ulint*/
+ break;
+
+/****
+ *LWORD_TO_BOOL
+ */
+ case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_bool*/
+ break;
+
+/****
+ *LWORD_TO_TIME
+ */
+ case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_time*/
+ break;
+
+/****
+ *LWORD_TO_INT
+ */
+ case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_int*/
+ break;
+
+/****
+ *UINT_TO_REAL
+ */
+ case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_real*/
+ break;
+
+/****
+ *UINT_TO_SINT
+ */
+ case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_sint*/
+ break;
+
+/****
+ *UINT_TO_LINT
+ */
+ case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_lint*/
+ break;
+
+/****
+ *UINT_TO_DINT
+ */
+ case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_dint*/
+ break;
+
+/****
+ *UINT_TO_DATE
+ */
+ case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_date*/
+ break;
+
+/****
+ *UINT_TO_DWORD
+ */
+ case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_dword*/
+ break;
+
+/****
+ *UINT_TO_DT
+ */
+ case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_dt*/
+ break;
+
+/****
+ *UINT_TO_TOD
+ */
+ case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_tod*/
+ break;
+
+/****
+ *UINT_TO_UDINT
+ */
+ case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_udint*/
+ break;
+
+/****
+ *UINT_TO_WORD
+ */
+ case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_word*/
+ break;
+
+/****
+ *UINT_TO_STRING
+ */
+ case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_string*/
+ break;
+
+/****
+ *UINT_TO_LWORD
+ */
+ case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_lword*/
+ break;
+
+/****
+ *UINT_TO_LREAL
+ */
+ case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_lreal*/
+ break;
+
+/****
+ *UINT_TO_BYTE
+ */
+ case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_byte*/
+ break;
+
+/****
+ *UINT_TO_USINT
+ */
+ case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_usint*/
+ break;
+
+/****
+ *UINT_TO_ULINT
+ */
+ case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_ulint*/
+ break;
+
+/****
+ *UINT_TO_BOOL
+ */
+ case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_bool*/
+ break;
+
+/****
+ *UINT_TO_TIME
+ */
+ case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_time*/
+ break;
+
+/****
+ *UINT_TO_INT
+ */
+ case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_int*/
+ break;
+
+/****
+ *LREAL_TO_REAL
+ */
+ case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_real*/
+ break;
+
+/****
+ *LREAL_TO_SINT
+ */
+ case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_sint*/
+ break;
+
+/****
+ *LREAL_TO_LINT
+ */
+ case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_lint*/
+ break;
+
+/****
+ *LREAL_TO_DINT
+ */
+ case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_dint*/
+ break;
+
+/****
+ *LREAL_TO_DATE
+ */
+ case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_date*/
+ break;
+
+/****
+ *LREAL_TO_DWORD
+ */
+ case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_dword*/
+ break;
+
+/****
+ *LREAL_TO_DT
+ */
+ case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_dt*/
+ break;
+
+/****
+ *LREAL_TO_TOD
+ */
+ case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_tod*/
+ break;
+
+/****
+ *LREAL_TO_UDINT
+ */
+ case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_udint*/
+ break;
+
+/****
+ *LREAL_TO_WORD
+ */
+ case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_word*/
+ break;
+
+/****
+ *LREAL_TO_STRING
+ */
+ case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_string*/
+ break;
+
+/****
+ *LREAL_TO_LWORD
+ */
+ case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_lword*/
+ break;
+
+/****
+ *LREAL_TO_UINT
+ */
+ case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_uint*/
+ break;
+
+/****
+ *LREAL_TO_BYTE
+ */
+ case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_byte*/
+ break;
+
+/****
+ *LREAL_TO_USINT
+ */
+ case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_usint*/
+ break;
+
+/****
+ *LREAL_TO_ULINT
+ */
+ case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_ulint*/
+ break;
+
+/****
+ *LREAL_TO_BOOL
+ */
+ case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_bool*/
+ break;
+
+/****
+ *LREAL_TO_TIME
+ */
+ case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_time*/
+ break;
+
+/****
+ *LREAL_TO_INT
+ */
+ case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_int*/
+ break;
+
+/****
+ *BYTE_TO_REAL
+ */
+ case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_real*/
+ break;
+
+/****
+ *BYTE_TO_SINT
+ */
+ case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_sint*/
+ break;
+
+/****
+ *BYTE_TO_LINT
+ */
+ case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_lint*/
+ break;
+
+/****
+ *BYTE_TO_DINT
+ */
+ case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_dint*/
+ break;
+
+/****
+ *BYTE_TO_DATE
+ */
+ case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_date*/
+ break;
+
+/****
+ *BYTE_TO_DWORD
+ */
+ case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_dword*/
+ break;
+
+/****
+ *BYTE_TO_DT
+ */
+ case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_dt*/
+ break;
+
+/****
+ *BYTE_TO_TOD
+ */
+ case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_tod*/
+ break;
+
+/****
+ *BYTE_TO_UDINT
+ */
+ case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_udint*/
+ break;
+
+/****
+ *BYTE_TO_WORD
+ */
+ case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_word*/
+ break;
+
+/****
+ *BYTE_TO_STRING
+ */
+ case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_string*/
+ break;
+
+/****
+ *BYTE_TO_LWORD
+ */
+ case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_lword*/
+ break;
+
+/****
+ *BYTE_TO_UINT
+ */
+ case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_uint*/
+ break;
+
+/****
+ *BYTE_TO_LREAL
+ */
+ case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_lreal*/
+ break;
+
+/****
+ *BYTE_TO_USINT
+ */
+ case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_usint*/
+ break;
+
+/****
+ *BYTE_TO_ULINT
+ */
+ case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_ulint*/
+ break;
+
+/****
+ *BYTE_TO_BOOL
+ */
+ case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_bool*/
+ break;
+
+/****
+ *BYTE_TO_TIME
+ */
+ case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_time*/
+ break;
+
+/****
+ *BYTE_TO_INT
+ */
+ case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_int*/
+ break;
+
+/****
+ *USINT_TO_REAL
+ */
+ case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_real*/
+ break;
+
+/****
+ *USINT_TO_SINT
+ */
+ case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_sint*/
+ break;
+
+/****
+ *USINT_TO_LINT
+ */
+ case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_lint*/
+ break;
+
+/****
+ *USINT_TO_DINT
+ */
+ case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_dint*/
+ break;
+
+/****
+ *USINT_TO_DATE
+ */
+ case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_date*/
+ break;
+
+/****
+ *USINT_TO_DWORD
+ */
+ case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_dword*/
+ break;
+
+/****
+ *USINT_TO_DT
+ */
+ case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_dt*/
+ break;
+
+/****
+ *USINT_TO_TOD
+ */
+ case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_tod*/
+ break;
+
+/****
+ *USINT_TO_UDINT
+ */
+ case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_udint*/
+ break;
+
+/****
+ *USINT_TO_WORD
+ */
+ case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_word*/
+ break;
+
+/****
+ *USINT_TO_STRING
+ */
+ case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_string*/
+ break;
+
+/****
+ *USINT_TO_LWORD
+ */
+ case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_lword*/
+ break;
+
+/****
+ *USINT_TO_UINT
+ */
+ case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_uint*/
+ break;
+
+/****
+ *USINT_TO_LREAL
+ */
+ case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_lreal*/
+ break;
+
+/****
+ *USINT_TO_BYTE
+ */
+ case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_byte*/
+ break;
+
+/****
+ *USINT_TO_ULINT
+ */
+ case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_ulint*/
+ break;
+
+/****
+ *USINT_TO_BOOL
+ */
+ case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_bool*/
+ break;
+
+/****
+ *USINT_TO_TIME
+ */
+ case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_time*/
+ break;
+
+/****
+ *USINT_TO_INT
+ */
+ case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_int*/
+ break;
+
+/****
+ *ULINT_TO_REAL
+ */
+ case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_real*/
+ break;
+
+/****
+ *ULINT_TO_SINT
+ */
+ case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_sint*/
+ break;
+
+/****
+ *ULINT_TO_LINT
+ */
+ case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_lint*/
+ break;
+
+/****
+ *ULINT_TO_DINT
+ */
+ case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_dint*/
+ break;
+
+/****
+ *ULINT_TO_DATE
+ */
+ case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_date*/
+ break;
+
+/****
+ *ULINT_TO_DWORD
+ */
+ case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_dword*/
+ break;
+
+/****
+ *ULINT_TO_DT
+ */
+ case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_dt*/
+ break;
+
+/****
+ *ULINT_TO_TOD
+ */
+ case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_tod*/
+ break;
+
+/****
+ *ULINT_TO_UDINT
+ */
+ case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_udint*/
+ break;
+
+/****
+ *ULINT_TO_WORD
+ */
+ case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_word*/
+ break;
+
+/****
+ *ULINT_TO_STRING
+ */
+ case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_string*/
+ break;
+
+/****
+ *ULINT_TO_LWORD
+ */
+ case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_lword*/
+ break;
+
+/****
+ *ULINT_TO_UINT
+ */
+ case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_uint*/
+ break;
+
+/****
+ *ULINT_TO_LREAL
+ */
+ case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_lreal*/
+ break;
+
+/****
+ *ULINT_TO_BYTE
+ */
+ case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_byte*/
+ break;
+
+/****
+ *ULINT_TO_USINT
+ */
+ case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_usint*/
+ break;
+
+/****
+ *ULINT_TO_BOOL
+ */
+ case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_bool*/
+ break;
+
+/****
+ *ULINT_TO_TIME
+ */
+ case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_time*/
+ break;
+
+/****
+ *ULINT_TO_INT
+ */
+ case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_int*/
+ break;
+
+/****
+ *BOOL_TO_REAL
+ */
+ case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_real*/
+ break;
+
+/****
+ *BOOL_TO_SINT
+ */
+ case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_sint*/
+ break;
+
+/****
+ *BOOL_TO_LINT
+ */
+ case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_lint*/
+ break;
+
+/****
+ *BOOL_TO_DINT
+ */
+ case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_dint*/
+ break;
+
+/****
+ *BOOL_TO_DATE
+ */
+ case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_date*/
+ break;
+
+/****
+ *BOOL_TO_DWORD
+ */
+ case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_dword*/
+ break;
+
+/****
+ *BOOL_TO_DT
+ */
+ case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_dt*/
+ break;
+
+/****
+ *BOOL_TO_TOD
+ */
+ case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_tod*/
+ break;
+
+/****
+ *BOOL_TO_UDINT
+ */
+ case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_udint*/
+ break;
+
+/****
+ *BOOL_TO_WORD
+ */
+ case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_word*/
+ break;
+
+/****
+ *BOOL_TO_STRING
+ */
+ case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_string*/
+ break;
+
+/****
+ *BOOL_TO_LWORD
+ */
+ case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_lword*/
+ break;
+
+/****
+ *BOOL_TO_UINT
+ */
+ case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_uint*/
+ break;
+
+/****
+ *BOOL_TO_LREAL
+ */
+ case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_lreal*/
+ break;
+
+/****
+ *BOOL_TO_BYTE
+ */
+ case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_byte*/
+ break;
+
+/****
+ *BOOL_TO_USINT
+ */
+ case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_usint*/
+ break;
+
+/****
+ *BOOL_TO_ULINT
+ */
+ case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_ulint*/
+ break;
+
+/****
+ *BOOL_TO_TIME
+ */
+ case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_time*/
+ break;
+
+/****
+ *BOOL_TO_INT
+ */
+ case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_int*/
+ break;
+
+/****
+ *TIME_TO_REAL
+ */
+ case function_time_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(¶m_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::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_real*/
+ break;
+
+/****
+ *TIME_TO_SINT
+ */
+ case function_time_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(¶m_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::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_sint*/
+ break;
+
+/****
+ *TIME_TO_LINT
+ */
+ case function_time_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(¶m_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::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_lint*/
+ break;
+
+/****
+ *TIME_TO_DINT
+ */
+ case function_time_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(¶m_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::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_dint*/
+ break;
+
+/****
+ *TIME_TO_DWORD
+ */
+ case function_time_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(¶m_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::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_dword*/
+ break;
+
+/****
+ *TIME_TO_UDINT
+ */
+ case function_time_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(¶m_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::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_udint*/
+ break;
+
+/****
+ *TIME_TO_WORD
+ */
+ case function_time_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(¶m_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::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_word*/
+ break;
+
+/****
+ *TIME_TO_STRING
+ */
+ case function_time_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(¶m_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::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_string*/
+ break;
+
+/****
+ *TIME_TO_LWORD
+ */
+ case function_time_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(¶m_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::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_lword*/
+ break;
+
+/****
+ *TIME_TO_UINT
+ */
+ case function_time_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(¶m_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::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_uint*/
+ break;
+
+/****
+ *TIME_TO_LREAL
+ */
+ case function_time_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(¶m_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::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_lreal*/
+ break;
+
+/****
+ *TIME_TO_BYTE
+ */
+ case function_time_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(¶m_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::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_byte*/
+ break;
+
+/****
+ *TIME_TO_USINT
+ */
+ case function_time_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(¶m_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::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_usint*/
+ break;
+
+/****
+ *TIME_TO_ULINT
+ */
+ case function_time_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(¶m_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::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_ulint*/
+ break;
+
+/****
+ *TIME_TO_INT
+ */
+ case function_time_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(¶m_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::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_int*/
+ break;
+
+/****
+ *INT_TO_REAL
+ */
+ case function_int_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(¶m_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::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_real*/
+ break;
+
+/****
+ *INT_TO_SINT
+ */
+ case function_int_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(¶m_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::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_sint*/
+ break;
+
+/****
+ *INT_TO_LINT
+ */
+ case function_int_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(¶m_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::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_lint*/
+ break;
+
+/****
+ *INT_TO_DINT
+ */
+ case function_int_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(¶m_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::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_dint*/
+ break;
+
+/****
+ *INT_TO_DATE
+ */
+ case function_int_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(¶m_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::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_date*/
+ break;
+
+/****
+ *INT_TO_DWORD
+ */
+ case function_int_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(¶m_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::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_dword*/
+ break;
+
+/****
+ *INT_TO_DT
+ */
+ case function_int_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(¶m_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::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_dt*/
+ break;
+
+/****
+ *INT_TO_TOD
+ */
+ case function_int_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(¶m_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::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_tod*/
+ break;
+
+/****
+ *INT_TO_UDINT
+ */
+ case function_int_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(¶m_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::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_udint*/
+ break;
+
+/****
+ *INT_TO_WORD
+ */
+ case function_int_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(¶m_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::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_word*/
+ break;
+
+/****
+ *INT_TO_STRING
+ */
+ case function_int_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(¶m_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::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_string*/
+ break;
+
+/****
+ *INT_TO_LWORD
+ */
+ case function_int_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(¶m_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::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_lword*/
+ break;
+
+/****
+ *INT_TO_UINT
+ */
+ case function_int_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(¶m_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::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_uint*/
+ break;
+
+/****
+ *INT_TO_LREAL
+ */
+ case function_int_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(¶m_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::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_lreal*/
+ break;
+
+/****
+ *INT_TO_BYTE
+ */
+ case function_int_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(¶m_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::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_byte*/
+ break;
+
+/****
+ *INT_TO_USINT
+ */
+ case function_int_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(¶m_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::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_usint*/
+ break;
+
+/****
+ *INT_TO_ULINT
+ */
+ case function_int_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(¶m_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::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_ulint*/
+ break;
+
+/****
+ *INT_TO_BOOL
+ */
+ case function_int_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(¶m_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::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_bool*/
+ break;
+
+/****
+ *INT_TO_TIME
+ */
+ case function_int_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(¶m_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::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_time*/
+ break;
+
+/****
+ *TRUNC
+ */
+ case function_trunc :
+ {
+ 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(¶m_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_real_type(IN_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_trunc*/
+ break;
+
+/****
+ *BCD_TO_UDINT
+ */
+ case function_bcd_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(¶m_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::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bcd_to_udint*/
+ break;
+
+/****
+ *BCD_TO_UINT
+ */
+ case function_bcd_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(¶m_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::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bcd_to_uint*/
+ break;
+
+/****
+ *BCD_TO_ULINT
+ */
+ case function_bcd_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(¶m_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::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bcd_to_ulint*/
+ break;
+
+/****
+ *BCD_TO_USINT
+ */
+ case function_bcd_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(¶m_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::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bcd_to_usint*/
+ break;
+
+/****
+ *UDINT_TO_BCD
+ */
+ case function_udint_to_bcd :
+ {
+ 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(¶m_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::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_bcd*/
+ break;
+
+/****
+ *UINT_TO_BCD
+ */
+ case function_uint_to_bcd :
+ {
+ 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(¶m_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::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_bcd*/
+ break;
+
+/****
+ *USINT_TO_BCD
+ */
+ case function_usint_to_bcd :
+ {
+ 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(¶m_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::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_bcd*/
+ break;
+
+/****
+ *ULINT_TO_BCD
+ */
+ case function_ulint_to_bcd :
+ {
+ 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(¶m_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::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_bcd*/
+ break;
+
+/****
+ *DATE_AND_TIME_TO_TIME_OF_DAY
+ */
+ case function_date_and_time_to_time_of_day :
+ {
+ 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(¶m_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::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_date_and_time_to_time_of_day*/
+ break;
+
+/****
+ *DATE_AND_TIME_TO_DATE
+ */
+ case function_date_and_time_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(¶m_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::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_date_and_time_to_date*/
+ break;
+
+/****
+ *ABS
+ */
+ case function_abs :
+ {
+ 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(¶m_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_num_type(IN_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_abs*/
+ break;
+
+/****
+ *SQRT
+ */
+ case function_sqrt :
+ {
+ 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(¶m_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_real_type(IN_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_sqrt*/
+ break;
+
+/****
+ *LN
+ */
+ case function_ln :
+ {
+ 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(¶m_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_real_type(IN_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ln*/
+ break;
+
+/****
+ *LOG
+ */
+ case function_log :
+ {
+ 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(¶m_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_real_type(IN_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_log*/
+ break;
+
+/****
+ *EXP
+ */
+ case function_exp :
+ {
+ 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(¶m_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_real_type(IN_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_exp*/
+ break;
+
+/****
+ *SIN
+ */
+ case function_sin :
+ {
+ 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(¶m_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_real_type(IN_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_sin*/
+ break;
+
+/****
+ *COS
+ */
+ case function_cos :
+ {
+ 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(¶m_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_real_type(IN_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_cos*/
+ break;
+
+/****
+ *TAN
+ */
+ case function_tan :
+ {
+ 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(¶m_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_real_type(IN_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tan*/
+ break;
+
+/****
+ *ASIN
+ */
+ case function_asin :
+ {
+ 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(¶m_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_real_type(IN_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_asin*/
+ break;
+
+/****
+ *ACOS
+ */
+ case function_acos :
+ {
+ 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(¶m_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_real_type(IN_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_acos*/
+ break;
+
+/****
+ *ATAN
+ */
+ case function_atan :
+ {
+ 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(¶m_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_real_type(IN_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_atan*/
+ break;
+
+/****
+ *ADD
+ */
+ case function_add :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ identifier_c param_name("IN1");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN1_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN1_param_value == NULL)
+ IN1_param_value = function_call_param_iterator.next();
+ if (IN1_param_value != NULL) {
+ IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
+ last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = last_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_add*/
+ break;
+
+/****
+ *MUL
+ */
+ case function_mul :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ identifier_c param_name("IN1");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN1_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN1_param_value == NULL)
+ IN1_param_value = function_call_param_iterator.next();
+ if (IN1_param_value != NULL) {
+ IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
+ last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = last_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_mul*/
+ break;
+
+/****
+ *SUB
+ */
+ case function_sub :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ identifier_c param_name("IN1");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN1_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN1_param_value == NULL)
+ IN1_param_value = function_call_param_iterator.next();
+ if (IN1_param_value != NULL) {
+ IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
+ last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = last_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_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::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_sub*/
+ break;
+
+/****
+ *DIV
+ */
+ case function_div :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ identifier_c param_name("IN1");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN1_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN1_param_value == NULL)
+ IN1_param_value = function_call_param_iterator.next();
+ if (IN1_param_value != NULL) {
+ IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
+ last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = last_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_div*/
+ break;
+
+/****
+ *MOD
+ */
+ case function_mod :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ identifier_c param_name("IN1");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN1_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN1_param_value == NULL)
+ IN1_param_value = function_call_param_iterator.next();
+ if (IN1_param_value != NULL) {
+ IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
+ last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = last_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_mod*/
+ break;
+
+/****
+ *EXPT
+ */
+ case function_expt :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ identifier_c param_name("IN1");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN1_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN1_param_value == NULL)
+ IN1_param_value = function_call_param_iterator.next();
+ if (IN1_param_value != NULL) {
+ IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
+ last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_real_type(IN1_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = last_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_expt*/
+ break;
+
+/****
+ *MOVE
+ */
+ case function_move :
+ {
+ 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(¶m_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 ;
+ }
+
+
+ {
+
+ symbol_c * return_type_symbol = last_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_move*/
+ break;
+
+/****
+ *SHL
+ */
+ case function_shl :
+ {
+ 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(¶m_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_binary_type(IN_type_symbol))
+ {
+
+ {
+ identifier_c param_name("N");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *N_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *N_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (N_param_value == NULL)
+ N_param_value = function_call_param_iterator.next();
+ if (N_param_value != NULL) {
+ N_type_symbol = search_expression_type->get_type(N_param_value);
+ last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
+ }
+
+ if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_shl*/
+ break;
+
+/****
+ *SHR
+ */
+ case function_shr :
+ {
+ 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(¶m_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_binary_type(IN_type_symbol))
+ {
+
+ {
+ identifier_c param_name("N");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *N_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *N_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (N_param_value == NULL)
+ N_param_value = function_call_param_iterator.next();
+ if (N_param_value != NULL) {
+ N_type_symbol = search_expression_type->get_type(N_param_value);
+ last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
+ }
+
+ if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_shr*/
+ break;
+
+/****
+ *ROR
+ */
+ case function_ror :
+ {
+ 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(¶m_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_nbinary_type(IN_type_symbol))
+ {
+
+ {
+ identifier_c param_name("N");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *N_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *N_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (N_param_value == NULL)
+ N_param_value = function_call_param_iterator.next();
+ if (N_param_value != NULL) {
+ N_type_symbol = search_expression_type->get_type(N_param_value);
+ last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
+ }
+
+ if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ror*/
+ break;
+
+/****
+ *ROL
+ */
+ case function_rol :
+ {
+ 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(¶m_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_nbinary_type(IN_type_symbol))
+ {
+
+ {
+ identifier_c param_name("N");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *N_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *N_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (N_param_value == NULL)
+ N_param_value = function_call_param_iterator.next();
+ if (N_param_value != NULL) {
+ N_type_symbol = search_expression_type->get_type(N_param_value);
+ last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
+ }
+
+ if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_rol*/
+ break;
+
+/****
+ *AND
+ */
+ case function_and :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ identifier_c param_name("IN1");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN1_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN1_param_value == NULL)
+ IN1_param_value = function_call_param_iterator.next();
+ if (IN1_param_value != NULL) {
+ IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
+ last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_binary_type(IN1_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = last_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_and*/
+ break;
+
+/****
+ *OR
+ */
+ case function_or :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ identifier_c param_name("IN1");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN1_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN1_param_value == NULL)
+ IN1_param_value = function_call_param_iterator.next();
+ if (IN1_param_value != NULL) {
+ IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
+ last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_binary_type(IN1_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = last_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_or*/
+ break;
+
+/****
+ *XOR
+ */
+ case function_xor :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ identifier_c param_name("IN1");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN1_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN1_param_value == NULL)
+ IN1_param_value = function_call_param_iterator.next();
+ if (IN1_param_value != NULL) {
+ IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
+ last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_binary_type(IN1_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = last_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_xor*/
+ break;
+
+/****
+ *NOT
+ */
+ case function_not :
+ {
+ 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(¶m_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_binary_type(IN_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_not*/
+ break;
+
+/****
+ *SEL
+ */
+ case function_sel :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ identifier_c param_name("G");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *G_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *G_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (G_param_value == NULL)
+ G_param_value = function_call_param_iterator.next();
+ if (G_param_value != NULL) {
+ G_type_symbol = search_expression_type->get_type(G_param_value);
+ last_type_symbol = last_type_symbol && G_type_symbol && search_expression_type->is_same_type(G_type_symbol, last_type_symbol) ? search_expression_type->common_type(G_type_symbol, last_type_symbol) : G_type_symbol ;
+ }
+
+ if(G_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN0");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN0_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN0_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN0_param_value == NULL)
+ IN0_param_value = function_call_param_iterator.next();
+ if (IN0_param_value != NULL) {
+ IN0_type_symbol = search_expression_type->get_type(IN0_param_value);
+ last_type_symbol = last_type_symbol && IN0_type_symbol && search_expression_type->is_same_type(IN0_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN0_type_symbol, last_type_symbol) : IN0_type_symbol ;
+ }
+
+
+ {
+
+ {
+ identifier_c param_name("IN1");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN1_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN1_param_value == NULL)
+ IN1_param_value = function_call_param_iterator.next();
+ if (IN1_param_value != NULL) {
+ IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
+ last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
+ }
+
+
+ {
+
+ symbol_c * return_type_symbol = last_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_sel*/
+ break;
+
+/****
+ *MAX
+ */
+ case function_max :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ identifier_c param_name("IN1");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN1_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN1_param_value == NULL)
+ IN1_param_value = function_call_param_iterator.next();
+ if (IN1_param_value != NULL) {
+ IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
+ last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
+ }
+
+
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+
+ {
+
+ symbol_c * return_type_symbol = last_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_max*/
+ break;
+
+/****
+ *MIN
+ */
+ case function_min :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ identifier_c param_name("IN1");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN1_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN1_param_value == NULL)
+ IN1_param_value = function_call_param_iterator.next();
+ if (IN1_param_value != NULL) {
+ IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
+ last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
+ }
+
+
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+
+ {
+
+ symbol_c * return_type_symbol = last_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_min*/
+ break;
+
+/****
+ *LIMIT
+ */
+ case function_limit :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ identifier_c param_name("MN");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *MN_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *MN_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (MN_param_value == NULL)
+ MN_param_value = function_call_param_iterator.next();
+ if (MN_param_value != NULL) {
+ MN_type_symbol = search_expression_type->get_type(MN_param_value);
+ last_type_symbol = last_type_symbol && MN_type_symbol && search_expression_type->is_same_type(MN_type_symbol, last_type_symbol) ? search_expression_type->common_type(MN_type_symbol, last_type_symbol) : MN_type_symbol ;
+ }
+
+
+ {
+
+ {
+ 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(¶m_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 ;
+ }
+
+
+ {
+
+ {
+ identifier_c param_name("MX");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *MX_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *MX_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (MX_param_value == NULL)
+ MX_param_value = function_call_param_iterator.next();
+ if (MX_param_value != NULL) {
+ MX_type_symbol = search_expression_type->get_type(MX_param_value);
+ last_type_symbol = last_type_symbol && MX_type_symbol && search_expression_type->is_same_type(MX_type_symbol, last_type_symbol) ? search_expression_type->common_type(MX_type_symbol, last_type_symbol) : MX_type_symbol ;
+ }
+
+
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_limit*/
+ break;
+
+/****
+ *MUX
+ */
+ case function_mux :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ identifier_c param_name("K");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *K_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *K_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (K_param_value == NULL)
+ K_param_value = function_call_param_iterator.next();
+ if (K_param_value != NULL) {
+ K_type_symbol = search_expression_type->get_type(K_param_value);
+ last_type_symbol = last_type_symbol && K_type_symbol && search_expression_type->is_same_type(K_type_symbol, last_type_symbol) ? search_expression_type->common_type(K_type_symbol, last_type_symbol) : K_type_symbol ;
+ }
+
+ if(K_type_symbol == NULL || search_expression_type->is_integer_type(K_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN0");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN0_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN0_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN0_param_value == NULL)
+ IN0_param_value = function_call_param_iterator.next();
+ if (IN0_param_value != NULL) {
+ IN0_type_symbol = search_expression_type->get_type(IN0_param_value);
+ last_type_symbol = last_type_symbol && IN0_type_symbol && search_expression_type->is_same_type(IN0_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN0_type_symbol, last_type_symbol) : IN0_type_symbol ;
+ }
+
+
+ {
+
+ {
+ identifier_c param_name("IN1");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN1_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN1_param_value == NULL)
+ IN1_param_value = function_call_param_iterator.next();
+ if (IN1_param_value != NULL) {
+ IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
+ last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
+ }
+
+
+ {
+
+ symbol_c * return_type_symbol = last_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_mux*/
+ break;
+
+/****
+ *GT
+ */
+ case function_gt :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ identifier_c param_name("IN1");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN1_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN1_param_value == NULL)
+ IN1_param_value = function_call_param_iterator.next();
+ if (IN1_param_value != NULL) {
+ IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
+ last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
+ }
+
+
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_gt*/
+ break;
+
+/****
+ *GE
+ */
+ case function_ge :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ identifier_c param_name("IN1");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN1_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN1_param_value == NULL)
+ IN1_param_value = function_call_param_iterator.next();
+ if (IN1_param_value != NULL) {
+ IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
+ last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
+ }
+
+
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ge*/
+ break;
+
+/****
+ *EQ
+ */
+ case function_eq :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ identifier_c param_name("IN1");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN1_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN1_param_value == NULL)
+ IN1_param_value = function_call_param_iterator.next();
+ if (IN1_param_value != NULL) {
+ IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
+ last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
+ }
+
+
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_eq*/
+ break;
+
+/****
+ *LT
+ */
+ case function_lt :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ identifier_c param_name("IN1");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN1_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN1_param_value == NULL)
+ IN1_param_value = function_call_param_iterator.next();
+ if (IN1_param_value != NULL) {
+ IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
+ last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
+ }
+
+
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lt*/
+ break;
+
+/****
+ *LE
+ */
+ case function_le :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ identifier_c param_name("IN1");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN1_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN1_param_value == NULL)
+ IN1_param_value = function_call_param_iterator.next();
+ if (IN1_param_value != NULL) {
+ IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
+ last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
+ }
+
+
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_le*/
+ break;
+
+/****
+ *NE
+ */
+ case function_ne :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ identifier_c param_name("IN1");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN1_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN1_param_value == NULL)
+ IN1_param_value = function_call_param_iterator.next();
+ if (IN1_param_value != NULL) {
+ IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
+ last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
+ }
+
+
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ne*/
+ break;
+
+/****
+ *LEN
+ */
+ case function_len :
+ {
+ 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(¶m_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::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_len*/
+ break;
+
+/****
+ *LEFT
+ */
+ case function_left :
+ {
+ 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(¶m_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::string_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("L");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *L_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *L_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (L_param_value == NULL)
+ L_param_value = function_call_param_iterator.next();
+ if (L_param_value != NULL) {
+ L_type_symbol = search_expression_type->get_type(L_param_value);
+ last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
+ }
+
+ if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_left*/
+ break;
+
+/****
+ *RIGHT
+ */
+ case function_right :
+ {
+ 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(¶m_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::string_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("L");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *L_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *L_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (L_param_value == NULL)
+ L_param_value = function_call_param_iterator.next();
+ if (L_param_value != NULL) {
+ L_type_symbol = search_expression_type->get_type(L_param_value);
+ last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
+ }
+
+ if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_right*/
+ break;
+
+/****
+ *MID
+ */
+ case function_mid :
+ {
+ 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(¶m_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::string_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("L");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *L_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *L_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (L_param_value == NULL)
+ L_param_value = function_call_param_iterator.next();
+ if (L_param_value != NULL) {
+ L_type_symbol = search_expression_type->get_type(L_param_value);
+ last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
+ }
+
+ if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol))
+ {
+
+ {
+ identifier_c param_name("P");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *P_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *P_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (P_param_value == NULL)
+ P_param_value = function_call_param_iterator.next();
+ if (P_param_value != NULL) {
+ P_type_symbol = search_expression_type->get_type(P_param_value);
+ last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
+ }
+
+ if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_mid*/
+ break;
+
+/****
+ *CONCAT
+ */
+ case function_concat :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ identifier_c param_name("IN1");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN1_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN1_param_value == NULL)
+ IN1_param_value = function_call_param_iterator.next();
+ if (IN1_param_value != NULL) {
+ IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
+ last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_concat*/
+ break;
+
+/****
+ *INSERT
+ */
+ case function_insert :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ identifier_c param_name("IN1");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN1_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN1_param_value == NULL)
+ IN1_param_value = function_call_param_iterator.next();
+ if (IN1_param_value != NULL) {
+ IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
+ last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("P");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *P_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *P_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (P_param_value == NULL)
+ P_param_value = function_call_param_iterator.next();
+ if (P_param_value != NULL) {
+ P_type_symbol = search_expression_type->get_type(P_param_value);
+ last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
+ }
+
+ if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_insert*/
+ break;
+
+/****
+ *DELETE
+ */
+ case function_delete :
+ {
+ 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(¶m_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::string_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("L");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *L_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *L_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (L_param_value == NULL)
+ L_param_value = function_call_param_iterator.next();
+ if (L_param_value != NULL) {
+ L_type_symbol = search_expression_type->get_type(L_param_value);
+ last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
+ }
+
+ if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol))
+ {
+
+ {
+ identifier_c param_name("P");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *P_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *P_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (P_param_value == NULL)
+ P_param_value = function_call_param_iterator.next();
+ if (P_param_value != NULL) {
+ P_type_symbol = search_expression_type->get_type(P_param_value);
+ last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
+ }
+
+ if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_delete*/
+ break;
+
+/****
+ *REPLACE
+ */
+ case function_replace :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ identifier_c param_name("IN1");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN1_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN1_param_value == NULL)
+ IN1_param_value = function_call_param_iterator.next();
+ if (IN1_param_value != NULL) {
+ IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
+ last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("L");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *L_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *L_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (L_param_value == NULL)
+ L_param_value = function_call_param_iterator.next();
+ if (L_param_value != NULL) {
+ L_type_symbol = search_expression_type->get_type(L_param_value);
+ last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
+ }
+
+ if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol))
+ {
+
+ {
+ identifier_c param_name("P");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *P_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *P_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (P_param_value == NULL)
+ P_param_value = function_call_param_iterator.next();
+ if (P_param_value != NULL) {
+ P_type_symbol = search_expression_type->get_type(P_param_value);
+ last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
+ }
+
+ if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_replace*/
+ break;
+
+/****
+ *FIND
+ */
+ case function_find :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ identifier_c param_name("IN1");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN1_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN1_param_value == NULL)
+ IN1_param_value = function_call_param_iterator.next();
+ if (IN1_param_value != NULL) {
+ IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
+ last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_find*/
+ break;
+
+ case function_none :
+ ERROR;
+ }
+ return NULL;
+}
+
+void *compute_standard_function_il(il_function_call_c *symbol, symbol_c *param_data_type) {
+
+ function_type_t current_function_type = get_function_type((identifier_c *)symbol->function_name);
+ function_call_param_iterator_c function_call_param_iterator(symbol);
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dword_to_tod*/
+ break;
+
+/****
+ *DWORD_TO_UDINT
+ */
+ case function_dword_to_udint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dword_to_udint*/
+ break;
+
+/****
+ *DWORD_TO_WORD
+ */
+ case function_dword_to_word :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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::word_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dword_to_word*/
+ break;
+
+/****
+ *DWORD_TO_STRING
+ */
+ case function_dword_to_string :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dword_to_string*/
+ break;
+
+/****
+ *DWORD_TO_LWORD
+ */
+ case function_dword_to_lword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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::lword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dword_to_lword*/
+ break;
+
+/****
+ *DWORD_TO_UINT
+ */
+ case function_dword_to_uint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dword_to_uint*/
+ break;
+
+/****
+ *DWORD_TO_LREAL
+ */
+ case function_dword_to_lreal :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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::lreal_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dword_to_lreal*/
+ break;
+
+/****
+ *DWORD_TO_BYTE
+ */
+ case function_dword_to_byte :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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::byte_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dword_to_byte*/
+ break;
+
+/****
+ *DWORD_TO_USINT
+ */
+ case function_dword_to_usint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dword_to_usint*/
+ break;
+
+/****
+ *DWORD_TO_ULINT
+ */
+ case function_dword_to_ulint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dword_to_ulint*/
+ break;
+
+/****
+ *DWORD_TO_BOOL
+ */
+ case function_dword_to_bool :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dword_to_bool*/
+ break;
+
+/****
+ *DWORD_TO_TIME
+ */
+ case function_dword_to_time :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dword_to_time*/
+ break;
+
+/****
+ *DWORD_TO_INT
+ */
+ case function_dword_to_int :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dword_to_int*/
+ break;
+
+/****
+ *DT_TO_REAL
+ */
+ case function_dt_to_real :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_real*/
+ break;
+
+/****
+ *DT_TO_SINT
+ */
+ case function_dt_to_sint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_sint*/
+ break;
+
+/****
+ *DT_TO_LINT
+ */
+ case function_dt_to_lint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_lint*/
+ break;
+
+/****
+ *DT_TO_DINT
+ */
+ case function_dt_to_dint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_dint*/
+ break;
+
+/****
+ *DT_TO_DWORD
+ */
+ case function_dt_to_dword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_dword*/
+ break;
+
+/****
+ *DT_TO_UDINT
+ */
+ case function_dt_to_udint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_udint*/
+ break;
+
+/****
+ *DT_TO_WORD
+ */
+ case function_dt_to_word :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_word*/
+ break;
+
+/****
+ *DT_TO_STRING
+ */
+ case function_dt_to_string :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_string*/
+ break;
+
+/****
+ *DT_TO_LWORD
+ */
+ case function_dt_to_lword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_lword*/
+ break;
+
+/****
+ *DT_TO_UINT
+ */
+ case function_dt_to_uint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_uint*/
+ break;
+
+/****
+ *DT_TO_LREAL
+ */
+ case function_dt_to_lreal :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_lreal*/
+ break;
+
+/****
+ *DT_TO_BYTE
+ */
+ case function_dt_to_byte :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_byte*/
+ break;
+
+/****
+ *DT_TO_USINT
+ */
+ case function_dt_to_usint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_usint*/
+ break;
+
+/****
+ *DT_TO_ULINT
+ */
+ case function_dt_to_ulint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_ulint*/
+ break;
+
+/****
+ *DT_TO_INT
+ */
+ case function_dt_to_int :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_dt_to_int*/
+ break;
+
+/****
+ *TOD_TO_REAL
+ */
+ case function_tod_to_real :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_real*/
+ break;
+
+/****
+ *TOD_TO_SINT
+ */
+ case function_tod_to_sint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_sint*/
+ break;
+
+/****
+ *TOD_TO_LINT
+ */
+ case function_tod_to_lint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_lint*/
+ break;
+
+/****
+ *TOD_TO_DINT
+ */
+ case function_tod_to_dint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_dint*/
+ break;
+
+/****
+ *TOD_TO_DWORD
+ */
+ case function_tod_to_dword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_dword*/
+ break;
+
+/****
+ *TOD_TO_UDINT
+ */
+ case function_tod_to_udint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_udint*/
+ break;
+
+/****
+ *TOD_TO_WORD
+ */
+ case function_tod_to_word :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_word*/
+ break;
+
+/****
+ *TOD_TO_STRING
+ */
+ case function_tod_to_string :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_string*/
+ break;
+
+/****
+ *TOD_TO_LWORD
+ */
+ case function_tod_to_lword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_lword*/
+ break;
+
+/****
+ *TOD_TO_UINT
+ */
+ case function_tod_to_uint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_uint*/
+ break;
+
+/****
+ *TOD_TO_LREAL
+ */
+ case function_tod_to_lreal :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_lreal*/
+ break;
+
+/****
+ *TOD_TO_BYTE
+ */
+ case function_tod_to_byte :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_byte*/
+ break;
+
+/****
+ *TOD_TO_USINT
+ */
+ case function_tod_to_usint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_usint*/
+ break;
+
+/****
+ *TOD_TO_ULINT
+ */
+ case function_tod_to_ulint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_ulint*/
+ break;
+
+/****
+ *TOD_TO_INT
+ */
+ case function_tod_to_int :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tod_to_int*/
+ break;
+
+/****
+ *UDINT_TO_REAL
+ */
+ case function_udint_to_real :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_real*/
+ break;
+
+/****
+ *UDINT_TO_SINT
+ */
+ case function_udint_to_sint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_sint*/
+ break;
+
+/****
+ *UDINT_TO_LINT
+ */
+ case function_udint_to_lint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_lint*/
+ break;
+
+/****
+ *UDINT_TO_DINT
+ */
+ case function_udint_to_dint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_dint*/
+ break;
+
+/****
+ *UDINT_TO_DATE
+ */
+ case function_udint_to_date :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_date*/
+ break;
+
+/****
+ *UDINT_TO_DWORD
+ */
+ case function_udint_to_dword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_dword*/
+ break;
+
+/****
+ *UDINT_TO_DT
+ */
+ case function_udint_to_dt :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_dt*/
+ break;
+
+/****
+ *UDINT_TO_TOD
+ */
+ case function_udint_to_tod :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_tod*/
+ break;
+
+/****
+ *UDINT_TO_WORD
+ */
+ case function_udint_to_word :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_word*/
+ break;
+
+/****
+ *UDINT_TO_STRING
+ */
+ case function_udint_to_string :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_string*/
+ break;
+
+/****
+ *UDINT_TO_LWORD
+ */
+ case function_udint_to_lword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_lword*/
+ break;
+
+/****
+ *UDINT_TO_UINT
+ */
+ case function_udint_to_uint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_uint*/
+ break;
+
+/****
+ *UDINT_TO_LREAL
+ */
+ case function_udint_to_lreal :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_lreal*/
+ break;
+
+/****
+ *UDINT_TO_BYTE
+ */
+ case function_udint_to_byte :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_byte*/
+ break;
+
+/****
+ *UDINT_TO_USINT
+ */
+ case function_udint_to_usint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_usint*/
+ break;
+
+/****
+ *UDINT_TO_ULINT
+ */
+ case function_udint_to_ulint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_ulint*/
+ break;
+
+/****
+ *UDINT_TO_BOOL
+ */
+ case function_udint_to_bool :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_bool*/
+ break;
+
+/****
+ *UDINT_TO_TIME
+ */
+ case function_udint_to_time :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_time*/
+ break;
+
+/****
+ *UDINT_TO_INT
+ */
+ case function_udint_to_int :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_int*/
+ break;
+
+/****
+ *WORD_TO_REAL
+ */
+ case function_word_to_real :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_real*/
+ break;
+
+/****
+ *WORD_TO_SINT
+ */
+ case function_word_to_sint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_sint*/
+ break;
+
+/****
+ *WORD_TO_LINT
+ */
+ case function_word_to_lint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_lint*/
+ break;
+
+/****
+ *WORD_TO_DINT
+ */
+ case function_word_to_dint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_dint*/
+ break;
+
+/****
+ *WORD_TO_DATE
+ */
+ case function_word_to_date :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_date*/
+ break;
+
+/****
+ *WORD_TO_DWORD
+ */
+ case function_word_to_dword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_dword*/
+ break;
+
+/****
+ *WORD_TO_DT
+ */
+ case function_word_to_dt :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_dt*/
+ break;
+
+/****
+ *WORD_TO_TOD
+ */
+ case function_word_to_tod :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_tod*/
+ break;
+
+/****
+ *WORD_TO_UDINT
+ */
+ case function_word_to_udint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_udint*/
+ break;
+
+/****
+ *WORD_TO_STRING
+ */
+ case function_word_to_string :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_string*/
+ break;
+
+/****
+ *WORD_TO_LWORD
+ */
+ case function_word_to_lword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_lword*/
+ break;
+
+/****
+ *WORD_TO_UINT
+ */
+ case function_word_to_uint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_uint*/
+ break;
+
+/****
+ *WORD_TO_LREAL
+ */
+ case function_word_to_lreal :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_lreal*/
+ break;
+
+/****
+ *WORD_TO_BYTE
+ */
+ case function_word_to_byte :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_byte*/
+ break;
+
+/****
+ *WORD_TO_USINT
+ */
+ case function_word_to_usint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_usint*/
+ break;
+
+/****
+ *WORD_TO_ULINT
+ */
+ case function_word_to_ulint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_ulint*/
+ break;
+
+/****
+ *WORD_TO_BOOL
+ */
+ case function_word_to_bool :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_bool*/
+ break;
+
+/****
+ *WORD_TO_TIME
+ */
+ case function_word_to_time :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_time*/
+ break;
+
+/****
+ *WORD_TO_INT
+ */
+ case function_word_to_int :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_word_to_int*/
+ break;
+
+/****
+ *STRING_TO_REAL
+ */
+ case function_string_to_real :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_real*/
+ break;
+
+/****
+ *STRING_TO_SINT
+ */
+ case function_string_to_sint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_sint*/
+ break;
+
+/****
+ *STRING_TO_LINT
+ */
+ case function_string_to_lint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_lint*/
+ break;
+
+/****
+ *STRING_TO_DINT
+ */
+ case function_string_to_dint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_dint*/
+ break;
+
+/****
+ *STRING_TO_DATE
+ */
+ case function_string_to_date :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_date*/
+ break;
+
+/****
+ *STRING_TO_DWORD
+ */
+ case function_string_to_dword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_dword*/
+ break;
+
+/****
+ *STRING_TO_DT
+ */
+ case function_string_to_dt :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_dt*/
+ break;
+
+/****
+ *STRING_TO_TOD
+ */
+ case function_string_to_tod :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_tod*/
+ break;
+
+/****
+ *STRING_TO_UDINT
+ */
+ case function_string_to_udint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_udint*/
+ break;
+
+/****
+ *STRING_TO_WORD
+ */
+ case function_string_to_word :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_word*/
+ break;
+
+/****
+ *STRING_TO_LWORD
+ */
+ case function_string_to_lword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_lword*/
+ break;
+
+/****
+ *STRING_TO_UINT
+ */
+ case function_string_to_uint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_uint*/
+ break;
+
+/****
+ *STRING_TO_LREAL
+ */
+ case function_string_to_lreal :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_lreal*/
+ break;
+
+/****
+ *STRING_TO_BYTE
+ */
+ case function_string_to_byte :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_byte*/
+ break;
+
+/****
+ *STRING_TO_USINT
+ */
+ case function_string_to_usint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_usint*/
+ break;
+
+/****
+ *STRING_TO_ULINT
+ */
+ case function_string_to_ulint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_ulint*/
+ break;
+
+/****
+ *STRING_TO_BOOL
+ */
+ case function_string_to_bool :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_bool*/
+ break;
+
+/****
+ *STRING_TO_TIME
+ */
+ case function_string_to_time :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_time*/
+ break;
+
+/****
+ *STRING_TO_INT
+ */
+ case function_string_to_int :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_string_to_int*/
+ break;
+
+/****
+ *LWORD_TO_REAL
+ */
+ case function_lword_to_real :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_real*/
+ break;
+
+/****
+ *LWORD_TO_SINT
+ */
+ case function_lword_to_sint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_sint*/
+ break;
+
+/****
+ *LWORD_TO_LINT
+ */
+ case function_lword_to_lint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_lint*/
+ break;
+
+/****
+ *LWORD_TO_DINT
+ */
+ case function_lword_to_dint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_dint*/
+ break;
+
+/****
+ *LWORD_TO_DATE
+ */
+ case function_lword_to_date :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_date*/
+ break;
+
+/****
+ *LWORD_TO_DWORD
+ */
+ case function_lword_to_dword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_dword*/
+ break;
+
+/****
+ *LWORD_TO_DT
+ */
+ case function_lword_to_dt :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_dt*/
+ break;
+
+/****
+ *LWORD_TO_TOD
+ */
+ case function_lword_to_tod :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_tod*/
+ break;
+
+/****
+ *LWORD_TO_UDINT
+ */
+ case function_lword_to_udint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_udint*/
+ break;
+
+/****
+ *LWORD_TO_WORD
+ */
+ case function_lword_to_word :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_word*/
+ break;
+
+/****
+ *LWORD_TO_STRING
+ */
+ case function_lword_to_string :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_string*/
+ break;
+
+/****
+ *LWORD_TO_UINT
+ */
+ case function_lword_to_uint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_uint*/
+ break;
+
+/****
+ *LWORD_TO_LREAL
+ */
+ case function_lword_to_lreal :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_lreal*/
+ break;
+
+/****
+ *LWORD_TO_BYTE
+ */
+ case function_lword_to_byte :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_byte*/
+ break;
+
+/****
+ *LWORD_TO_USINT
+ */
+ case function_lword_to_usint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_usint*/
+ break;
+
+/****
+ *LWORD_TO_ULINT
+ */
+ case function_lword_to_ulint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_ulint*/
+ break;
+
+/****
+ *LWORD_TO_BOOL
+ */
+ case function_lword_to_bool :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_bool*/
+ break;
+
+/****
+ *LWORD_TO_TIME
+ */
+ case function_lword_to_time :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_time*/
+ break;
+
+/****
+ *LWORD_TO_INT
+ */
+ case function_lword_to_int :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lword_to_int*/
+ break;
+
+/****
+ *UINT_TO_REAL
+ */
+ case function_uint_to_real :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_real*/
+ break;
+
+/****
+ *UINT_TO_SINT
+ */
+ case function_uint_to_sint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_sint*/
+ break;
+
+/****
+ *UINT_TO_LINT
+ */
+ case function_uint_to_lint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_lint*/
+ break;
+
+/****
+ *UINT_TO_DINT
+ */
+ case function_uint_to_dint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_dint*/
+ break;
+
+/****
+ *UINT_TO_DATE
+ */
+ case function_uint_to_date :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_date*/
+ break;
+
+/****
+ *UINT_TO_DWORD
+ */
+ case function_uint_to_dword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_dword*/
+ break;
+
+/****
+ *UINT_TO_DT
+ */
+ case function_uint_to_dt :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_dt*/
+ break;
+
+/****
+ *UINT_TO_TOD
+ */
+ case function_uint_to_tod :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_tod*/
+ break;
+
+/****
+ *UINT_TO_UDINT
+ */
+ case function_uint_to_udint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_udint*/
+ break;
+
+/****
+ *UINT_TO_WORD
+ */
+ case function_uint_to_word :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_word*/
+ break;
+
+/****
+ *UINT_TO_STRING
+ */
+ case function_uint_to_string :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_string*/
+ break;
+
+/****
+ *UINT_TO_LWORD
+ */
+ case function_uint_to_lword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_lword*/
+ break;
+
+/****
+ *UINT_TO_LREAL
+ */
+ case function_uint_to_lreal :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_lreal*/
+ break;
+
+/****
+ *UINT_TO_BYTE
+ */
+ case function_uint_to_byte :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_byte*/
+ break;
+
+/****
+ *UINT_TO_USINT
+ */
+ case function_uint_to_usint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_usint*/
+ break;
+
+/****
+ *UINT_TO_ULINT
+ */
+ case function_uint_to_ulint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_ulint*/
+ break;
+
+/****
+ *UINT_TO_BOOL
+ */
+ case function_uint_to_bool :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_bool*/
+ break;
+
+/****
+ *UINT_TO_TIME
+ */
+ case function_uint_to_time :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_time*/
+ break;
+
+/****
+ *UINT_TO_INT
+ */
+ case function_uint_to_int :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_int*/
+ break;
+
+/****
+ *LREAL_TO_REAL
+ */
+ case function_lreal_to_real :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_real*/
+ break;
+
+/****
+ *LREAL_TO_SINT
+ */
+ case function_lreal_to_sint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_sint*/
+ break;
+
+/****
+ *LREAL_TO_LINT
+ */
+ case function_lreal_to_lint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_lint*/
+ break;
+
+/****
+ *LREAL_TO_DINT
+ */
+ case function_lreal_to_dint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_dint*/
+ break;
+
+/****
+ *LREAL_TO_DATE
+ */
+ case function_lreal_to_date :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_date*/
+ break;
+
+/****
+ *LREAL_TO_DWORD
+ */
+ case function_lreal_to_dword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_dword*/
+ break;
+
+/****
+ *LREAL_TO_DT
+ */
+ case function_lreal_to_dt :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_dt*/
+ break;
+
+/****
+ *LREAL_TO_TOD
+ */
+ case function_lreal_to_tod :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_tod*/
+ break;
+
+/****
+ *LREAL_TO_UDINT
+ */
+ case function_lreal_to_udint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_udint*/
+ break;
+
+/****
+ *LREAL_TO_WORD
+ */
+ case function_lreal_to_word :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_word*/
+ break;
+
+/****
+ *LREAL_TO_STRING
+ */
+ case function_lreal_to_string :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_string*/
+ break;
+
+/****
+ *LREAL_TO_LWORD
+ */
+ case function_lreal_to_lword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_lword*/
+ break;
+
+/****
+ *LREAL_TO_UINT
+ */
+ case function_lreal_to_uint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_uint*/
+ break;
+
+/****
+ *LREAL_TO_BYTE
+ */
+ case function_lreal_to_byte :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_byte*/
+ break;
+
+/****
+ *LREAL_TO_USINT
+ */
+ case function_lreal_to_usint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_usint*/
+ break;
+
+/****
+ *LREAL_TO_ULINT
+ */
+ case function_lreal_to_ulint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_ulint*/
+ break;
+
+/****
+ *LREAL_TO_BOOL
+ */
+ case function_lreal_to_bool :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_bool*/
+ break;
+
+/****
+ *LREAL_TO_TIME
+ */
+ case function_lreal_to_time :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_time*/
+ break;
+
+/****
+ *LREAL_TO_INT
+ */
+ case function_lreal_to_int :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lreal_to_int*/
+ break;
+
+/****
+ *BYTE_TO_REAL
+ */
+ case function_byte_to_real :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_real*/
+ break;
+
+/****
+ *BYTE_TO_SINT
+ */
+ case function_byte_to_sint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_sint*/
+ break;
+
+/****
+ *BYTE_TO_LINT
+ */
+ case function_byte_to_lint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_lint*/
+ break;
+
+/****
+ *BYTE_TO_DINT
+ */
+ case function_byte_to_dint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_dint*/
+ break;
+
+/****
+ *BYTE_TO_DATE
+ */
+ case function_byte_to_date :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_date*/
+ break;
+
+/****
+ *BYTE_TO_DWORD
+ */
+ case function_byte_to_dword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_dword*/
+ break;
+
+/****
+ *BYTE_TO_DT
+ */
+ case function_byte_to_dt :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_dt*/
+ break;
+
+/****
+ *BYTE_TO_TOD
+ */
+ case function_byte_to_tod :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_tod*/
+ break;
+
+/****
+ *BYTE_TO_UDINT
+ */
+ case function_byte_to_udint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_udint*/
+ break;
+
+/****
+ *BYTE_TO_WORD
+ */
+ case function_byte_to_word :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_word*/
+ break;
+
+/****
+ *BYTE_TO_STRING
+ */
+ case function_byte_to_string :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_string*/
+ break;
+
+/****
+ *BYTE_TO_LWORD
+ */
+ case function_byte_to_lword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_lword*/
+ break;
+
+/****
+ *BYTE_TO_UINT
+ */
+ case function_byte_to_uint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_uint*/
+ break;
+
+/****
+ *BYTE_TO_LREAL
+ */
+ case function_byte_to_lreal :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_lreal*/
+ break;
+
+/****
+ *BYTE_TO_USINT
+ */
+ case function_byte_to_usint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_usint*/
+ break;
+
+/****
+ *BYTE_TO_ULINT
+ */
+ case function_byte_to_ulint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_ulint*/
+ break;
+
+/****
+ *BYTE_TO_BOOL
+ */
+ case function_byte_to_bool :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_bool*/
+ break;
+
+/****
+ *BYTE_TO_TIME
+ */
+ case function_byte_to_time :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_time*/
+ break;
+
+/****
+ *BYTE_TO_INT
+ */
+ case function_byte_to_int :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_byte_to_int*/
+ break;
+
+/****
+ *USINT_TO_REAL
+ */
+ case function_usint_to_real :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_real*/
+ break;
+
+/****
+ *USINT_TO_SINT
+ */
+ case function_usint_to_sint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_sint*/
+ break;
+
+/****
+ *USINT_TO_LINT
+ */
+ case function_usint_to_lint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_lint*/
+ break;
+
+/****
+ *USINT_TO_DINT
+ */
+ case function_usint_to_dint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_dint*/
+ break;
+
+/****
+ *USINT_TO_DATE
+ */
+ case function_usint_to_date :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_date*/
+ break;
+
+/****
+ *USINT_TO_DWORD
+ */
+ case function_usint_to_dword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_dword*/
+ break;
+
+/****
+ *USINT_TO_DT
+ */
+ case function_usint_to_dt :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_dt*/
+ break;
+
+/****
+ *USINT_TO_TOD
+ */
+ case function_usint_to_tod :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_tod*/
+ break;
+
+/****
+ *USINT_TO_UDINT
+ */
+ case function_usint_to_udint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_udint*/
+ break;
+
+/****
+ *USINT_TO_WORD
+ */
+ case function_usint_to_word :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_word*/
+ break;
+
+/****
+ *USINT_TO_STRING
+ */
+ case function_usint_to_string :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_string*/
+ break;
+
+/****
+ *USINT_TO_LWORD
+ */
+ case function_usint_to_lword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_lword*/
+ break;
+
+/****
+ *USINT_TO_UINT
+ */
+ case function_usint_to_uint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_uint*/
+ break;
+
+/****
+ *USINT_TO_LREAL
+ */
+ case function_usint_to_lreal :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_lreal*/
+ break;
+
+/****
+ *USINT_TO_BYTE
+ */
+ case function_usint_to_byte :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_byte*/
+ break;
+
+/****
+ *USINT_TO_ULINT
+ */
+ case function_usint_to_ulint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_ulint*/
+ break;
+
+/****
+ *USINT_TO_BOOL
+ */
+ case function_usint_to_bool :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_bool*/
+ break;
+
+/****
+ *USINT_TO_TIME
+ */
+ case function_usint_to_time :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_time*/
+ break;
+
+/****
+ *USINT_TO_INT
+ */
+ case function_usint_to_int :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_int*/
+ break;
+
+/****
+ *ULINT_TO_REAL
+ */
+ case function_ulint_to_real :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_real*/
+ break;
+
+/****
+ *ULINT_TO_SINT
+ */
+ case function_ulint_to_sint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_sint*/
+ break;
+
+/****
+ *ULINT_TO_LINT
+ */
+ case function_ulint_to_lint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_lint*/
+ break;
+
+/****
+ *ULINT_TO_DINT
+ */
+ case function_ulint_to_dint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_dint*/
+ break;
+
+/****
+ *ULINT_TO_DATE
+ */
+ case function_ulint_to_date :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_date*/
+ break;
+
+/****
+ *ULINT_TO_DWORD
+ */
+ case function_ulint_to_dword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_dword*/
+ break;
+
+/****
+ *ULINT_TO_DT
+ */
+ case function_ulint_to_dt :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_dt*/
+ break;
+
+/****
+ *ULINT_TO_TOD
+ */
+ case function_ulint_to_tod :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_tod*/
+ break;
+
+/****
+ *ULINT_TO_UDINT
+ */
+ case function_ulint_to_udint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_udint*/
+ break;
+
+/****
+ *ULINT_TO_WORD
+ */
+ case function_ulint_to_word :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_word*/
+ break;
+
+/****
+ *ULINT_TO_STRING
+ */
+ case function_ulint_to_string :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_string*/
+ break;
+
+/****
+ *ULINT_TO_LWORD
+ */
+ case function_ulint_to_lword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_lword*/
+ break;
+
+/****
+ *ULINT_TO_UINT
+ */
+ case function_ulint_to_uint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_uint*/
+ break;
+
+/****
+ *ULINT_TO_LREAL
+ */
+ case function_ulint_to_lreal :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_lreal*/
+ break;
+
+/****
+ *ULINT_TO_BYTE
+ */
+ case function_ulint_to_byte :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_byte*/
+ break;
+
+/****
+ *ULINT_TO_USINT
+ */
+ case function_ulint_to_usint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_usint*/
+ break;
+
+/****
+ *ULINT_TO_BOOL
+ */
+ case function_ulint_to_bool :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_bool*/
+ break;
+
+/****
+ *ULINT_TO_TIME
+ */
+ case function_ulint_to_time :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_time*/
+ break;
+
+/****
+ *ULINT_TO_INT
+ */
+ case function_ulint_to_int :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_int*/
+ break;
+
+/****
+ *BOOL_TO_REAL
+ */
+ case function_bool_to_real :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_real*/
+ break;
+
+/****
+ *BOOL_TO_SINT
+ */
+ case function_bool_to_sint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_sint*/
+ break;
+
+/****
+ *BOOL_TO_LINT
+ */
+ case function_bool_to_lint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_lint*/
+ break;
+
+/****
+ *BOOL_TO_DINT
+ */
+ case function_bool_to_dint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_dint*/
+ break;
+
+/****
+ *BOOL_TO_DATE
+ */
+ case function_bool_to_date :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_date*/
+ break;
+
+/****
+ *BOOL_TO_DWORD
+ */
+ case function_bool_to_dword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_dword*/
+ break;
+
+/****
+ *BOOL_TO_DT
+ */
+ case function_bool_to_dt :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_dt*/
+ break;
+
+/****
+ *BOOL_TO_TOD
+ */
+ case function_bool_to_tod :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_tod*/
+ break;
+
+/****
+ *BOOL_TO_UDINT
+ */
+ case function_bool_to_udint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_udint*/
+ break;
+
+/****
+ *BOOL_TO_WORD
+ */
+ case function_bool_to_word :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_word*/
+ break;
+
+/****
+ *BOOL_TO_STRING
+ */
+ case function_bool_to_string :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_string*/
+ break;
+
+/****
+ *BOOL_TO_LWORD
+ */
+ case function_bool_to_lword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_lword*/
+ break;
+
+/****
+ *BOOL_TO_UINT
+ */
+ case function_bool_to_uint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_uint*/
+ break;
+
+/****
+ *BOOL_TO_LREAL
+ */
+ case function_bool_to_lreal :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_lreal*/
+ break;
+
+/****
+ *BOOL_TO_BYTE
+ */
+ case function_bool_to_byte :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_byte*/
+ break;
+
+/****
+ *BOOL_TO_USINT
+ */
+ case function_bool_to_usint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_usint*/
+ break;
+
+/****
+ *BOOL_TO_ULINT
+ */
+ case function_bool_to_ulint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_ulint*/
+ break;
+
+/****
+ *BOOL_TO_TIME
+ */
+ case function_bool_to_time :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_time*/
+ break;
+
+/****
+ *BOOL_TO_INT
+ */
+ case function_bool_to_int :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bool_to_int*/
+ break;
+
+/****
+ *TIME_TO_REAL
+ */
+ case function_time_to_real :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_real*/
+ break;
+
+/****
+ *TIME_TO_SINT
+ */
+ case function_time_to_sint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_sint*/
+ break;
+
+/****
+ *TIME_TO_LINT
+ */
+ case function_time_to_lint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_lint*/
+ break;
+
+/****
+ *TIME_TO_DINT
+ */
+ case function_time_to_dint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_dint*/
+ break;
+
+/****
+ *TIME_TO_DWORD
+ */
+ case function_time_to_dword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_dword*/
+ break;
+
+/****
+ *TIME_TO_UDINT
+ */
+ case function_time_to_udint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_udint*/
+ break;
+
+/****
+ *TIME_TO_WORD
+ */
+ case function_time_to_word :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_word*/
+ break;
+
+/****
+ *TIME_TO_STRING
+ */
+ case function_time_to_string :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_string*/
+ break;
+
+/****
+ *TIME_TO_LWORD
+ */
+ case function_time_to_lword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_lword*/
+ break;
+
+/****
+ *TIME_TO_UINT
+ */
+ case function_time_to_uint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_uint*/
+ break;
+
+/****
+ *TIME_TO_LREAL
+ */
+ case function_time_to_lreal :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_lreal*/
+ break;
+
+/****
+ *TIME_TO_BYTE
+ */
+ case function_time_to_byte :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_byte*/
+ break;
+
+/****
+ *TIME_TO_USINT
+ */
+ case function_time_to_usint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_usint*/
+ break;
+
+/****
+ *TIME_TO_ULINT
+ */
+ case function_time_to_ulint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_ulint*/
+ break;
+
+/****
+ *TIME_TO_INT
+ */
+ case function_time_to_int :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_time_to_int*/
+ break;
+
+/****
+ *INT_TO_REAL
+ */
+ case function_int_to_real :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_real*/
+ break;
+
+/****
+ *INT_TO_SINT
+ */
+ case function_int_to_sint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_sint*/
+ break;
+
+/****
+ *INT_TO_LINT
+ */
+ case function_int_to_lint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_lint*/
+ break;
+
+/****
+ *INT_TO_DINT
+ */
+ case function_int_to_dint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_dint*/
+ break;
+
+/****
+ *INT_TO_DATE
+ */
+ case function_int_to_date :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_date*/
+ break;
+
+/****
+ *INT_TO_DWORD
+ */
+ case function_int_to_dword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_dword*/
+ break;
+
+/****
+ *INT_TO_DT
+ */
+ case function_int_to_dt :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_dt*/
+ break;
+
+/****
+ *INT_TO_TOD
+ */
+ case function_int_to_tod :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_tod*/
+ break;
+
+/****
+ *INT_TO_UDINT
+ */
+ case function_int_to_udint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_udint*/
+ break;
+
+/****
+ *INT_TO_WORD
+ */
+ case function_int_to_word :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_word*/
+ break;
+
+/****
+ *INT_TO_STRING
+ */
+ case function_int_to_string :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_string*/
+ break;
+
+/****
+ *INT_TO_LWORD
+ */
+ case function_int_to_lword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_lword*/
+ break;
+
+/****
+ *INT_TO_UINT
+ */
+ case function_int_to_uint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_uint*/
+ break;
+
+/****
+ *INT_TO_LREAL
+ */
+ case function_int_to_lreal :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_lreal*/
+ break;
+
+/****
+ *INT_TO_BYTE
+ */
+ case function_int_to_byte :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_byte*/
+ break;
+
+/****
+ *INT_TO_USINT
+ */
+ case function_int_to_usint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_usint*/
+ break;
+
+/****
+ *INT_TO_ULINT
+ */
+ case function_int_to_ulint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_ulint*/
+ break;
+
+/****
+ *INT_TO_BOOL
+ */
+ case function_int_to_bool :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_bool*/
+ break;
+
+/****
+ *INT_TO_TIME
+ */
+ case function_int_to_time :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_int_to_time*/
+ break;
+
+/****
+ *TRUNC
+ */
+ case function_trunc :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_trunc*/
+ break;
+
+/****
+ *BCD_TO_UDINT
+ */
+ case function_bcd_to_udint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ 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::udint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bcd_to_udint*/
+ break;
+
+/****
+ *BCD_TO_UINT
+ */
+ case function_bcd_to_uint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bcd_to_uint*/
+ break;
+
+/****
+ *BCD_TO_ULINT
+ */
+ case function_bcd_to_ulint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bcd_to_ulint*/
+ break;
+
+/****
+ *BCD_TO_USINT
+ */
+ case function_bcd_to_usint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_bcd_to_usint*/
+ break;
+
+/****
+ *UDINT_TO_BCD
+ */
+ case function_udint_to_bcd :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_udint_to_bcd*/
+ break;
+
+/****
+ *UINT_TO_BCD
+ */
+ case function_uint_to_bcd :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_uint_to_bcd*/
+ break;
+
+/****
+ *USINT_TO_BCD
+ */
+ case function_usint_to_bcd :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_usint_to_bcd*/
+ break;
+
+/****
+ *ULINT_TO_BCD
+ */
+ case function_ulint_to_bcd :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ulint_to_bcd*/
+ break;
+
+/****
+ *DATE_AND_TIME_TO_TIME_OF_DAY
+ */
+ case function_date_and_time_to_time_of_day :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_date_and_time_to_time_of_day*/
+ break;
+
+/****
+ *DATE_AND_TIME_TO_DATE
+ */
+ case function_date_and_time_to_date :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_date_and_time_to_date*/
+ break;
+
+/****
+ *ABS
+ */
+ case function_abs :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_num_type(IN_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_abs*/
+ break;
+
+/****
+ *SQRT
+ */
+ case function_sqrt :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_sqrt*/
+ break;
+
+/****
+ *LN
+ */
+ case function_ln :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ln*/
+ break;
+
+/****
+ *LOG
+ */
+ case function_log :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_log*/
+ break;
+
+/****
+ *EXP
+ */
+ case function_exp :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_exp*/
+ break;
+
+/****
+ *SIN
+ */
+ case function_sin :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_sin*/
+ break;
+
+/****
+ *COS
+ */
+ case function_cos :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_cos*/
+ break;
+
+/****
+ *TAN
+ */
+ case function_tan :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_tan*/
+ break;
+
+/****
+ *ASIN
+ */
+ case function_asin :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_asin*/
+ break;
+
+/****
+ *ACOS
+ */
+ case function_acos :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_acos*/
+ break;
+
+/****
+ *ATAN
+ */
+ case function_atan :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_atan*/
+ break;
+
+/****
+ *ADD
+ */
+ case function_add :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN1_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = last_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_add*/
+ break;
+
+/****
+ *MUL
+ */
+ case function_mul :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN1_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = last_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_mul*/
+ break;
+
+/****
+ *SUB
+ */
+ case function_sub :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN1_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = last_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_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::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_sub*/
+ break;
+
+/****
+ *DIV
+ */
+ case function_div :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN1_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = last_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_div*/
+ break;
+
+/****
+ *MOD
+ */
+ case function_mod :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN1_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = last_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_mod*/
+ break;
+
+/****
+ *EXPT
+ */
+ case function_expt :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN1_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_real_type(IN1_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = last_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_expt*/
+ break;
+
+/****
+ *MOVE
+ */
+ case function_move :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+
+ {
+
+ symbol_c * return_type_symbol = last_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_move*/
+ break;
+
+/****
+ *SHL
+ */
+ case function_shl :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_binary_type(IN_type_symbol))
+ {
+
+ {
+ identifier_c param_name("N");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *N_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *N_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (N_param_value == NULL)
+ N_param_value = function_call_param_iterator.next();
+ if (N_param_value != NULL) {
+ N_type_symbol = search_expression_type->get_type(N_param_value);
+ last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
+ }
+
+ if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_shl*/
+ break;
+
+/****
+ *SHR
+ */
+ case function_shr :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_binary_type(IN_type_symbol))
+ {
+
+ {
+ identifier_c param_name("N");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *N_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *N_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (N_param_value == NULL)
+ N_param_value = function_call_param_iterator.next();
+ if (N_param_value != NULL) {
+ N_type_symbol = search_expression_type->get_type(N_param_value);
+ last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
+ }
+
+ if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_shr*/
+ break;
+
+/****
+ *ROR
+ */
+ case function_ror :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_nbinary_type(IN_type_symbol))
+ {
+
+ {
+ identifier_c param_name("N");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *N_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *N_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (N_param_value == NULL)
+ N_param_value = function_call_param_iterator.next();
+ if (N_param_value != NULL) {
+ N_type_symbol = search_expression_type->get_type(N_param_value);
+ last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
+ }
+
+ if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ror*/
+ break;
+
+/****
+ *ROL
+ */
+ case function_rol :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_nbinary_type(IN_type_symbol))
+ {
+
+ {
+ identifier_c param_name("N");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *N_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *N_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (N_param_value == NULL)
+ N_param_value = function_call_param_iterator.next();
+ if (N_param_value != NULL) {
+ N_type_symbol = search_expression_type->get_type(N_param_value);
+ last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
+ }
+
+ if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_rol*/
+ break;
+
+/****
+ *AND
+ */
+ case function_and :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN1_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_binary_type(IN1_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = last_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_and*/
+ break;
+
+/****
+ *OR
+ */
+ case function_or :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN1_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_binary_type(IN1_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = last_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_or*/
+ break;
+
+/****
+ *XOR
+ */
+ case function_xor :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN1_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_binary_type(IN1_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = last_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_xor*/
+ break;
+
+/****
+ *NOT
+ */
+ case function_not :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_binary_type(IN_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_not*/
+ break;
+
+/****
+ *SEL
+ */
+ case function_sel :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *G_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(G_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN0");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN0_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN0_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN0_param_value == NULL)
+ IN0_param_value = function_call_param_iterator.next();
+ if (IN0_param_value != NULL) {
+ IN0_type_symbol = search_expression_type->get_type(IN0_param_value);
+ last_type_symbol = last_type_symbol && IN0_type_symbol && search_expression_type->is_same_type(IN0_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN0_type_symbol, last_type_symbol) : IN0_type_symbol ;
+ }
+
+
+ {
+
+ {
+ identifier_c param_name("IN1");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN1_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN1_param_value == NULL)
+ IN1_param_value = function_call_param_iterator.next();
+ if (IN1_param_value != NULL) {
+ IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
+ last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
+ }
+
+
+ {
+
+ symbol_c * return_type_symbol = last_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_sel*/
+ break;
+
+/****
+ *MAX
+ */
+ case function_max :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN1_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+
+ {
+
+ symbol_c * return_type_symbol = last_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_max*/
+ break;
+
+/****
+ *MIN
+ */
+ case function_min :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN1_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+
+ {
+
+ symbol_c * return_type_symbol = last_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_min*/
+ break;
+
+/****
+ *LIMIT
+ */
+ case function_limit :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *MN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+
+ {
+
+ {
+ 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(¶m_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 ;
+ }
+
+
+ {
+
+ {
+ identifier_c param_name("MX");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *MX_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *MX_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (MX_param_value == NULL)
+ MX_param_value = function_call_param_iterator.next();
+ if (MX_param_value != NULL) {
+ MX_type_symbol = search_expression_type->get_type(MX_param_value);
+ last_type_symbol = last_type_symbol && MX_type_symbol && search_expression_type->is_same_type(MX_type_symbol, last_type_symbol) ? search_expression_type->common_type(MX_type_symbol, last_type_symbol) : MX_type_symbol ;
+ }
+
+
+ {
+
+ symbol_c * return_type_symbol = IN_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_limit*/
+ break;
+
+/****
+ *MUX
+ */
+ case function_mux :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *K_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(K_type_symbol == NULL || search_expression_type->is_integer_type(K_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN0");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN0_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN0_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN0_param_value == NULL)
+ IN0_param_value = function_call_param_iterator.next();
+ if (IN0_param_value != NULL) {
+ IN0_type_symbol = search_expression_type->get_type(IN0_param_value);
+ last_type_symbol = last_type_symbol && IN0_type_symbol && search_expression_type->is_same_type(IN0_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN0_type_symbol, last_type_symbol) : IN0_type_symbol ;
+ }
+
+
+ {
+
+ {
+ identifier_c param_name("IN1");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN1_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN1_param_value == NULL)
+ IN1_param_value = function_call_param_iterator.next();
+ if (IN1_param_value != NULL) {
+ IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
+ last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
+ }
+
+
+ {
+
+ symbol_c * return_type_symbol = last_type_symbol;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_mux*/
+ break;
+
+/****
+ *GT
+ */
+ case function_gt :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN1_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_gt*/
+ break;
+
+/****
+ *GE
+ */
+ case function_ge :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN1_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ge*/
+ break;
+
+/****
+ *EQ
+ */
+ case function_eq :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN1_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_eq*/
+ break;
+
+/****
+ *LT
+ */
+ case function_lt :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN1_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_lt*/
+ break;
+
+/****
+ *LE
+ */
+ case function_le :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN1_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_le*/
+ break;
+
+/****
+ *NE
+ */
+ case function_ne :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN1_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_ne*/
+ break;
+
+/****
+ *LEN
+ */
+ case function_len :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_len*/
+ break;
+
+/****
+ *LEFT
+ */
+ case function_left :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("L");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *L_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *L_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (L_param_value == NULL)
+ L_param_value = function_call_param_iterator.next();
+ if (L_param_value != NULL) {
+ L_type_symbol = search_expression_type->get_type(L_param_value);
+ last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
+ }
+
+ if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_left*/
+ break;
+
+/****
+ *RIGHT
+ */
+ case function_right :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("L");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *L_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *L_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (L_param_value == NULL)
+ L_param_value = function_call_param_iterator.next();
+ if (L_param_value != NULL) {
+ L_type_symbol = search_expression_type->get_type(L_param_value);
+ last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
+ }
+
+ if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_right*/
+ break;
+
+/****
+ *MID
+ */
+ case function_mid :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("L");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *L_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *L_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (L_param_value == NULL)
+ L_param_value = function_call_param_iterator.next();
+ if (L_param_value != NULL) {
+ L_type_symbol = search_expression_type->get_type(L_param_value);
+ last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
+ }
+
+ if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol))
+ {
+
+ {
+ identifier_c param_name("P");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *P_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *P_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (P_param_value == NULL)
+ P_param_value = function_call_param_iterator.next();
+ if (P_param_value != NULL) {
+ P_type_symbol = search_expression_type->get_type(P_param_value);
+ last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
+ }
+
+ if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_mid*/
+ break;
+
+/****
+ *CONCAT
+ */
+ case function_concat :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN1_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_concat*/
+ break;
+
+/****
+ *INSERT
+ */
+ case function_insert :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN1_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("P");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *P_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *P_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (P_param_value == NULL)
+ P_param_value = function_call_param_iterator.next();
+ if (P_param_value != NULL) {
+ P_type_symbol = search_expression_type->get_type(P_param_value);
+ last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
+ }
+
+ if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_insert*/
+ break;
+
+/****
+ *DELETE
+ */
+ case function_delete :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("L");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *L_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *L_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (L_param_value == NULL)
+ L_param_value = function_call_param_iterator.next();
+ if (L_param_value != NULL) {
+ L_type_symbol = search_expression_type->get_type(L_param_value);
+ last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
+ }
+
+ if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol))
+ {
+
+ {
+ identifier_c param_name("P");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *P_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *P_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (P_param_value == NULL)
+ P_param_value = function_call_param_iterator.next();
+ if (P_param_value != NULL) {
+ P_type_symbol = search_expression_type->get_type(P_param_value);
+ last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
+ }
+
+ if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_delete*/
+ break;
+
+/****
+ *REPLACE
+ */
+ case function_replace :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN1_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("L");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *L_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *L_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (L_param_value == NULL)
+ L_param_value = function_call_param_iterator.next();
+ if (L_param_value != NULL) {
+ L_type_symbol = search_expression_type->get_type(L_param_value);
+ last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
+ }
+
+ if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol))
+ {
+
+ {
+ identifier_c param_name("P");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *P_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *P_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (P_param_value == NULL)
+ P_param_value = function_call_param_iterator.next();
+ if (P_param_value != NULL) {
+ P_type_symbol = search_expression_type->get_type(P_param_value);
+ last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
+ }
+
+ if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_replace*/
+ break;
+
+/****
+ *FIND
+ */
+ case function_find :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ symbol_c *IN1_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ {
+ identifier_c param_name("IN2");
+ /* Get the value from a foo(<param_name> = <param_value>) style call */
+ symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
+ symbol_c *IN2_type_symbol = NULL;
+
+ /* Get the value from a foo(<param_value>) style call */
+ if (IN2_param_value == NULL)
+ IN2_param_value = function_call_param_iterator.next();
+ if (IN2_param_value != NULL) {
+ IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
+ last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
+ }
+
+ if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ return return_type_symbol;
+
+ }
+
+
+ ERROR;
+ }
+
+ }
+
+
+ ERROR;
+ }
+
+ }/*function_find*/
+ break;
+
+ case function_none :
+ ERROR;
+ }
+ return NULL;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/search_var_instance_decl.cc Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,485 @@
+/*
+ * (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 variable instance, including
+ * function block instances.
+ * A reference to the relevant variable declaration is returned.
+ * The variable instance may NOT be a member of a structure of a memeber
+ * of a structure of an element of an array of ...
+ *
+ * example:
+ * window.points[1].coordinate.x
+ * window.points[1].colour
+ * etc... ARE NOT ALLOWED!
+ *
+ * This class must only be passed the name of the variable that will appear
+ * in the variable declaration. In the above examples, this would be
+ * 'window' !!
+ *
+ *
+ * If you need to pass a complete name of a variable instance (such as
+ * 'window.points[1].coordinate.x') use the search_varfb_instance_type_c instead!
+ */
+
+/* Note that current_type_decl that this class returns may reference the
+ * name of a type, or the type declaration itself!
+ * For an example of the first, consider a variable declared as ...
+ * x : AAA;
+ * where the AAA type is previously declared as whatever.
+ * For an example of the second, consider a variable declared as ...
+ * x : array of int [10]; ----> is allowed
+ *
+ * If it is the first, we will return a reference to the name, if the second
+ * we return a reference to the declaration!!
+ */
+#include "absyntax_utils.hh"
+
+
+search_var_instance_decl_c::search_var_instance_decl_c(symbol_c *search_scope) {
+ this->current_vartype = none_vt;
+ this->search_scope = search_scope;
+ this->search_name = NULL;
+ this->current_type_decl = NULL;
+}
+
+symbol_c *search_var_instance_decl_c::get_decl(symbol_c *variable_instance_name) {
+ this->search_name = variable_instance_name;
+ return (symbol_c *)search_scope->accept(*this);
+}
+
+unsigned int search_var_instance_decl_c::get_vartype() {
+ return current_vartype;
+}
+
+/***************************/
+/* B 0 - Programming Model */
+/***************************/
+void *search_var_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 */
+/******************************************/
+/* edge -> The F_EDGE or R_EDGE directive */
+// SYM_REF2(edge_declaration_c, edge, var1_list)
+// TODO
+
+void *search_var_instance_decl_c::visit(input_declarations_c *symbol) {
+ current_vartype = input_vt;
+ void *res = symbol->input_declaration_list->accept(*this);
+ if (res == NULL) {
+ current_vartype = none_vt;
+ }
+ return res;
+}
+
+/* VAR_OUTPUT [RETAIN | NON_RETAIN] var_init_decl_list END_VAR */
+/* option -> may be NULL ! */
+void *search_var_instance_decl_c::visit(output_declarations_c *symbol) {
+ current_vartype = output_vt;
+ void *res = symbol->var_init_decl_list->accept(*this);
+ if (res == NULL) {
+ current_vartype = none_vt;
+ }
+ return res;
+}
+
+/* VAR_IN_OUT var_declaration_list END_VAR */
+void *search_var_instance_decl_c::visit(input_output_declarations_c *symbol) {
+ current_vartype = inoutput_vt;
+ void *res = symbol->var_declaration_list->accept(*this);
+ if (res == NULL) {
+ current_vartype = none_vt;
+ }
+ return res;
+}
+
+/* VAR [CONSTANT] var_init_decl_list END_VAR */
+/* option -> may be NULL ! */
+/* helper symbol for input_declarations */
+void *search_var_instance_decl_c::visit(var_declarations_c *symbol) {
+ current_vartype = private_vt;
+ void *res = symbol->var_init_decl_list->accept(*this);
+ if (res == NULL) {
+ current_vartype = none_vt;
+ }
+ return res;
+}
+
+/* VAR RETAIN var_init_decl_list END_VAR */
+void *search_var_instance_decl_c::visit(retentive_var_declarations_c *symbol) {
+ current_vartype = private_vt;
+ void *res = symbol->var_init_decl_list->accept(*this);
+ if (res == NULL) {
+ current_vartype = none_vt;
+ }
+ return res;
+}
+
+/* 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)
+void *search_var_instance_decl_c::visit(located_var_declarations_c *symbol) {
+ current_vartype = located_vt;
+ void *res = symbol->located_var_decl_list->accept(*this);
+ if (res == NULL) {
+ current_vartype = none_vt;
+ }
+ return res;
+}
+
+/*| VAR_EXTERNAL [CONSTANT] external_declaration_list END_VAR */
+/* option -> may be NULL ! */
+//SYM_REF2(external_var_declarations_c, option, external_declaration_list)
+void *search_var_instance_decl_c::visit(external_var_declarations_c *symbol) {
+ current_vartype = external_vt;
+ void *res = symbol->external_declaration_list->accept(*this);
+ if (res == NULL) {
+ current_vartype = none_vt;
+ }
+ return res;
+}
+
+/*| 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)
+void *search_var_instance_decl_c::visit(global_var_declarations_c *symbol) {
+ current_vartype = global_vt;
+ void *res = symbol->global_var_decl_list->accept(*this);
+ if (res == NULL) {
+ current_vartype = none_vt;
+ }
+ return res;
+}
+
+/* var1_list is one of the following...
+ * simple_spec_init_c *
+ * subrange_spec_init_c *
+ * enumerated_spec_init_c *
+ */
+// SYM_REF2(var1_init_decl_c, var1_list, spec_init)
+void *search_var_instance_decl_c::visit(var1_init_decl_c *symbol) {
+ current_type_decl = symbol->spec_init;
+ return symbol->var1_list->accept(*this);
+}
+
+/* var1_list ',' variable_name */
+// SYM_LIST(var1_list_c)
+void *search_var_instance_decl_c::visit(var1_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_type_decl should be != NULL */
+ return current_type_decl;
+ }
+ return NULL;
+}
+
+/* name_list ':' function_block_type_name ASSIGN structure_initialization */
+/* structure_initialization -> may be NULL ! */
+void *search_var_instance_decl_c::visit(fb_name_decl_c *symbol) {
+ current_type_decl = symbol->function_block_type_name;
+ return symbol->fb_name_list->accept(*this);
+}
+
+/* name_list ',' fb_name */
+void *search_var_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_type_decl;
+ }
+ return NULL;
+}
+
+/* var1_list ':' array_spec_init */
+// SYM_REF2(array_var_init_decl_c, var1_list, array_spec_init)
+void *search_var_instance_decl_c::visit(array_var_init_decl_c *symbol) {
+ current_type_decl = symbol->array_spec_init;
+ return symbol->var1_list->accept(*this);
+}
+
+/* var1_list ':' initialized_structure */
+// SYM_REF2(structured_var_init_decl_c, var1_list, initialized_structure)
+void *search_var_instance_decl_c::visit(structured_var_init_decl_c *symbol) {
+ current_type_decl = symbol->initialized_structure;
+ return symbol->var1_list->accept(*this);
+}
+
+/* var1_list ':' array_specification */
+// SYM_REF2(array_var_declaration_c, var1_list, array_specification)
+void *search_var_instance_decl_c::visit(array_var_declaration_c *symbol) {
+ current_type_decl = symbol->array_specification;
+ return symbol->var1_list->accept(*this);
+}
+
+/* var1_list ':' structure_type_name */
+// SYM_REF2(structured_var_declaration_c, var1_list, structure_type_name)
+void *search_var_instance_decl_c::visit(structured_var_declaration_c *symbol) {
+ current_type_decl = symbol->structure_type_name;
+ return symbol->var1_list->accept(*this);
+}
+
+/* [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)
+// TODO!!
+
+/* 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 *search_var_instance_decl_c::visit(external_declaration_c *symbol) {
+ if (compare_identifiers(symbol->global_var_name, search_name) == 0)
+ return symbol->specification;
+ return NULL;
+}
+
+/*| 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)
+void *search_var_instance_decl_c::visit(global_var_decl_c *symbol) {
+ if (symbol->type_specification != NULL) {
+ current_type_decl = symbol->type_specification;
+ return symbol->global_var_spec->accept(*this);
+ }
+ else
+ return NULL;
+}
+
+/*| global_var_name location */
+//SYM_REF2(global_var_spec_c, global_var_name, location)
+void *search_var_instance_decl_c::visit(global_var_spec_c *symbol) {
+ if (symbol->global_var_name != NULL && compare_identifiers(symbol->global_var_name, search_name) == 0)
+ return current_type_decl;
+ else
+ return symbol->location->accept(*this);
+}
+
+/*| global_var_list ',' global_var_name */
+//SYM_LIST(global_var_list_c)
+void *search_var_instance_decl_c::visit(global_var_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_type_decl should be != NULL */
+ return current_type_decl;
+ }
+ return NULL;
+}
+
+/* [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)
+void *search_var_instance_decl_c::visit(located_var_decl_c *symbol) {
+ if (symbol->variable_name != NULL && compare_identifiers(symbol->variable_name, search_name) == 0)
+ return symbol->located_var_spec_init;
+ else {
+ current_type_decl = symbol->located_var_spec_init;
+ return symbol->location->accept(*this);
+ }
+}
+
+/*| 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)
+// TODO!!
+
+/* AT direct_variable */
+// SYM_REF2(location_c, direct_variable, unused)
+void *search_var_instance_decl_c::visit(location_c *symbol) {
+ if (compare_identifiers(symbol->direct_variable, search_name) == 0)
+ return current_type_decl;
+ else
+ return NULL;
+}
+
+/*| global_var_list ',' global_var_name */
+// SYM_LIST(global_var_list_c)
+// TODO!!
+
+/* var1_list ':' single_byte_string_spec */
+// SYM_REF2(single_byte_string_var_declaration_c, var1_list, single_byte_string_spec)
+void *search_var_instance_decl_c::visit(single_byte_string_var_declaration_c *symbol) {
+ current_type_decl = symbol->single_byte_string_spec;
+ return symbol->var1_list->accept(*this);
+}
+
+/* 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)
+// TODO!!
+
+/* var1_list ':' double_byte_string_spec */
+// SYM_REF2(double_byte_string_var_declaration_c, var1_list, double_byte_string_spec)
+void *search_var_instance_decl_c::visit(double_byte_string_var_declaration_c *symbol) {
+ current_type_decl = symbol->double_byte_string_spec;
+ return symbol->var1_list->accept(*this);
+}
+
+/* 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)
+// TODO!!
+
+/* variable_name incompl_location ':' var_spec */
+// SYM_REF4(incompl_located_var_decl_c, variable_name, incompl_location, var_spec, unused)
+// TODO!!
+
+/* AT incompl_location_token */
+// SYM_TOKEN(incompl_location_c)
+// TODO!!
+
+
+/**************************************/
+/* B.1.5 - Program organization units */
+/**************************************/
+/***********************/
+/* B 1.5.1 - Functions */
+/***********************/
+// SYM_REF4(function_declaration_c, derived_function_name, type_name, var_declarations_list, function_body)
+void *search_var_instance_decl_c::visit(function_declaration_c *symbol) {
+ /* functions have a variable named after themselves, to store
+ * the variable that will be returned!!
+ */
+ if (compare_identifiers(symbol->derived_function_name, search_name) == 0)
+ return symbol->type_name;
+
+ /* 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_var_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_var_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);
+}
+
+
+/********************************/
+/* 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)
+*/
+void *search_var_instance_decl_c::visit(configuration_declaration_c *symbol) {
+ /* no need to search through all the configuration, so we only
+ * visit the global variable declarations...!
+ */
+ if (symbol->global_var_declarations != NULL)
+ return symbol->global_var_declarations->accept(*this);
+ else
+ return NULL;
+}
+
+/*
+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)
+void *search_var_instance_decl_c::visit(resource_declaration_c *symbol) {
+ /* no need to search through all the resource, so we only
+ * visit the global variable declarations...!
+ */
+ if (symbol->global_var_declarations != NULL)
+ return symbol->global_var_declarations->accept(*this);
+ else
+ return NULL;
+}
+
+/* task_configuration_list program_configuration_list */
+// SYM_REF2(single_resource_declaration_c, task_configuration_list, program_configuration_list)
+void *search_var_instance_decl_c::visit(single_resource_declaration_c *symbol) {
+ /* no need to search through all the resource,
+ * and there is no global variable declarations...!
+ */
+ return NULL;
+}
+
+#if 0
+/*********************/
+/* B 1.4 - Variables */
+/*********************/
+SYM_REF2(symbolic_variable_c, var_name, unused)
+
+/********************************************/
+/* B.1.4.1 Directly Represented Variables */
+/********************************************/
+SYM_TOKEN(direct_variable_c)
+
+/*************************************/
+/* B.1.4.2 Multi-element Variables */
+/*************************************/
+/* subscripted_variable '[' subscript_list ']' */
+SYM_REF2(array_variable_c, subscripted_variable, subscript_list)
+
+/* subscript_list ',' subscript */
+SYM_LIST(subscript_list_c)
+
+/* 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)
+
+
+
+};
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/search_var_instance_decl.hh Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,287 @@
+/*
+ * (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 variable instance, including
+ * function block instances.
+ * A reference to the relevant variable declaration is returned.
+ * The variable instance may NOT be a member of a structure of a memeber
+ * of a structure of an element of an array of ...
+ *
+ * example:
+ * window.points[1].coordinate.x
+ * window.points[1].colour
+ * etc... ARE NOT ALLOWED!
+ *
+ * This class must only be passed the name of the variable that will appear
+ * in the variable declaration. In the above examples, this would be
+ * 'window' !!
+ *
+ *
+ * If you need to pass a complete name of a variable instance (such as
+ * 'window.points[1].coordinate.x') use the search_varfb_instance_type_c instead!
+ */
+/* Note that current_type_decl that this class returns may reference the
+ * name of a type, or the type declaration itself!
+ * For an example of the first, consider a variable declared as ...
+ * x : AAA;
+ * where the AAA type is previously declared as whatever.
+ * For an example of the second, consider a variable declared as ...
+ * x : array of int [10]; ----> is allowed
+ *
+ * If it is the first, we will return a reference to the name, if the second
+ * we return a reference to the declaration!!
+ */
+
+
+class search_var_instance_decl_c: public search_visitor_c {
+
+ private:
+ symbol_c *search_scope;
+ symbol_c *search_name;
+ symbol_c *current_type_decl;
+
+ /* variable used to store the type of variable currently being processed... */
+ /* Will contain a single value of generate_c_vardecl_c::XXXX_vt */
+ unsigned int current_vartype;
+
+ public:
+ search_var_instance_decl_c(symbol_c *search_scope);
+ symbol_c *get_decl(symbol_c *variable_instance_name);
+ unsigned int get_vartype();
+
+ public:
+
+ /* the types of variables that need to be processed... */
+ static const unsigned int none_vt = 0x0000;
+ static const unsigned int input_vt = 0x0001; // VAR_INPUT
+ static const unsigned int output_vt = 0x0002; // VAR_OUTPUT
+ static const unsigned int inoutput_vt = 0x0004; // VAR_IN_OUT
+ static const unsigned int private_vt = 0x0008; // VAR
+ static const unsigned int temp_vt = 0x0010; // VAR_TEMP
+ static const unsigned int external_vt = 0x0020; // VAR_EXTERNAL
+ static const unsigned int global_vt = 0x0040; // VAR_GLOBAL
+ static const unsigned int located_vt = 0x0080; // VAR <var_name> AT <location>
+
+ private:
+ /***************************/
+ /* B 0 - Programming Model */
+ /***************************/
+ void *visit(library_c *symbol);
+
+ /******************************************/
+ /* B 1.4.3 - Declaration & Initialisation */
+ /******************************************/
+ /* edge -> The F_EDGE or R_EDGE directive */
+ // SYM_REF2(edge_declaration_c, edge, var1_list)
+ // TODO
+ void *visit(input_declarations_c *symbol);
+ /* VAR_OUTPUT [RETAIN | NON_RETAIN] var_init_decl_list END_VAR */
+ /* option -> may be NULL ! */
+ void *visit(output_declarations_c *symbol);
+ /* VAR_IN_OUT var_declaration_list END_VAR */
+ void *visit(input_output_declarations_c *symbol);
+ /* VAR [CONSTANT] var_init_decl_list END_VAR */
+ /* option -> may be NULL ! */
+ /* helper symbol for input_declarations */
+ void *visit(var_declarations_c *symbol);
+ /* VAR RETAIN var_init_decl_list END_VAR */
+ void *visit(retentive_var_declarations_c *symbol);
+ /* 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)
+ void *visit(located_var_declarations_c *symbol);
+ /*| 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);
+ /*| 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)
+ void *visit(global_var_declarations_c *symbol);
+ /* var1_list is one of the following...
+ * simple_spec_init_c *
+ * subrange_spec_init_c *
+ * enumerated_spec_init_c *
+ */
+ // SYM_REF2(var1_init_decl_c, var1_list, spec_init)
+ void *visit(var1_init_decl_c *symbol);
+ /* var1_list ',' variable_name */
+ // SYM_LIST(var1_list_c)
+ void *visit(var1_list_c *symbol);
+ /* 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);
+ /* 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);
+ /* 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);
+ /* [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)
+ // TODO!!
+
+ /* 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);
+ /*| 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)
+ void *visit(global_var_decl_c *symbol);
+ /*| global_var_name location */
+ //SYM_REF2(global_var_spec_c, global_var_name, location)
+ void *visit(global_var_spec_c *symbol);
+ /*| global_var_list ',' global_var_name */
+ //SYM_LIST(global_var_list_c)
+ void *visit(global_var_list_c *symbol);
+ /* [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)
+ void *visit(located_var_decl_c *symbol);
+ /*| 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)
+ // TODO!!
+ /* AT direct_variable */
+ // SYM_REF2(location_c, direct_variable, unused)
+ void *visit(location_c *symbol);
+ /*| global_var_list ',' global_var_name */
+ // SYM_LIST(global_var_list_c)
+ // TODO!!
+ /* var1_list ':' single_byte_string_spec */
+ // SYM_REF2(single_byte_string_var_declaration_c, var1_list, single_byte_string_spec)
+ void *visit(single_byte_string_var_declaration_c *symbol);
+ /* 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)
+ // TODO!!
+
+ /* var1_list ':' double_byte_string_spec */
+ // SYM_REF2(double_byte_string_var_declaration_c, var1_list, double_byte_string_spec)
+ void *visit(double_byte_string_var_declaration_c *symbol);
+ /* 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)
+ // TODO!!
+
+ /* variable_name incompl_location ':' var_spec */
+ // SYM_REF4(incompl_located_var_decl_c, variable_name, incompl_location, var_spec, unused)
+ // TODO!!
+
+ /* AT incompl_location_token */
+ // SYM_TOKEN(incompl_location_c)
+ // TODO!!
+
+
+ /**************************************/
+ /* B.1.5 - Program organization units */
+ /**************************************/
+ /***********************/
+ /* B 1.5.1 - Functions */
+ /***********************/
+ // SYM_REF4(function_declaration_c, derived_function_name, type_name, var_declarations_list, function_body)
+ 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);
+
+ /********************************/
+ /* 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)
+ */
+ void *visit(configuration_declaration_c *symbol);
+ /*
+ 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)
+ void *visit(resource_declaration_c *symbol);
+
+ /* task_configuration_list program_configuration_list */
+ // SYM_REF2(single_resource_declaration_c, task_configuration_list, program_configuration_list)
+ void *visit(single_resource_declaration_c *symbol);
+
+#if 0
+/*********************/
+/* B 1.4 - Variables */
+/*********************/
+SYM_REF2(symbolic_variable_c, var_name, unused)
+
+/********************************************/
+/* B.1.4.1 Directly Represented Variables */
+/********************************************/
+SYM_TOKEN(direct_variable_c)
+
+/*************************************/
+/* B.1.4.2 Multi-element Variables */
+/*************************************/
+/* subscripted_variable '[' subscript_list ']' */
+SYM_REF2(array_variable_c, subscripted_variable, subscript_list)
+
+/* subscript_list ',' subscript */
+SYM_LIST(subscript_list_c)
+
+/* 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)
+#endif
+
+}; // search_var_instance_decl_c
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/search_varfb_instance_type.cc Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,308 @@
+/*
+ * (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 variable.
+ * The variable may be a simple variable, a function block instance, a
+ * struture element within a data structured type (a struct or a fb), or
+ * an array element.
+ * A mixture of array element of a structure element of a structure element
+ * of a .... is also suported!
+ *
+ * A reference to the relevant base type __definition__ is returned.
+ * This means that if we find that the variable is of type MY_INT,
+ * which was previously declared to be
+ * TYPE MY_INT: INT := 9;
+ * this class wil return INT, and __not__ MY_INT !!
+ *
+ *
+ * example:
+ * window.points[1].coordinate.x
+ * window.points[1].colour
+ * etc... ARE ALLOWED!
+ *
+ * This class must be passed the scope within which the
+ * variable was declared, and the variable name...
+ */
+
+
+#include "absyntax_utils.hh"
+
+
+search_varfb_instance_type_c::search_varfb_instance_type_c(symbol_c *search_scope): search_var_instance_decl(search_scope) {
+ this->decompose_var_instance_name = NULL;
+ this->current_structelement_name = NULL;
+ this->search_base_type = false;
+}
+
+symbol_c *search_varfb_instance_type_c::get_type(symbol_c *variable_name, bool base_type) {
+ this->current_structelement_name = NULL;
+ this->decompose_var_instance_name = new decompose_var_instance_name_c(variable_name);
+ this->search_base_type = base_type;
+ if (NULL == decompose_var_instance_name) ERROR;
+
+ /* find the part of the variable name that will appear in the
+ * variable declaration, for e.g., in window.point.x, this would be
+ * window!
+ */
+ symbol_c *var_name_part = decompose_var_instance_name->next_part();
+ if (NULL == var_name_part) ERROR;
+
+ /* Now we try to find the variable instance declaration, to determine its type... */
+ symbol_c *var_decl = search_var_instance_decl.get_decl(var_name_part);
+ if (NULL == var_decl) {
+ /* variable instance declaration not found! */
+ ERROR;
+ }
+
+ /* if it is a struct or function block, we must search the type
+ * of the struct or function block member.
+ * This is done by this class visiting the var_decl.
+ * This class, while visiting, will recursively call
+ * decompose_var_instance_name->get_next() when and if required...
+ */
+ symbol_c *res = (symbol_c *)var_decl->accept(*this);
+ if (NULL == res) ERROR;
+
+ /* make sure that we have decomposed all strcuture elements of the variable name */
+ symbol_c *var_name = decompose_var_instance_name->next_part();
+ if (NULL != var_name) ERROR;
+
+ return res;
+}
+
+unsigned int search_varfb_instance_type_c::get_vartype(symbol_c *variable_name) {
+ this->current_structelement_name = NULL;
+ this->decompose_var_instance_name = new decompose_var_instance_name_c(variable_name);
+ if (NULL == decompose_var_instance_name) ERROR;
+
+ /* find the part of the variable name that will appear in the
+ * variable declaration, for e.g., in window.point.x, this would be
+ * window!
+ */
+ symbol_c *var_name_part = decompose_var_instance_name->next_part();
+ if (NULL == var_name_part) ERROR;
+
+ /* Now we try to find the variable instance declaration, to determine its type... */
+ symbol_c *var_decl = search_var_instance_decl.get_decl(var_name_part);
+ if (NULL == var_decl) {
+ /* variable instance declaration not found! */
+ return 0;
+ }
+
+ /* if it is a struct or function block, we must search the type
+ * of the struct or function block member.
+ * This is done by this class visiting the var_decl.
+ * This class, while visiting, will recursively call
+ * decompose_var_instance_name->get_next() when and if required...
+ */
+ unsigned int res = search_var_instance_decl.get_vartype();
+
+ /* make sure that we have decomposed all strcuture elements of the variable name */
+ symbol_c *var_name = decompose_var_instance_name->next_part();
+ if (NULL != var_name) ERROR;
+
+ return res;
+}
+
+/* a helper function... */
+void *search_varfb_instance_type_c::visit_list(list_c *list) {
+ if (NULL == current_structelement_name) ERROR;
+
+ for(int i = 0; i < list->n; i++) {
+ void *res = list->elements[i]->accept(*this);
+ if (res != NULL)
+ return res;
+ }
+ /* not found! */
+ return NULL;
+}
+
+/* a helper function... */
+void *search_varfb_instance_type_c::base_type(symbol_c *symbol) {
+ search_base_type_c search_base_type;
+ return symbol->accept(search_base_type);
+}
+
+/* We override the base class' visitor to identifier_c.
+ * This is so because the base class does not consider a function block
+ * to be a type, unlike this class that allows a variable instance
+ * of a function block type...
+ */
+void *search_varfb_instance_type_c::visit(identifier_c *type_name) {
+ /* look up the type declaration... */
+ symbol_c *fb_decl = function_block_type_symtable.find_value(type_name);
+ if (fb_decl != function_block_type_symtable.end_value())
+ /* Type declaration found!! */
+ return fb_decl->accept(*this);
+
+ /* No. It is not a function block, so we let
+ * the base class take care of it...
+ */
+ if (this->search_base_type)
+ return search_base_type_c::visit(type_name);
+ else
+ return type_name;
+}
+
+/********************************/
+/* B 1.3.3 - Derived data types */
+/********************************/
+
+/* identifier ':' array_spec_init */
+void *search_varfb_instance_type_c::visit(array_type_declaration_c *symbol) {
+ return symbol->array_spec_init->accept(*this);
+}
+
+/* array_specification [ASSIGN array_initialization} */
+/* array_initialization may be NULL ! */
+void *search_varfb_instance_type_c::visit(array_spec_init_c *symbol) {
+ symbol_c *var_name = decompose_var_instance_name->next_part();
+ if (NULL != var_name)
+ current_structelement_name = var_name;
+ return symbol->array_specification->accept(*this);
+}
+
+/* ARRAY '[' array_subrange_list ']' OF non_generic_type_name */
+void *search_varfb_instance_type_c::visit(array_specification_c *symbol) {
+ symbol_c *var_name = decompose_var_instance_name->next_part();
+ if (NULL != var_name)
+ current_structelement_name = var_name;
+ return symbol->non_generic_type_name->accept(*this);
+}
+
+/* structure_type_name ':' structure_specification */
+void *search_varfb_instance_type_c::visit(structure_type_declaration_c *symbol) {
+ return symbol->structure_specification->accept(*this);
+ /* NOTE: structure_specification will point to either a
+ * initialized_structure_c
+ * OR A
+ * structure_element_declaration_list_c
+ */
+}
+
+/* structure_type_name ASSIGN structure_initialization */
+/* structure_initialization may be NULL ! */
+// SYM_REF2(initialized_structure_c, structure_type_name, structure_initialization)
+void *search_varfb_instance_type_c::visit(initialized_structure_c *symbol) {
+ /* make sure that we have decomposed all strcuture elements of the variable name */
+ symbol_c *var_name = decompose_var_instance_name->next_part();
+ if (NULL == var_name) {
+ /* this is it... !
+ * No need to look any further...
+ */
+ /* NOTE: we could simply do a
+ * return (void *)symbol;
+ * nevertheless, note that this search_varfb_instance_type_c
+ * class inherits from the search_base_type_c class,
+ * which means that it will usually return the base type,
+ * and not the derived type (*). If we are to be consistent,
+ * we should guarantee that we always return the base type.
+ * To do this we could use
+ * return (void *)symbol->accept(*this);
+ * since this class inherits from the search_base_type_c.
+ * However, in this case we don't want it to follow
+ * the structs as this search_varfb_instance_type_c does.
+ * We therefore have to create a new search_base_type_c
+ * instance to search through this type without going
+ * through the structs...
+ */
+ return base_type(symbol->structure_type_name);
+ }
+
+ /* now search the structure declaration */
+ current_structelement_name = var_name;
+ /* recursively find out the data type of var_name... */
+ 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_varfb_instance_type_c::visit(structure_element_declaration_list_c *symbol) {
+ return visit_list(symbol);
+}
+
+/* structure_element_name ':' spec_init */
+void *search_varfb_instance_type_c::visit(structure_element_declaration_c *symbol) {
+ if (NULL == current_structelement_name) ERROR;
+
+ if (compare_identifiers(symbol->structure_element_name, current_structelement_name) == 0)
+ return symbol->spec_init->accept(*this);
+
+ return NULL;
+}
+
+/* helper symbol for structure_initialization */
+/* structure_initialization: '(' structure_element_initialization_list ')' */
+/* structure_element_initialization_list ',' structure_element_initialization */
+void *search_varfb_instance_type_c::visit(structure_element_initialization_list_c *symbol) {ERROR; return NULL;} /* should never get called... */
+/* structure_element_name ASSIGN value */
+void *search_varfb_instance_type_c::visit(structure_element_initialization_c *symbol) {ERROR; return NULL;} /* should never get called... */
+
+
+
+/**************************************/
+/* B.1.5 - Program organization units */
+/**************************************/
+/*****************************/
+/* B 1.5.2 - Function Blocks */
+/*****************************/
+/* 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 *search_varfb_instance_type_c::visit(function_block_declaration_c *symbol) {
+ /* make sure that we have decomposed all strcuture elements of the variable name */
+
+ symbol_c *var_name = decompose_var_instance_name->next_part();
+ if (NULL == var_name) {
+ /* this is it... !
+ * No need to look any further...
+ * Note also that, unlike for the struct types, a function block may
+ * not be defined based on another (i.e. no inheritance is allowed),
+ * so this function block is already the most base type.
+ * We simply return it.
+ */
+ return (void *)symbol;
+ }
+
+ /* now search the function block declaration for the variable... */
+ search_var_instance_decl_c search_decl(symbol);
+ symbol_c *var_decl = search_decl.get_decl(var_name);
+ if (NULL == var_decl) {
+ /* variable instance declaration not found! */
+ return NULL;
+ }
+
+ /* We have found the declaration.
+ * Should we look any further?
+ */
+ var_name = decompose_var_instance_name->next_part();
+ if (NULL == var_name) {
+ /* this is it... ! */
+ return base_type(var_decl);
+ }
+
+ current_structelement_name = var_name;
+ /* recursively find out the data type of var_name... */
+ return symbol->var_declarations->accept(*this);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/search_varfb_instance_type.hh Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,135 @@
+/*
+ * (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 variable.
+ * The variable may be a simple variable, a function block instance, a
+ * struture element within a data structured type (a struct or a fb), or
+ * an array element.
+ * A mixture of array element of a structure element of a structure element
+ * of a .... is also suported!
+ *
+ * A reference to the relevant base type __definition__ is returned.
+ * This means that if we find that the variable is of type MY_INT,
+ * which was previously declared to be
+ * TYPE MY_INT: INT := 9;
+ * this class wil return INT, and __not__ MY_INT !!
+ *
+ *
+ * example:
+ * window.points[1].coordinate.x
+ * window.points[1].colour
+ * etc... ARE ALLOWED!
+ *
+ * This class must be passed the scope within which the
+ * variable was declared, and the variable name...
+ */
+
+class search_varfb_instance_type_c: public search_base_type_c {
+
+ private:
+ search_var_instance_decl_c search_var_instance_decl;
+ decompose_var_instance_name_c *decompose_var_instance_name;
+ symbol_c *current_structelement_name;
+ bool search_base_type;
+
+ public:
+ search_varfb_instance_type_c(symbol_c *search_scope);
+ symbol_c *get_type(symbol_c *variable_name, bool base_type = true);
+
+ unsigned int get_vartype(symbol_c *variable_name);
+
+ private:
+ /* a helper function... */
+ void *visit_list(list_c *list);
+
+ /* a helper function... */
+ void *base_type(symbol_c *symbol);
+
+
+ private:
+ /* We override the base class' visitor to identifier_c.
+ * This is so because the base class does not consider a function block
+ * to be a type, unlike this class that allows a variable instance
+ * of a function block type...
+ */
+ void *visit(identifier_c *type_name);
+
+ /********************************/
+ /* B 1.3.3 - Derived data types */
+ /********************************/
+
+ /* 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);
+
+ /* structure_type_name ':' structure_specification */
+ void *visit(structure_type_declaration_c *symbol);
+
+ /* structure_type_name ASSIGN structure_initialization */
+ /* structure_initialization may be NULL ! */
+ // SYM_REF2(initialized_structure_c, structure_type_name, structure_initialization)
+ 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); /* should never get called... */
+ /* structure_element_name ASSIGN value */
+ void *visit(structure_element_initialization_c *symbol); /* should never get called... */
+
+
+
+ /**************************************/
+ /* B.1.5 - Program organization units */
+ /**************************************/
+ /*****************************/
+ /* B 1.5.2 - Function Blocks */
+ /*****************************/
+ /* 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);
+
+}; // search_varfb_instance_type_c
+
+
+
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/spec_init_separator.cc Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,172 @@
+/*
+ * (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)
+ *
+ */
+
+/*
+ * Seperation of type specification and default value constructs
+ * (for e.g. simple_spec_init_c), into a type specificiation part,
+ * and a default value part.
+ */
+
+#include "spec_init_separator.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);
+
+
+spec_init_sperator_c *spec_init_sperator_c::get_class_instance(void) {
+ if (NULL == class_instance)
+ class_instance = new spec_init_sperator_c();
+
+ if (NULL == class_instance)
+ ERROR;
+
+ return class_instance;
+}
+
+ /* the only two public functions... */
+symbol_c *spec_init_sperator_c::get_spec(symbol_c *spec_init) {
+ search_what = search_spec;
+ return (symbol_c *)spec_init->accept(*get_class_instance());
+}
+
+symbol_c *spec_init_sperator_c::get_init(symbol_c *spec_init) {
+ search_what = search_init;
+ return (symbol_c *)spec_init->accept(*get_class_instance());
+}
+
+/*******************************************/
+/* B 1.1 - Letters, digits and identifiers */
+/*******************************************/
+// SYM_TOKEN(identifier_c)
+void *spec_init_sperator_c::visit(identifier_c *symbol) {
+ TRACE("spec_init_sperator_c::identifier_c");
+ switch (search_what) {
+ /* if we ever get called sith a simple identifier_c, then it must be a previously declared type... */
+ case search_spec: return symbol;
+ case search_init: return NULL;
+ }
+ ERROR; /* should never occur */
+ return NULL;
+}
+
+
+/********************************/
+/* B 1.3.3 - Derived data types */
+/********************************/
+
+/* simple_specification ASSIGN constant */
+void *spec_init_sperator_c::visit(simple_spec_init_c *symbol) {
+ TRACE("spec_init_sperator_c::simple_spec_init_c");
+ switch (search_what) {
+ case search_spec: return symbol->simple_specification;
+ case search_init: return symbol->constant;
+ }
+ ERROR; /* should never occur */
+ return NULL;
+}
+
+/* subrange_specification ASSIGN signed_integer */
+void *spec_init_sperator_c::visit(subrange_spec_init_c *symbol) {
+ TRACE("spec_init_sperator_c::subrange_spec_init_c");
+ switch (search_what) {
+ case search_spec: return symbol->subrange_specification->accept(*this);
+ case search_init: return symbol->signed_integer;
+ }
+ ERROR; /* should never occur */
+ return NULL;
+}
+
+/* integer_type_name '(' subrange')' */
+void *spec_init_sperator_c::visit(subrange_specification_c *symbol) {
+ TRACE("spec_init_sperator_c::subrange_specification_c");
+ switch (search_what) {
+ case search_spec: return symbol->integer_type_name;
+ case search_init: return NULL; /* should never occur */
+ }
+ ERROR; /* should never occur */
+ return NULL;
+}
+
+/* array_specification [ASSIGN array_initialization} */
+/* array_initialization may be NULL ! */
+void *spec_init_sperator_c::visit(array_spec_init_c *symbol) {
+ TRACE("spec_init_sperator_c::array_spec_init_c");
+ switch (search_what) {
+ case search_spec: return symbol->array_specification;
+ case search_init: return symbol->array_initialization;
+ }
+ return NULL;
+}
+
+/* enumerated_specification ASSIGN enumerated_value */
+void *spec_init_sperator_c::visit(enumerated_spec_init_c *symbol) {
+ TRACE("spec_init_sperator_c::enumerated_spec_init_c");
+ switch (search_what) {
+ case search_spec: return symbol->enumerated_specification;
+ case search_init: return symbol->enumerated_value;
+ }
+ ERROR; /* should never occur */
+ return NULL;
+}
+
+/* structure_type_name ASSIGN structure_initialization */
+/* structure_initialization may be NULL ! */
+//SYM_REF2(initialized_structure_c, structure_type_name, structure_initialization)
+void *spec_init_sperator_c::visit(initialized_structure_c *symbol) {
+ TRACE("spec_init_sperator_c::initialized_structure_c");
+ switch (search_what) {
+ case search_spec: return symbol->structure_type_name;
+ case search_init: return symbol->structure_initialization;
+ }
+ ERROR; /* should never occur */
+ return NULL;
+}
+
+
+/******************************************/
+/* B 1.4.3 - Declaration & Initialisation */
+/******************************************/
+
+/* fb_name_list ':' function_block_type_name ASSIGN structure_initialization */
+/* structure_initialization -> may be NULL ! */
+void *spec_init_sperator_c::visit(fb_name_decl_c *symbol) {
+ TRACE("spec_init_sperator_c::fb_name_decl_c");
+ switch (search_what) {
+ case search_spec: return symbol->function_block_type_name;
+ case search_init: return symbol->structure_initialization;
+ }
+ ERROR; /* should never occur */
+ return NULL;
+}
+
+spec_init_sperator_c *spec_init_sperator_c ::class_instance = NULL;
+spec_init_sperator_c::search_what_t spec_init_sperator_c::search_what;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/spec_init_separator.hh Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,96 @@
+/*
+ * (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)
+ *
+ */
+
+
+/*
+ * Separation of type specification and default value constructs
+ * (for e.g. simple_spec_init_c), into a type specificiation part,
+ * and a default value part.
+ */
+
+#include "../absyntax/absyntax.hh"
+#include "../absyntax/visitor.hh"
+
+class spec_init_sperator_c: public null_visitor_c {
+
+ private:
+ /* this is a singleton class... */
+ static spec_init_sperator_c *class_instance;
+ static spec_init_sperator_c *get_class_instance(void);
+
+ private:
+ typedef enum {search_spec, search_init} search_what_t;
+ static search_what_t search_what;
+
+ public:
+ /* the only two public functions... */
+ static symbol_c *get_spec(symbol_c *spec_init);
+
+ static symbol_c *get_init(symbol_c *spec_init);
+
+
+ private:
+
+
+ /*******************************************/
+ /* B 1.1 - Letters, digits and identifiers */
+ /*******************************************/
+ // SYM_TOKEN(identifier_c)
+ void *visit(identifier_c *symbol);
+
+
+ /********************************/
+ /* B 1.3.3 - Derived data types */
+ /********************************/
+
+ /* simple_specification ASSIGN constant */
+ void *visit(simple_spec_init_c *symbol);
+
+ /* subrange_specification ASSIGN signed_integer */
+ void *visit(subrange_spec_init_c *symbol);
+
+ /* integer_type_name '(' subrange')' */
+ void *visit(subrange_specification_c *symbol);
+
+ /* array_specification [ASSIGN array_initialization} */
+ /* array_initialization may be NULL ! */
+ void *visit(array_spec_init_c *symbol);
+
+ /* enumerated_specification ASSIGN enumerated_value */
+ void *visit(enumerated_spec_init_c *symbol);
+
+ /* structure_type_name ASSIGN structure_initialization */
+ /* structure_initialization may be NULL ! */
+ //SYM_REF2(initialized_structure_c, structure_type_name, structure_initialization)
+ void *visit(initialized_structure_c *symbol);
+
+
+ /******************************************/
+ /* B 1.4.3 - Declaration & Initialisation */
+ /******************************************/
+
+ /* fb_name_list ':' function_block_type_name ASSIGN structure_initialization */
+ /* structure_initialization -> may be NULL ! */
+ void *visit(fb_name_decl_c *symbol);
+}; /* class spec_init_sperator_c */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/type_initial_value.cc Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,360 @@
+/*
+ * (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 default initial value of a type declaration.
+ *
+ * This is part of the 4th stage that generates
+ * a c++ source program equivalent to the IL and ST
+ * code.
+ */
+/* Given a type definition declration, determine its default
+ * initial value. Note that types based on other types
+ * may have to iterate through each type it is based on
+ * to determine the initial value.
+ * E.g.
+ * TYPE
+ * A_t : INT := 10;
+ * B_t : A_t := 20;
+ * C_t : B_t;
+ * D_t : C_t := 40;
+ * END_TYPE
+ * Where the default initial value for C_t is 20!
+ */
+/* NOTE: The main program only needs one instance of
+ * this class of object. This class
+ * is therefore a singleton.
+ */
+
+
+#include "absyntax_utils.hh"
+
+//#define DEBUG
+#ifdef DEBUG
+#define TRACE(classname) printf("\n____%s____\n",classname);
+#else
+#define TRACE(classname)
+#endif
+
+
+type_initial_value_c *type_initial_value_c::instance(void) {
+ if (_instance != NULL)
+ return _instance;
+
+ _instance = new type_initial_value_c;
+
+ real_0 = new real_c("0");
+ integer_0 = new integer_c("0");
+ integer_1 = new integer_c("1");
+ bool_0 = new boolean_literal_c(new bool_type_name_c(),new boolean_false_c());
+ /* FIXME: Our current implementation only allows dates from 1970 onwards,
+ * but the standard defines the date 0001-01-01 as the default value
+ * for the DATE data type. Untill we fix our implementation, we use 1970-01-01
+ * as our default value!!
+ */
+ date_literal_0 = new date_literal_c(integer_1, integer_1, integer_1);
+ date_literal_0 = new date_literal_c(new integer_c("1970"), integer_1, integer_1);
+ daytime_literal_0 = new daytime_c(integer_0, integer_0, real_0);
+ time_0 = new duration_c(NULL, new seconds_c(integer_0, NULL)); // T#0S
+ date_0 = new date_c(date_literal_0); // D#0001-01-01
+ tod_0 = new time_of_day_c(daytime_literal_0); // TOD#00:00:00
+ dt_0 = new date_and_time_c(date_literal_0, daytime_literal_0); // DT#0001-01-01-00:00:00
+ string_0 = new single_byte_character_string_c("''");
+ wstring_0 = new double_byte_character_string_c("\"\"");
+
+ return _instance;
+}
+
+type_initial_value_c::type_initial_value_c(void) {}
+
+
+
+symbol_c *type_initial_value_c::get(identifier_c *type_name) {
+ TRACE("type_initial_value_c::get(): called ");
+ return (symbol_c *)type_name->accept(*this);
+}
+
+
+
+
+void *type_initial_value_c::handle_type_spec(symbol_c *base_type_name, symbol_c *type_spec_init) {
+ if (type_spec_init != NULL)
+ return type_spec_init;
+ /* no initial value specified, so we return
+ * the initial value of the type this type is based on...
+ */
+ return base_type_name->accept(*this);
+}
+
+
+
+void *type_initial_value_c::visit(identifier_c *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!! */
+ /* NOTE: Variables declared out of function block 'data types',
+ * for eg: VAR timer: TON; END_VAR
+ * do not have a default value, so (TON) will never be found in the
+ * type symbol table. This means we cannot simply consider this
+ * an error and abort, but must rather return a NULL.
+ */
+ return NULL;
+
+ return type_decl->accept(*this);
+}
+
+/***********************************/
+/* B 1.3.1 - Elementary Data Types */
+/***********************************/
+void *type_initial_value_c::visit(time_type_name_c *symbol) {return (void *)time_0;}
+void *type_initial_value_c::visit(bool_type_name_c *symbol) {return (void *)bool_0;}
+void *type_initial_value_c::visit(sint_type_name_c *symbol) {return (void *)integer_0;}
+void *type_initial_value_c::visit(int_type_name_c *symbol) {return (void *)integer_0;}
+void *type_initial_value_c::visit(dint_type_name_c *symbol) {return (void *)integer_0;}
+void *type_initial_value_c::visit(lint_type_name_c *symbol) {return (void *)integer_0;}
+void *type_initial_value_c::visit(usint_type_name_c *symbol) {return (void *)integer_0;}
+void *type_initial_value_c::visit(uint_type_name_c *symbol) {return (void *)integer_0;}
+void *type_initial_value_c::visit(udint_type_name_c *symbol) {return (void *)integer_0;}
+void *type_initial_value_c::visit(ulint_type_name_c *symbol) {return (void *)integer_0;}
+void *type_initial_value_c::visit(real_type_name_c *symbol) {return (void *)real_0;}
+void *type_initial_value_c::visit(lreal_type_name_c *symbol) {return (void *)real_0;}
+void *type_initial_value_c::visit(date_type_name_c *symbol) {return (void *)date_0;}
+void *type_initial_value_c::visit(tod_type_name_c *symbol) {return (void *)tod_0;}
+void *type_initial_value_c::visit(dt_type_name_c *symbol) {return (void *)dt_0;}
+void *type_initial_value_c::visit(byte_type_name_c *symbol) {return (void *)integer_0;}
+void *type_initial_value_c::visit(word_type_name_c *symbol) {return (void *)integer_0;}
+void *type_initial_value_c::visit(dword_type_name_c *symbol) {return (void *)integer_0;}
+void *type_initial_value_c::visit(lword_type_name_c *symbol) {return (void *)integer_0;}
+void *type_initial_value_c::visit(string_type_name_c *symbol) {return (void *)string_0;}
+void *type_initial_value_c::visit(wstring_type_name_c *symbol) {return (void *)wstring_0;}
+
+/********************************/
+/* B 1.3.3 - Derived data types */
+/********************************/
+/* simple_type_name ':' simple_spec_init */
+void *type_initial_value_c::visit(simple_type_declaration_c *symbol) {
+ return symbol->simple_spec_init->accept(*this);
+}
+/* simple_specification ASSIGN constant */
+void *type_initial_value_c::visit(simple_spec_init_c *symbol) {
+ return handle_type_spec(symbol->simple_specification, symbol->constant);
+}
+/* subrange_type_name ':' subrange_spec_init */
+void *type_initial_value_c::visit(subrange_type_declaration_c *symbol) {
+ return symbol->subrange_spec_init->accept(*this);
+}
+/* subrange_specification ASSIGN signed_integer */
+void *type_initial_value_c::visit(subrange_spec_init_c *symbol) {
+ return handle_type_spec(symbol->subrange_specification, symbol->signed_integer);
+}
+/* integer_type_name '(' subrange')' */
+void *type_initial_value_c::visit(subrange_specification_c *symbol) {
+ /* if no initial value explicitly given, then use the lowest value of the subrange */
+ if (symbol->subrange != NULL)
+ return symbol->subrange->accept(*this);
+ else
+ return symbol->integer_type_name->accept(*this);
+}
+/* signed_integer DOTDOT signed_integer */
+void *type_initial_value_c::visit(subrange_c *symbol) {return symbol->lower_limit;}
+/* enumerated_type_name ':' enumerated_spec_init */
+void *type_initial_value_c::visit(enumerated_type_declaration_c *symbol) {
+ return symbol->enumerated_spec_init->accept(*this);
+}
+/* enumerated_specification ASSIGN enumerated_value */
+void *type_initial_value_c::visit(enumerated_spec_init_c *symbol) {
+ return handle_type_spec(symbol->enumerated_specification, symbol->enumerated_value);
+}
+/* helper symbol for enumerated_specification->enumerated_spec_init */
+/* enumerated_value_list ',' enumerated_value */
+void *type_initial_value_c::visit(enumerated_value_list_c *symbol) {
+ /* if no initial value explicitly given, then use the lowest value of the subrange */
+ return (void *)symbol->elements[0];
+}
+/* enumerated_type_name '#' identifier */
+// SYM_REF2(enumerated_value_c, type, value)
+void *type_initial_value_c::visit(enumerated_value_c *symbol) {ERROR; return NULL;}
+/* identifier ':' array_spec_init */
+void *type_initial_value_c::visit(array_type_declaration_c *symbol) {
+ return symbol->array_spec_init->accept(*this);
+}
+/* array_specification [ASSIGN array_initialization} */
+/* array_initialization may be NULL ! */
+void *type_initial_value_c::visit(array_spec_init_c *symbol) {
+ return handle_type_spec(symbol->array_specification, symbol->array_initialization);
+}
+/* ARRAY '[' array_subrange_list ']' OF non_generic_type_name */
+void *type_initial_value_c::visit(array_specification_c *symbol) {
+ //symbol_c *init_value = (symbol_c *)symbol->non_generic_type_name->accept(*this);
+
+ /* Now build a array_initial_elements_list_c list, and populate it
+ * with 1 element of the array_initial_elements_c class
+ */
+ /* The array_initial_elements_c will contain a reference to the init_value,
+ * and another constant representing the number of elements in the array.
+ * In essence, we are building the equivilant of the following ST/IL code:
+ * New_array_t : ARRAY [1..30, 51..60] of INT := [40(XXX)];
+ * from the user given code
+ * New_array_t : ARRAY [1..30, 51..60] of INT;
+ * and replacing XXX with the default initial value of INT.
+ */
+ /* now we need to determine the number of elements in the array... */
+ /* Easier said than done, as the array may have a list of subranges, as in the
+ * example given above!!
+ */
+ /* TODO !!!!!*/
+ /* For now, just assume an array with 1 element.
+ * I (Mario) want to finish off this part of the code before getting boged down
+ * in something else...
+ */
+ // NOTE: We are leaking memory, as the integer will never get free'd!!
+ //integer_c *integer = new integer_c("1");
+ // NOTE: We are leaking memory, as the array_initial_elements will never get free'd!!
+ //array_initial_elements_c *array_initial_elements = new array_initial_elements_c(integer, init_value);
+ // NOTE: We are leaking memory, as the array_initial_elements_list will never get free'd!!
+ array_initial_elements_list_c *array_initial_elements_list = new array_initial_elements_list_c();
+ //array_initial_elements_list->add_element(array_initial_elements);
+ return array_initial_elements_list;
+}
+/* helper symbol for array_specification */
+/* array_subrange_list ',' subrange */
+void *type_initial_value_c::visit(array_subrange_list_c *symbol) {ERROR; return NULL;}
+/* array_initialization: '[' array_initial_elements_list ']' */
+/* helper symbol for array_initialization */
+/* array_initial_elements_list ',' array_initial_elements */
+void *type_initial_value_c::visit(array_initial_elements_list_c *symbol) {ERROR; return NULL;}
+/* integer '(' [array_initial_element] ')' */
+/* array_initial_element may be NULL ! */
+void *type_initial_value_c::visit(array_initial_elements_c *symbol) {ERROR; return NULL;}
+
+
+
+/* TODO: from this point forward... */
+
+/* structure_type_name ':' structure_specification */
+void *type_initial_value_c::visit(structure_type_declaration_c *symbol) {return NULL;}
+/* structure_type_name ASSIGN structure_initialization */
+/* structure_initialization may be NULL ! */
+void *type_initial_value_c::visit(initialized_structure_c *symbol) {
+ return handle_type_spec(symbol->structure_type_name, symbol->structure_initialization);
+}
+/* helper symbol for structure_declaration */
+/* structure_declaration: STRUCT structure_element_declaration_list END_STRUCT */
+/* structure_element_declaration_list structure_element_declaration ';' */
+void *type_initial_value_c::visit(structure_element_declaration_list_c *symbol) {
+ structure_element_initialization_list_c *structure_element_initialization_list = new structure_element_initialization_list_c();
+ return structure_element_initialization_list;
+}
+/* structure_element_name ':' *_spec_init */
+void *type_initial_value_c::visit(structure_element_declaration_c *symbol) {return NULL;}
+/* helper symbol for structure_initialization */
+/* structure_initialization: '(' structure_element_initialization_list ')' */
+/* structure_element_initialization_list ',' structure_element_initialization */
+void *type_initial_value_c::visit(structure_element_initialization_list_c *symbol) {return NULL;}
+/* structure_element_name ASSIGN value */
+void *type_initial_value_c::visit(structure_element_initialization_c *symbol) {return NULL;}
+/* string_type_name ':' elementary_string_type_name string_type_declaration_size string_type_declaration_init */
+/*
+ * NOTE:
+ * (Summary: Contrary to what is expected, the
+ * string_type_declaration_c is not used to store
+ * simple string type declarations that do not include
+ * size limits.
+ * For e.g.:
+ * str1_type: STRING := "hello!"
+ * will be stored in a simple_type_declaration_c
+ * instead of a string_type_declaration_c.
+ * The following:
+ * str2_type: STRING [64] := "hello!"
+ * will be stored in a sring_type_declaration_c
+ *
+ * Read on for why this is done...
+ * End Summary)
+ *
+ * According to the spec, the valid construct
+ * TYPE new_str_type : STRING := "hello!"; END_TYPE
+ * has two possible routes to type_declaration...
+ *
+ * Route 1:
+ * type_declaration: single_element_type_declaration
+ * single_element_type_declaration: simple_type_declaration
+ * simple_type_declaration: identifier ':' simple_spec_init
+ * simple_spec_init: simple_specification ASSIGN constant
+ * (shift: identifier <- 'new_str_type')
+ * simple_specification: elementary_type_name
+ * elementary_type_name: STRING
+ * (shift: elementary_type_name <- STRING)
+ * (reduce: simple_specification <- elementary_type_name)
+ * (shift: constant <- "hello!")
+ * (reduce: simple_spec_init: simple_specification ASSIGN constant)
+ * (reduce: ...)
+ *
+ *
+ * Route 2:
+ * type_declaration: string_type_declaration
+ * string_type_declaration: identifier ':' elementary_string_type_name string_type_declaration_size string_type_declaration_init
+ * (shift: identifier <- 'new_str_type')
+ * elementary_string_type_name: STRING
+ * (shift: elementary_string_type_name <- STRING)
+ * (shift: string_type_declaration_size <- empty )
+ * string_type_declaration_init: ASSIGN character_string
+ * (shift: character_string <- "hello!")
+ * (reduce: string_type_declaration_init <- ASSIGN character_string)
+ * (reduce: string_type_declaration <- identifier ':' elementary_string_type_name string_type_declaration_size string_type_declaration_init )
+ * (reduce: type_declaration <- string_type_declaration)
+ *
+ *
+ * At first glance it seems that removing route 1 would make
+ * the most sense. Unfortunately the construct 'simple_spec_init'
+ * shows up multiple times in other rules, so changing this construct
+ * would also mean changing all the rules in which it appears.
+ * I (Mario) therefore chose to remove route 2 instead. This means
+ * that the above declaration gets stored in a
+ * simple_type_declaration_c, and not in a string_type_declaration_c
+ * as would be expected!
+ */
+/* string_type_name ':' elementary_string_type_name string_type_declaration_size string_type_declaration_init */
+#if 0
+SYM_REF4(string_type_declaration_c, string_type_name,
+ elementary_string_type_name,
+ string_type_declaration_size,
+ string_type_declaration_init) /* may be == NULL! */
+#endif
+void *type_initial_value_c::visit(string_type_declaration_c *symbol) {return NULL;}
+
+
+type_initial_value_c *type_initial_value_c::_instance = NULL;
+real_c *type_initial_value_c::real_0 = NULL;
+integer_c *type_initial_value_c::integer_0 = NULL;
+integer_c *type_initial_value_c::integer_1 = NULL;
+boolean_literal_c *type_initial_value_c::bool_0 = NULL;
+date_literal_c *type_initial_value_c::date_literal_0 = NULL;
+daytime_c *type_initial_value_c::daytime_literal_0 = NULL;
+duration_c *type_initial_value_c::time_0 = NULL;
+date_c *type_initial_value_c::date_0 = NULL;
+time_of_day_c *type_initial_value_c::tod_0 = NULL;
+date_and_time_c *type_initial_value_c::dt_0 = NULL;
+single_byte_character_string_c *type_initial_value_c::string_0 = NULL;
+double_byte_character_string_c *type_initial_value_c::wstring_0 = NULL;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/type_initial_value.hh Mon Jun 01 21:08:44 2009 +0200
@@ -0,0 +1,262 @@
+/*
+ * (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 default initial value of a type declaration.
+ *
+ * This is part of the 4th stage that generates
+ * a c++ source program equivalent to the IL and ST
+ * code.
+ */
+
+/* Given a type definition declration, determine its default
+ * initial value. Note that types based on other types
+ * may have to iterate through each type it is based on
+ * to determine the initial value.
+ * E.g.
+ * TYPE
+ * A_t : INT := 10;
+ * B_t : A_t := 20;
+ * C_t : B_t;
+ * D_t : C_t := 40;
+ * END_TYPE
+ * Where the default initial value for C_t is 20!
+ */
+/* NOTE: The main program only needs one instance of
+ * this class of object. This class
+ * is therefore a singleton.
+ */
+
+class type_initial_value_c : public null_visitor_c {
+
+ private:
+ static type_initial_value_c *_instance;
+ /* constants for the default values of elementary data types... */
+ static real_c *real_0;
+ static integer_c *integer_0, *integer_1;
+ static boolean_literal_c *bool_0;
+ static date_literal_c *date_literal_0;
+ static daytime_c *daytime_literal_0;
+ static duration_c *time_0;
+ static date_c *date_0;
+ static time_of_day_c *tod_0;
+ static date_and_time_c *dt_0;
+ static single_byte_character_string_c *string_0;
+ static double_byte_character_string_c *wstring_0;
+
+ public:
+ static type_initial_value_c *instance(void);
+
+ protected:
+ type_initial_value_c(void);
+
+ public:
+ symbol_c *get(identifier_c *type_name);
+
+
+ private:
+ void *handle_type_spec(symbol_c *base_type_name, symbol_c *type_spec_init);
+
+ private:
+ void *visit(identifier_c *type_name);
+
+ /***********************************/
+ /* 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);
+
+ /********************************/
+ /* 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 */
+ 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 */
+ /*
+ * NOTE:
+ * (Summary: Contrary to what is expected, the
+ * string_type_declaration_c is not used to store
+ * simple string type declarations that do not include
+ * size limits.
+ * For e.g.:
+ * str1_type: STRING := "hello!"
+ * will be stored in a simple_type_declaration_c
+ * instead of a string_type_declaration_c.
+ * The following:
+ * str2_type: STRING [64] := "hello!"
+ * will be stored in a sring_type_declaration_c
+ *
+ * Read on for why this is done...
+ * End Summary)
+ *
+ * According to the spec, the valid construct
+ * TYPE new_str_type : STRING := "hello!"; END_TYPE
+ * has two possible routes to type_declaration...
+ *
+ * Route 1:
+ * type_declaration: single_element_type_declaration
+ * single_element_type_declaration: simple_type_declaration
+ * simple_type_declaration: identifier ':' simple_spec_init
+ * simple_spec_init: simple_specification ASSIGN constant
+ * (shift: identifier <- 'new_str_type')
+ * simple_specification: elementary_type_name
+ * elementary_type_name: STRING
+ * (shift: elementary_type_name <- STRING)
+ * (reduce: simple_specification <- elementary_type_name)
+ * (shift: constant <- "hello!")
+ * (reduce: simple_spec_init: simple_specification ASSIGN constant)
+ * (reduce: ...)
+ *
+ *
+ * Route 2:
+ * type_declaration: string_type_declaration
+ * string_type_declaration: identifier ':' elementary_string_type_name string_type_declaration_size string_type_declaration_init
+ * (shift: identifier <- 'new_str_type')
+ * elementary_string_type_name: STRING
+ * (shift: elementary_string_type_name <- STRING)
+ * (shift: string_type_declaration_size <- empty )
+ * string_type_declaration_init: ASSIGN character_string
+ * (shift: character_string <- "hello!")
+ * (reduce: string_type_declaration_init <- ASSIGN character_string)
+ * (reduce: string_type_declaration <- identifier ':' elementary_string_type_name string_type_declaration_size string_type_declaration_init )
+ * (reduce: type_declaration <- string_type_declaration)
+ *
+ *
+ * At first glance it seems that removing route 1 would make
+ * the most sense. Unfortunately the construct 'simple_spec_init'
+ * shows up multiple times in other rules, so changing this construct
+ * would also mean changing all the rules in which it appears.
+ * I (Mario) therefore chose to remove route 2 instead. This means
+ * that the above declaration gets stored in a
+ * simple_type_declaration_c, and not in a string_type_declaration_c
+ * as would be expected!
+ */
+ /* string_type_name ':' elementary_string_type_name string_type_declaration_size string_type_declaration_init */
+#if 0
+SYM_REF4(string_type_declaration_c, string_type_name,
+ elementary_string_type_name,
+ string_type_declaration_size,
+ string_type_declaration_init) /* may be == NULL! */
+#endif
+ void *visit(string_type_declaration_c *symbol);
+}; // type_initial_value_c
+
+
+
--- a/main.cc Sat May 30 16:42:41 2009 +0200
+++ b/main.cc Mon Jun 01 21:08:44 2009 +0200
@@ -78,7 +78,7 @@
#include "stage1_2/stage1_2.hh"
-#include "search_utils/search_utils.hh"
+#include "absyntax_utils/absyntax_utils.hh"
//int stage3(symbol_c *tree_root);
int stage4(symbol_c *tree_root, const char *builddir);
@@ -110,6 +110,9 @@
extern int optind, optopt;
*/
+ /******************************************/
+ /* Parse command line options... */
+ /******************************************/
while ((optres = getopt(argc, argv, ":hfsI:T:")) != -1) {
switch(optres) {
case 'h':
@@ -133,8 +136,11 @@
errflg++;
break;
case '?':
+ fprintf(stderr, "Unrecognized option: -%c\n", optopt);
+ errflg++;
+ break;
default:
- fprintf(stderr, "Unrecognized option: -%c\n", optopt);
+ fprintf(stderr, "Unknown error while parsing command line options.");
errflg++;
break;
}
@@ -156,14 +162,15 @@
}
+ /***************************/
+ /* Run the compiler... */
+ /***************************/
/* 1st Pass */
if (stage1_2(argv[optind], &tree_root, stage1_2_options) < 0)
return EXIT_FAILURE;
/* 2nd Pass */
-printf("loading symbol tables...\n");
- search_utils_init(tree_root);
-printf("loading symbol tables... DONE!\n");
+ absyntax_utils_init(tree_root);
/* not yet implemented... */
/*
if (stage3(tree_root) < 0)
--- a/stage4/generate_c/decompose_var_instance_name.cc Sat May 30 16:42:41 2009 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
- * (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()
- */
-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) {
- variable_name = variable_instance_name;
- next_variable_name = NULL;
- current_recursive_variable_name = NULL;
- previously_returned_variable_name = NULL;
- }
-
- public:
- symbol_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;
- }
-
- public:
-/*********************/
-/* B 1.4 - Variables */
-/*********************/
- void *visit(symbolic_variable_c *symbol) {return (void *)(symbol->var_name);}
-
-/********************************************/
-/* B.1.4.1 Directly Represented Variables */
-/********************************************/
- void *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 *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 *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);
- }
-};
-
-
-
-
--- a/stage4/generate_c/function_call_iterator.cc Sat May 30 16:42:41 2009 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,150 +0,0 @@
-/*
- * (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 <stdio.h> /* required for NULL */
-//#include <string>
-//#include <iostream>
-
-//#include "../../util/symtable.hh"
-
-//#include "generate_c.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;
- //identifier_c *current_fcall_name;
- symbol_c *current_fcall_name;
- //function_invocation_c *current_finvocation;
- 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) {
- 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 *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 *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 *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 *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 *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;
- }
-
-
-};
-
-
-
-
--- a/stage4/generate_c/function_call_param_iterator.cc Sat May 30 16:42:41 2009 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,560 +0,0 @@
-/*
- * (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.
- *
- * This is part of the 4th stage that generates
- * a c++ source program equivalent to the IL and ST
- * code.
- */
-
-
-
-
-
-
-//#include <stdio.h> /* required for NULL */
-//#include <string>
-//#include <iostream>
-
-//#include "../../util/symtable.hh"
-
-//#include "generate_c.hh"
-
-
-#include "../../absyntax/visitor.hh"
-
-
-/*
- * 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.
- */
-
-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) {
- 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 *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;
- }
-
-
-
- public:
- /* start off at the first parameter once again... */
- void 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(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 *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 *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;
- }
-
-
-
-
- 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) {
- TRACE("program_configuration_c");
- return symbol->prog_conf_elements->accept(*this);
- }
-
-/* prog_conf_elements ',' prog_conf_element */
-// SYM_LIST(prog_conf_elements_c)
- void *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 *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 *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 *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 *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 *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 *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 *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 *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 *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 *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 *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 *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 *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 *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 *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... ???
-
-
-
-
-
-};
-
-
-
-
-
-
--- a/stage4/generate_c/function_type_decl.h Sat May 30 16:42:41 2009 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,454 +0,0 @@
-/*
- * (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;
--- a/stage4/generate_c/generate_c.cc Sat May 30 16:42:41 2009 +0200
+++ b/stage4/generate_c/generate_c.cc Mon Jun 01 21:08:44 2009 +0200
@@ -46,6 +46,7 @@
#include "../../util/symtable.hh"
#include "../../util/dsymtable.hh"
#include "../../absyntax/visitor.hh"
+#include "../../absyntax_utils/absyntax_utils.hh"
#include "../stage4.hh"
@@ -55,7 +56,6 @@
-
//#define DEBUG
#ifdef DEBUG
#define TRACE(classname) printf("\n____%s____\n",classname);
@@ -72,57 +72,6 @@
-
-#if 0
-/* 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;
-#else
-
-#include "../../search_utils/search_utils.hh"
-
-#endif
-
-/***********************************************************************/
-/***********************************************************************/
-/***********************************************************************/
-/***********************************************************************/
-
-
-/* returns 0 if the names are equal!! */
-/* NOTE: it must ignore case!! */
-static 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;
-}
-
-
/***********************************************************************/
/***********************************************************************/
/***********************************************************************/
@@ -178,21 +127,6 @@
/***********************************************************************/
/***********************************************************************/
-
-#include "spec_init_separator.cc"
-#include "function_param_iterator.cc"
-#include "function_call_iterator.cc"
-#include "function_call_param_iterator.cc"
-#include "type_initial_value.cc"
-#include "search_fb_instance_decl.cc"
-#include "search_fb_typedecl.cc"
-#include "search_base_type.cc"
-#include "search_var_instance_decl.cc"
-#include "decompose_var_instance_name.cc"
-#include "search_varfb_instance_type.cc"
-#include "search_constant_type.cc"
-#include "search_expression_type.cc"
-
#include "generate_c_base.cc"
#include "generate_c_typedecl.cc"
#include "generate_c_sfcdecl.cc"
--- a/stage4/generate_c/get_function_type_decl.c Sat May 30 16:42:41 2009 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1298 +0,0 @@
-/*
- * (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;
-}
-
--- a/stage4/generate_c/search_base_type.cc Sat May 30 16:42:41 2009 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,242 +0,0 @@
-/*
- * (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) {current_type_name = NULL;}
-
- public:
- void *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 type_is_subrange(symbol_c* type_decl) {
- this->is_subrange = false;
- type_decl->accept(*this);
- return this->is_subrange;
- }
-
- bool 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 *visit(time_type_name_c *symbol) {return (void *)symbol;}
- void *visit(bool_type_name_c *symbol) {return (void *)symbol;}
- void *visit(sint_type_name_c *symbol) {return (void *)symbol;}
- void *visit(int_type_name_c *symbol) {return (void *)symbol;}
- void *visit(dint_type_name_c *symbol) {return (void *)symbol;}
- void *visit(lint_type_name_c *symbol) {return (void *)symbol;}
- void *visit(usint_type_name_c *symbol) {return (void *)symbol;}
- void *visit(uint_type_name_c *symbol) {return (void *)symbol;}
- void *visit(udint_type_name_c *symbol) {return (void *)symbol;}
- void *visit(ulint_type_name_c *symbol) {return (void *)symbol;}
- void *visit(real_type_name_c *symbol) {return (void *)symbol;}
- void *visit(lreal_type_name_c *symbol) {return (void *)symbol;}
- void *visit(date_type_name_c *symbol) {return (void *)symbol;}
- void *visit(tod_type_name_c *symbol) {return (void *)symbol;}
- void *visit(dt_type_name_c *symbol) {return (void *)symbol;}
- void *visit(byte_type_name_c *symbol) {return (void *)symbol;}
- void *visit(word_type_name_c *symbol) {return (void *)symbol;}
- void *visit(dword_type_name_c *symbol) {return (void *)symbol;}
- void *visit(lword_type_name_c *symbol) {return (void *)symbol;}
- void *visit(string_type_name_c *symbol) {return (void *)symbol;}
- void *visit(wstring_type_name_c *symbol) {return (void *)symbol;}
- void *visit(constant_int_type_name_c *symbol) {return (void *)symbol;}
- void *visit(constant_real_type_name_c *symbol) {return (void *)symbol;}
- void *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 *visit(safebool_type_name_c *symbol) {return (void *)symbol;}
-
-/********************************/
-/* B 1.3.3 - Derived data types */
-/********************************/
-/* simple_type_name ':' simple_spec_init */
- void *visit(simple_type_declaration_c *symbol) {
- return symbol->simple_spec_init->accept(*this);
- }
-/* simple_specification ASSIGN constant */
- void *visit(simple_spec_init_c *symbol) {
- return symbol->simple_specification->accept(*this);
- }
-
-/* subrange_type_name ':' subrange_spec_init */
- void *visit(subrange_type_declaration_c *symbol) {
- return symbol->subrange_spec_init->accept(*this);
- }
-
-/* subrange_specification ASSIGN signed_integer */
- void *visit(subrange_spec_init_c *symbol) {
- this->is_subrange = true;
- return symbol->subrange_specification->accept(*this);
- }
-
-/* integer_type_name '(' subrange')' */
- void *visit(subrange_specification_c *symbol) {
- return symbol->integer_type_name->accept(*this);
- }
-
-/* signed_integer DOTDOT signed_integer */
- void *visit(subrange_c *symbol) {ERROR; return NULL;} /* should never get called... */
-
-/* enumerated_type_name ':' enumerated_spec_init */
- void *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 *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 *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 *visit(enumerated_value_c *symbol) {ERROR; return NULL;} /* should never get called... */
-
-/* identifier ':' array_spec_init */
- void *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 *visit(array_spec_init_c *symbol) {
- return symbol->array_specification->accept(*this);
- }
-
-/* ARRAY '[' array_subrange_list ']' OF non_generic_type_name */
- void *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 *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 *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 *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 *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 *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 *visit(structure_element_declaration_list_c *symbol) {
- if (NULL == this->current_type_name) ERROR;
- return (void *)symbol;
- }
-
-/* structure_element_name ':' *_spec_init */
- void *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 *visit(structure_element_initialization_list_c *symbol) {ERROR; return NULL;} /* should never get called... */
-
-/* structure_element_name ASSIGN value */
- void *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 *visit(string_type_declaration_c *symbol) {return symbol;}
-
-
-};
-
-
-
-
--- a/stage4/generate_c/search_constant_type.cc Sat May 30 16:42:41 2009 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,173 +0,0 @@
-/*
- * (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...
- */
-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) {
- return (symbol_c *)constant->accept(*this);
- }
-
- public:
-
-/*********************/
-/* B 1.2 - Constants */
-/*********************/
-
-/******************************/
-/* B 1.2.1 - Numeric Literals */
-/******************************/
- void *visit(real_c *symbol) {return (void *)&constant_real_type_name;}
- void *visit(integer_c *symbol) {return (void *)&constant_int_type_name;}
- void *visit(binary_integer_c *symbol) {return (void *)&constant_int_type_name;}
- void *visit(octal_integer_c *symbol) {return (void *)&constant_int_type_name;}
- void *visit(hex_integer_c *symbol) {return (void *)&constant_int_type_name;}
-
- void *visit(numeric_literal_c *symbol)
- {return (void *)((symbol->type!=NULL)?symbol->type:symbol->value->accept(*this));}
- void *visit(integer_literal_c *symbol)
- {return (void *)((symbol->type!=NULL)?symbol->type:symbol->value->accept(*this));}
- void *visit(real_literal_c *symbol)
- {return (void *)((symbol->type!=NULL)?symbol->type:symbol->value->accept(*this));}
- void *visit(bit_string_literal_c *symbol)
- {return (void *)((symbol->type!=NULL)?symbol->type:symbol->value->accept(*this));}
- void *visit(boolean_literal_c *symbol)
- {return (void *)((symbol->type!=NULL)?symbol->type:symbol->value->accept(*this));}
-
-/*******************************/
-/* B.1.2.2 Character Strings */
-/*******************************/
- void *visit(double_byte_character_string_c *symbol) {return (void *)&wstring_type_name;}
- void *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 *visit(neg_time_c *symbol) {ERROR; return NULL;} /* this member function should never be called. */
- void *visit(duration_c *symbol) {return (void *)&time_type_name;}
- void *visit(fixed_point_c *symbol) {ERROR; return NULL;} /* this member function should never be called. */
- void *visit(days_c *symbol) {ERROR; return NULL;} /* this member function should never be called. */
- void *visit(hours_c *symbol) {ERROR; return NULL;} /* this member function should never be called. */
- void *visit(minutes_c *symbol) {ERROR; return NULL;} /* this member function should never be called. */
- void *visit(seconds_c *symbol) {ERROR; return NULL;} /* this member function should never be called. */
- void *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 *visit(time_of_day_c *symbol) {return (void *)&tod_type_name;}
- void *visit(daytime_c *symbol) {ERROR; return NULL;} /* this member function should never be called. */
- void *visit(date_c *symbol) {return (void *)&date_type_name;}
- void *visit(date_literal_c *symbol) {ERROR; return NULL;} /* this member function should never be called. */
- void *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;
-
-
-
-
-
-
--- a/stage4/generate_c/search_expression_type.cc Sat May 30 16:42:41 2009 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,386 +0,0 @@
-/*
- * (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 "function_type_decl.h"
-#include "get_function_type_decl.c"
-
-#if 0
-typedef enum {function_add,
- function_sub,
- function_and,
- function_or,
- function_sqrt,
- function_none} function_type_t;
-
-
-function_type_t get_function_type(identifier_c *function_name) {
- if (!strcasecmp(function_name->value, "ADD"))
- return function_add;
- else if (!strcasecmp(function_name->value, "SUB"))
- return function_sub;
- else if (!strcasecmp(function_name->value, "AND"))
- return function_and;
- else if (!strcasecmp(function_name->value, "OR"))
- return function_or;
- else if (!strcasecmp(function_name->value, "SQRT"))
- return function_sqrt;
- else return function_none;
-}
-#endif
-
-
-symbol_c *generate_param_name(const char *name) {
- symbol_c *param_name = new identifier_c(name);
- return param_name;
-}
-
-
-symbol_c *generate_param_name(const char *format, int number) {
- char name[10];
- sprintf(name, format, number);
- symbol_c *param_name = new identifier_c(name);
- return param_name;
-}
-
-
-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) {
- search_varfb_instance_type = new search_varfb_instance_type_c(search_scope);
- }
-
- virtual ~search_expression_type_c(void) {
- delete search_varfb_instance_type;
- }
-
- /* A helper function... */
- bool is_bool_type(symbol_c *type_symbol) {
- if (type_symbol == NULL) {return true;}
- return (typeid(*type_symbol) == typeid(bool_type_name_c));
- }
-
- /* A helper function... */
- bool 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 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 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 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 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 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 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 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* 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;
- }
-
-#include "search_type_code.c"
-
- /*static bool_type_name_c bool_type_name;*/
-
- /* A helper function... */
- void *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 *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 *base_type(symbol_c *symbol) {
- return (symbol_c *)symbol->accept(search_base_type);
- }
-
-/*********************/
-/* B 1.4 - Variables */
-/*********************/
-
- void *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 *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 *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 *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 *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 *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 *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 *visit(equ_expression_c *symbol) {return (void *)&bool_type_name;}
- void *visit(notequ_expression_c *symbol) {return (void *)&bool_type_name;}
- void *visit(lt_expression_c *symbol) {return (void *)&bool_type_name;}
- void *visit(gt_expression_c *symbol) {return (void *)&bool_type_name;}
- void *visit(le_expression_c *symbol) {return (void *)&bool_type_name;}
- void *visit(ge_expression_c *symbol) {return (void *)&bool_type_name;}
-
- void *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 *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 *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 *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 *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 *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 *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 *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 *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;*/
-
--- a/stage4/generate_c/search_fb_instance_decl.cc Sat May 30 16:42:41 2009 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +0,0 @@
-/*
- * (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) {
- this->search_scope = search_scope;
- this->current_fb_type_name = NULL;
- }
-
- symbol_c *get_type_name(symbol_c *fb_instance_name) {
- this->search_name = fb_instance_name;
- return (symbol_c *)search_scope->accept(*this);
- }
-
- public:
-/***************************/
-/* B 0 - Programming Model */
-/***************************/
- void *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 *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 *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 *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 *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 *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);
- }
-};
-
-
-
-
--- a/stage4/generate_c/search_fb_typedecl.cc Sat May 30 16:42:41 2009 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * (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) {
- this->search_scope = search_scope;
- }
-
- symbol_c *get_decl(symbol_c *fb_type_name) {
- this->search_name = fb_type_name;
- return (symbol_c *)search_scope->accept(*this);
- }
-
- public:
-/**************************************/
-/* B.1.5 - Program organization units */
-/**************************************/
-
-/*****************************/
-/* B 1.5.2 - Function Blocks */
-/*****************************/
- void *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 *visit(program_declaration_c *symbol) {
- if (compare_identifiers(symbol->program_type_name, search_name) == 0)
- return symbol;
- return NULL;
- }
-};
-
-
-
-
--- a/stage4/generate_c/search_type_code.c Sat May 30 16:42:41 2009 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,28662 +0,0 @@
-/*
- * (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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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(¶m_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 */
- symbol_c *IN_param_value = function_call_param_iterator.search(¶m_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::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dword_to_tod*/
- break;
-
-/****
- *DWORD_TO_UDINT
- */
- case function_dword_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(¶m_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::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dword_to_udint*/
- break;
-
-/****
- *DWORD_TO_WORD
- */
- case function_dword_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(¶m_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::word_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dword_to_word*/
- break;
-
-/****
- *DWORD_TO_STRING
- */
- case function_dword_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(¶m_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::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dword_to_string*/
- break;
-
-/****
- *DWORD_TO_LWORD
- */
- case function_dword_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(¶m_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::lword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dword_to_lword*/
- break;
-
-/****
- *DWORD_TO_UINT
- */
- case function_dword_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(¶m_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::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dword_to_uint*/
- break;
-
-/****
- *DWORD_TO_LREAL
- */
- case function_dword_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(¶m_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::lreal_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dword_to_lreal*/
- break;
-
-/****
- *DWORD_TO_BYTE
- */
- case function_dword_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(¶m_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::byte_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dword_to_byte*/
- break;
-
-/****
- *DWORD_TO_USINT
- */
- case function_dword_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(¶m_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::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dword_to_usint*/
- break;
-
-/****
- *DWORD_TO_ULINT
- */
- case function_dword_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(¶m_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::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dword_to_ulint*/
- break;
-
-/****
- *DWORD_TO_BOOL
- */
- case function_dword_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(¶m_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::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dword_to_bool*/
- break;
-
-/****
- *DWORD_TO_TIME
- */
- case function_dword_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(¶m_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::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dword_to_time*/
- break;
-
-/****
- *DWORD_TO_INT
- */
- case function_dword_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(¶m_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::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dword_to_int*/
- break;
-
-/****
- *DT_TO_REAL
- */
- case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_real*/
- break;
-
-/****
- *DT_TO_SINT
- */
- case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_sint*/
- break;
-
-/****
- *DT_TO_LINT
- */
- case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_lint*/
- break;
-
-/****
- *DT_TO_DINT
- */
- case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_dint*/
- break;
-
-/****
- *DT_TO_DWORD
- */
- case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_dword*/
- break;
-
-/****
- *DT_TO_UDINT
- */
- case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_udint*/
- break;
-
-/****
- *DT_TO_WORD
- */
- case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_word*/
- break;
-
-/****
- *DT_TO_STRING
- */
- case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_string*/
- break;
-
-/****
- *DT_TO_LWORD
- */
- case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_lword*/
- break;
-
-/****
- *DT_TO_UINT
- */
- case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_uint*/
- break;
-
-/****
- *DT_TO_LREAL
- */
- case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_lreal*/
- break;
-
-/****
- *DT_TO_BYTE
- */
- case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_byte*/
- break;
-
-/****
- *DT_TO_USINT
- */
- case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_usint*/
- break;
-
-/****
- *DT_TO_ULINT
- */
- case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_ulint*/
- break;
-
-/****
- *DT_TO_INT
- */
- case function_dt_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(¶m_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::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_int*/
- break;
-
-/****
- *TOD_TO_REAL
- */
- case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_real*/
- break;
-
-/****
- *TOD_TO_SINT
- */
- case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_sint*/
- break;
-
-/****
- *TOD_TO_LINT
- */
- case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_lint*/
- break;
-
-/****
- *TOD_TO_DINT
- */
- case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_dint*/
- break;
-
-/****
- *TOD_TO_DWORD
- */
- case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_dword*/
- break;
-
-/****
- *TOD_TO_UDINT
- */
- case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_udint*/
- break;
-
-/****
- *TOD_TO_WORD
- */
- case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_word*/
- break;
-
-/****
- *TOD_TO_STRING
- */
- case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_string*/
- break;
-
-/****
- *TOD_TO_LWORD
- */
- case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_lword*/
- break;
-
-/****
- *TOD_TO_UINT
- */
- case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_uint*/
- break;
-
-/****
- *TOD_TO_LREAL
- */
- case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_lreal*/
- break;
-
-/****
- *TOD_TO_BYTE
- */
- case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_byte*/
- break;
-
-/****
- *TOD_TO_USINT
- */
- case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_usint*/
- break;
-
-/****
- *TOD_TO_ULINT
- */
- case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_ulint*/
- break;
-
-/****
- *TOD_TO_INT
- */
- case function_tod_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(¶m_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::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_int*/
- break;
-
-/****
- *UDINT_TO_REAL
- */
- case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_real*/
- break;
-
-/****
- *UDINT_TO_SINT
- */
- case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_sint*/
- break;
-
-/****
- *UDINT_TO_LINT
- */
- case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_lint*/
- break;
-
-/****
- *UDINT_TO_DINT
- */
- case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_dint*/
- break;
-
-/****
- *UDINT_TO_DATE
- */
- case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_date*/
- break;
-
-/****
- *UDINT_TO_DWORD
- */
- case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_dword*/
- break;
-
-/****
- *UDINT_TO_DT
- */
- case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_dt*/
- break;
-
-/****
- *UDINT_TO_TOD
- */
- case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_tod*/
- break;
-
-/****
- *UDINT_TO_WORD
- */
- case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_word*/
- break;
-
-/****
- *UDINT_TO_STRING
- */
- case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_string*/
- break;
-
-/****
- *UDINT_TO_LWORD
- */
- case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_lword*/
- break;
-
-/****
- *UDINT_TO_UINT
- */
- case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_uint*/
- break;
-
-/****
- *UDINT_TO_LREAL
- */
- case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_lreal*/
- break;
-
-/****
- *UDINT_TO_BYTE
- */
- case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_byte*/
- break;
-
-/****
- *UDINT_TO_USINT
- */
- case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_usint*/
- break;
-
-/****
- *UDINT_TO_ULINT
- */
- case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_ulint*/
- break;
-
-/****
- *UDINT_TO_BOOL
- */
- case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_bool*/
- break;
-
-/****
- *UDINT_TO_TIME
- */
- case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_time*/
- break;
-
-/****
- *UDINT_TO_INT
- */
- case function_udint_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(¶m_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::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_int*/
- break;
-
-/****
- *WORD_TO_REAL
- */
- case function_word_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(¶m_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::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_real*/
- break;
-
-/****
- *WORD_TO_SINT
- */
- case function_word_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(¶m_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::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_sint*/
- break;
-
-/****
- *WORD_TO_LINT
- */
- case function_word_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(¶m_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::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_lint*/
- break;
-
-/****
- *WORD_TO_DINT
- */
- case function_word_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(¶m_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::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_dint*/
- break;
-
-/****
- *WORD_TO_DATE
- */
- case function_word_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(¶m_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::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_date*/
- break;
-
-/****
- *WORD_TO_DWORD
- */
- case function_word_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(¶m_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::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_dword*/
- break;
-
-/****
- *WORD_TO_DT
- */
- case function_word_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(¶m_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::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_dt*/
- break;
-
-/****
- *WORD_TO_TOD
- */
- case function_word_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(¶m_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::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_tod*/
- break;
-
-/****
- *WORD_TO_UDINT
- */
- case function_word_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(¶m_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::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_udint*/
- break;
-
-/****
- *WORD_TO_STRING
- */
- case function_word_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(¶m_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::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_string*/
- break;
-
-/****
- *WORD_TO_LWORD
- */
- case function_word_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(¶m_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::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_lword*/
- break;
-
-/****
- *WORD_TO_UINT
- */
- case function_word_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(¶m_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::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_uint*/
- break;
-
-/****
- *WORD_TO_LREAL
- */
- case function_word_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(¶m_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::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_lreal*/
- break;
-
-/****
- *WORD_TO_BYTE
- */
- case function_word_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(¶m_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::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_byte*/
- break;
-
-/****
- *WORD_TO_USINT
- */
- case function_word_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(¶m_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::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_usint*/
- break;
-
-/****
- *WORD_TO_ULINT
- */
- case function_word_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(¶m_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::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_ulint*/
- break;
-
-/****
- *WORD_TO_BOOL
- */
- case function_word_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(¶m_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::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_bool*/
- break;
-
-/****
- *WORD_TO_TIME
- */
- case function_word_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(¶m_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::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_time*/
- break;
-
-/****
- *WORD_TO_INT
- */
- case function_word_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(¶m_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::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_int*/
- break;
-
-/****
- *STRING_TO_REAL
- */
- case function_string_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(¶m_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::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_real*/
- break;
-
-/****
- *STRING_TO_SINT
- */
- case function_string_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(¶m_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::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_sint*/
- break;
-
-/****
- *STRING_TO_LINT
- */
- case function_string_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(¶m_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::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_lint*/
- break;
-
-/****
- *STRING_TO_DINT
- */
- case function_string_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(¶m_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::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_dint*/
- break;
-
-/****
- *STRING_TO_DATE
- */
- case function_string_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(¶m_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::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_date*/
- break;
-
-/****
- *STRING_TO_DWORD
- */
- case function_string_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(¶m_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::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_dword*/
- break;
-
-/****
- *STRING_TO_DT
- */
- case function_string_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(¶m_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::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_dt*/
- break;
-
-/****
- *STRING_TO_TOD
- */
- case function_string_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(¶m_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::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_tod*/
- break;
-
-/****
- *STRING_TO_UDINT
- */
- case function_string_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(¶m_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::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_udint*/
- break;
-
-/****
- *STRING_TO_WORD
- */
- case function_string_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(¶m_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::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_word*/
- break;
-
-/****
- *STRING_TO_LWORD
- */
- case function_string_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(¶m_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::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_lword*/
- break;
-
-/****
- *STRING_TO_UINT
- */
- case function_string_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(¶m_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::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_uint*/
- break;
-
-/****
- *STRING_TO_LREAL
- */
- case function_string_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(¶m_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::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_lreal*/
- break;
-
-/****
- *STRING_TO_BYTE
- */
- case function_string_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(¶m_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::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_byte*/
- break;
-
-/****
- *STRING_TO_USINT
- */
- case function_string_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(¶m_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::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_usint*/
- break;
-
-/****
- *STRING_TO_ULINT
- */
- case function_string_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(¶m_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::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_ulint*/
- break;
-
-/****
- *STRING_TO_BOOL
- */
- case function_string_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(¶m_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::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_bool*/
- break;
-
-/****
- *STRING_TO_TIME
- */
- case function_string_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(¶m_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::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_time*/
- break;
-
-/****
- *STRING_TO_INT
- */
- case function_string_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(¶m_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::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_int*/
- break;
-
-/****
- *LWORD_TO_REAL
- */
- case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_real*/
- break;
-
-/****
- *LWORD_TO_SINT
- */
- case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_sint*/
- break;
-
-/****
- *LWORD_TO_LINT
- */
- case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_lint*/
- break;
-
-/****
- *LWORD_TO_DINT
- */
- case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_dint*/
- break;
-
-/****
- *LWORD_TO_DATE
- */
- case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_date*/
- break;
-
-/****
- *LWORD_TO_DWORD
- */
- case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_dword*/
- break;
-
-/****
- *LWORD_TO_DT
- */
- case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_dt*/
- break;
-
-/****
- *LWORD_TO_TOD
- */
- case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_tod*/
- break;
-
-/****
- *LWORD_TO_UDINT
- */
- case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_udint*/
- break;
-
-/****
- *LWORD_TO_WORD
- */
- case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_word*/
- break;
-
-/****
- *LWORD_TO_STRING
- */
- case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_string*/
- break;
-
-/****
- *LWORD_TO_UINT
- */
- case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_uint*/
- break;
-
-/****
- *LWORD_TO_LREAL
- */
- case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_lreal*/
- break;
-
-/****
- *LWORD_TO_BYTE
- */
- case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_byte*/
- break;
-
-/****
- *LWORD_TO_USINT
- */
- case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_usint*/
- break;
-
-/****
- *LWORD_TO_ULINT
- */
- case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_ulint*/
- break;
-
-/****
- *LWORD_TO_BOOL
- */
- case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_bool*/
- break;
-
-/****
- *LWORD_TO_TIME
- */
- case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_time*/
- break;
-
-/****
- *LWORD_TO_INT
- */
- case function_lword_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(¶m_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::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_int*/
- break;
-
-/****
- *UINT_TO_REAL
- */
- case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_real*/
- break;
-
-/****
- *UINT_TO_SINT
- */
- case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_sint*/
- break;
-
-/****
- *UINT_TO_LINT
- */
- case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_lint*/
- break;
-
-/****
- *UINT_TO_DINT
- */
- case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_dint*/
- break;
-
-/****
- *UINT_TO_DATE
- */
- case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_date*/
- break;
-
-/****
- *UINT_TO_DWORD
- */
- case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_dword*/
- break;
-
-/****
- *UINT_TO_DT
- */
- case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_dt*/
- break;
-
-/****
- *UINT_TO_TOD
- */
- case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_tod*/
- break;
-
-/****
- *UINT_TO_UDINT
- */
- case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_udint*/
- break;
-
-/****
- *UINT_TO_WORD
- */
- case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_word*/
- break;
-
-/****
- *UINT_TO_STRING
- */
- case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_string*/
- break;
-
-/****
- *UINT_TO_LWORD
- */
- case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_lword*/
- break;
-
-/****
- *UINT_TO_LREAL
- */
- case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_lreal*/
- break;
-
-/****
- *UINT_TO_BYTE
- */
- case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_byte*/
- break;
-
-/****
- *UINT_TO_USINT
- */
- case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_usint*/
- break;
-
-/****
- *UINT_TO_ULINT
- */
- case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_ulint*/
- break;
-
-/****
- *UINT_TO_BOOL
- */
- case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_bool*/
- break;
-
-/****
- *UINT_TO_TIME
- */
- case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_time*/
- break;
-
-/****
- *UINT_TO_INT
- */
- case function_uint_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(¶m_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::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_int*/
- break;
-
-/****
- *LREAL_TO_REAL
- */
- case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_real*/
- break;
-
-/****
- *LREAL_TO_SINT
- */
- case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_sint*/
- break;
-
-/****
- *LREAL_TO_LINT
- */
- case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_lint*/
- break;
-
-/****
- *LREAL_TO_DINT
- */
- case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_dint*/
- break;
-
-/****
- *LREAL_TO_DATE
- */
- case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_date*/
- break;
-
-/****
- *LREAL_TO_DWORD
- */
- case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_dword*/
- break;
-
-/****
- *LREAL_TO_DT
- */
- case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_dt*/
- break;
-
-/****
- *LREAL_TO_TOD
- */
- case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_tod*/
- break;
-
-/****
- *LREAL_TO_UDINT
- */
- case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_udint*/
- break;
-
-/****
- *LREAL_TO_WORD
- */
- case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_word*/
- break;
-
-/****
- *LREAL_TO_STRING
- */
- case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_string*/
- break;
-
-/****
- *LREAL_TO_LWORD
- */
- case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_lword*/
- break;
-
-/****
- *LREAL_TO_UINT
- */
- case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_uint*/
- break;
-
-/****
- *LREAL_TO_BYTE
- */
- case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_byte*/
- break;
-
-/****
- *LREAL_TO_USINT
- */
- case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_usint*/
- break;
-
-/****
- *LREAL_TO_ULINT
- */
- case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_ulint*/
- break;
-
-/****
- *LREAL_TO_BOOL
- */
- case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_bool*/
- break;
-
-/****
- *LREAL_TO_TIME
- */
- case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_time*/
- break;
-
-/****
- *LREAL_TO_INT
- */
- case function_lreal_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(¶m_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::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_int*/
- break;
-
-/****
- *BYTE_TO_REAL
- */
- case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_real*/
- break;
-
-/****
- *BYTE_TO_SINT
- */
- case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_sint*/
- break;
-
-/****
- *BYTE_TO_LINT
- */
- case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_lint*/
- break;
-
-/****
- *BYTE_TO_DINT
- */
- case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_dint*/
- break;
-
-/****
- *BYTE_TO_DATE
- */
- case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_date*/
- break;
-
-/****
- *BYTE_TO_DWORD
- */
- case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_dword*/
- break;
-
-/****
- *BYTE_TO_DT
- */
- case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_dt*/
- break;
-
-/****
- *BYTE_TO_TOD
- */
- case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_tod*/
- break;
-
-/****
- *BYTE_TO_UDINT
- */
- case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_udint*/
- break;
-
-/****
- *BYTE_TO_WORD
- */
- case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_word*/
- break;
-
-/****
- *BYTE_TO_STRING
- */
- case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_string*/
- break;
-
-/****
- *BYTE_TO_LWORD
- */
- case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_lword*/
- break;
-
-/****
- *BYTE_TO_UINT
- */
- case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_uint*/
- break;
-
-/****
- *BYTE_TO_LREAL
- */
- case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_lreal*/
- break;
-
-/****
- *BYTE_TO_USINT
- */
- case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_usint*/
- break;
-
-/****
- *BYTE_TO_ULINT
- */
- case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_ulint*/
- break;
-
-/****
- *BYTE_TO_BOOL
- */
- case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_bool*/
- break;
-
-/****
- *BYTE_TO_TIME
- */
- case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_time*/
- break;
-
-/****
- *BYTE_TO_INT
- */
- case function_byte_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(¶m_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::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_int*/
- break;
-
-/****
- *USINT_TO_REAL
- */
- case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_real*/
- break;
-
-/****
- *USINT_TO_SINT
- */
- case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_sint*/
- break;
-
-/****
- *USINT_TO_LINT
- */
- case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_lint*/
- break;
-
-/****
- *USINT_TO_DINT
- */
- case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_dint*/
- break;
-
-/****
- *USINT_TO_DATE
- */
- case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_date*/
- break;
-
-/****
- *USINT_TO_DWORD
- */
- case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_dword*/
- break;
-
-/****
- *USINT_TO_DT
- */
- case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_dt*/
- break;
-
-/****
- *USINT_TO_TOD
- */
- case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_tod*/
- break;
-
-/****
- *USINT_TO_UDINT
- */
- case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_udint*/
- break;
-
-/****
- *USINT_TO_WORD
- */
- case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_word*/
- break;
-
-/****
- *USINT_TO_STRING
- */
- case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_string*/
- break;
-
-/****
- *USINT_TO_LWORD
- */
- case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_lword*/
- break;
-
-/****
- *USINT_TO_UINT
- */
- case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_uint*/
- break;
-
-/****
- *USINT_TO_LREAL
- */
- case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_lreal*/
- break;
-
-/****
- *USINT_TO_BYTE
- */
- case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_byte*/
- break;
-
-/****
- *USINT_TO_ULINT
- */
- case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_ulint*/
- break;
-
-/****
- *USINT_TO_BOOL
- */
- case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_bool*/
- break;
-
-/****
- *USINT_TO_TIME
- */
- case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_time*/
- break;
-
-/****
- *USINT_TO_INT
- */
- case function_usint_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(¶m_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::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_int*/
- break;
-
-/****
- *ULINT_TO_REAL
- */
- case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_real*/
- break;
-
-/****
- *ULINT_TO_SINT
- */
- case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_sint*/
- break;
-
-/****
- *ULINT_TO_LINT
- */
- case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_lint*/
- break;
-
-/****
- *ULINT_TO_DINT
- */
- case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_dint*/
- break;
-
-/****
- *ULINT_TO_DATE
- */
- case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_date*/
- break;
-
-/****
- *ULINT_TO_DWORD
- */
- case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_dword*/
- break;
-
-/****
- *ULINT_TO_DT
- */
- case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_dt*/
- break;
-
-/****
- *ULINT_TO_TOD
- */
- case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_tod*/
- break;
-
-/****
- *ULINT_TO_UDINT
- */
- case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_udint*/
- break;
-
-/****
- *ULINT_TO_WORD
- */
- case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_word*/
- break;
-
-/****
- *ULINT_TO_STRING
- */
- case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_string*/
- break;
-
-/****
- *ULINT_TO_LWORD
- */
- case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_lword*/
- break;
-
-/****
- *ULINT_TO_UINT
- */
- case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_uint*/
- break;
-
-/****
- *ULINT_TO_LREAL
- */
- case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_lreal*/
- break;
-
-/****
- *ULINT_TO_BYTE
- */
- case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_byte*/
- break;
-
-/****
- *ULINT_TO_USINT
- */
- case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_usint*/
- break;
-
-/****
- *ULINT_TO_BOOL
- */
- case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_bool*/
- break;
-
-/****
- *ULINT_TO_TIME
- */
- case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_time*/
- break;
-
-/****
- *ULINT_TO_INT
- */
- case function_ulint_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(¶m_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::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_int*/
- break;
-
-/****
- *BOOL_TO_REAL
- */
- case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_real*/
- break;
-
-/****
- *BOOL_TO_SINT
- */
- case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_sint*/
- break;
-
-/****
- *BOOL_TO_LINT
- */
- case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_lint*/
- break;
-
-/****
- *BOOL_TO_DINT
- */
- case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_dint*/
- break;
-
-/****
- *BOOL_TO_DATE
- */
- case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_date*/
- break;
-
-/****
- *BOOL_TO_DWORD
- */
- case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_dword*/
- break;
-
-/****
- *BOOL_TO_DT
- */
- case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_dt*/
- break;
-
-/****
- *BOOL_TO_TOD
- */
- case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_tod*/
- break;
-
-/****
- *BOOL_TO_UDINT
- */
- case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_udint*/
- break;
-
-/****
- *BOOL_TO_WORD
- */
- case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_word*/
- break;
-
-/****
- *BOOL_TO_STRING
- */
- case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_string*/
- break;
-
-/****
- *BOOL_TO_LWORD
- */
- case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_lword*/
- break;
-
-/****
- *BOOL_TO_UINT
- */
- case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_uint*/
- break;
-
-/****
- *BOOL_TO_LREAL
- */
- case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_lreal*/
- break;
-
-/****
- *BOOL_TO_BYTE
- */
- case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_byte*/
- break;
-
-/****
- *BOOL_TO_USINT
- */
- case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_usint*/
- break;
-
-/****
- *BOOL_TO_ULINT
- */
- case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_ulint*/
- break;
-
-/****
- *BOOL_TO_TIME
- */
- case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_time*/
- break;
-
-/****
- *BOOL_TO_INT
- */
- case function_bool_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(¶m_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::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_int*/
- break;
-
-/****
- *TIME_TO_REAL
- */
- case function_time_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(¶m_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::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_real*/
- break;
-
-/****
- *TIME_TO_SINT
- */
- case function_time_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(¶m_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::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_sint*/
- break;
-
-/****
- *TIME_TO_LINT
- */
- case function_time_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(¶m_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::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_lint*/
- break;
-
-/****
- *TIME_TO_DINT
- */
- case function_time_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(¶m_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::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_dint*/
- break;
-
-/****
- *TIME_TO_DWORD
- */
- case function_time_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(¶m_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::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_dword*/
- break;
-
-/****
- *TIME_TO_UDINT
- */
- case function_time_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(¶m_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::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_udint*/
- break;
-
-/****
- *TIME_TO_WORD
- */
- case function_time_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(¶m_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::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_word*/
- break;
-
-/****
- *TIME_TO_STRING
- */
- case function_time_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(¶m_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::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_string*/
- break;
-
-/****
- *TIME_TO_LWORD
- */
- case function_time_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(¶m_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::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_lword*/
- break;
-
-/****
- *TIME_TO_UINT
- */
- case function_time_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(¶m_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::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_uint*/
- break;
-
-/****
- *TIME_TO_LREAL
- */
- case function_time_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(¶m_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::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_lreal*/
- break;
-
-/****
- *TIME_TO_BYTE
- */
- case function_time_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(¶m_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::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_byte*/
- break;
-
-/****
- *TIME_TO_USINT
- */
- case function_time_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(¶m_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::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_usint*/
- break;
-
-/****
- *TIME_TO_ULINT
- */
- case function_time_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(¶m_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::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_ulint*/
- break;
-
-/****
- *TIME_TO_INT
- */
- case function_time_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(¶m_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::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_int*/
- break;
-
-/****
- *INT_TO_REAL
- */
- case function_int_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(¶m_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::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_real*/
- break;
-
-/****
- *INT_TO_SINT
- */
- case function_int_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(¶m_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::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_sint*/
- break;
-
-/****
- *INT_TO_LINT
- */
- case function_int_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(¶m_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::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_lint*/
- break;
-
-/****
- *INT_TO_DINT
- */
- case function_int_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(¶m_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::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_dint*/
- break;
-
-/****
- *INT_TO_DATE
- */
- case function_int_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(¶m_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::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_date*/
- break;
-
-/****
- *INT_TO_DWORD
- */
- case function_int_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(¶m_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::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_dword*/
- break;
-
-/****
- *INT_TO_DT
- */
- case function_int_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(¶m_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::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_dt*/
- break;
-
-/****
- *INT_TO_TOD
- */
- case function_int_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(¶m_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::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_tod*/
- break;
-
-/****
- *INT_TO_UDINT
- */
- case function_int_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(¶m_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::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_udint*/
- break;
-
-/****
- *INT_TO_WORD
- */
- case function_int_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(¶m_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::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_word*/
- break;
-
-/****
- *INT_TO_STRING
- */
- case function_int_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(¶m_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::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_string*/
- break;
-
-/****
- *INT_TO_LWORD
- */
- case function_int_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(¶m_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::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_lword*/
- break;
-
-/****
- *INT_TO_UINT
- */
- case function_int_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(¶m_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::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_uint*/
- break;
-
-/****
- *INT_TO_LREAL
- */
- case function_int_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(¶m_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::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_lreal*/
- break;
-
-/****
- *INT_TO_BYTE
- */
- case function_int_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(¶m_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::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_byte*/
- break;
-
-/****
- *INT_TO_USINT
- */
- case function_int_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(¶m_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::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_usint*/
- break;
-
-/****
- *INT_TO_ULINT
- */
- case function_int_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(¶m_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::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_ulint*/
- break;
-
-/****
- *INT_TO_BOOL
- */
- case function_int_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(¶m_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::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_bool*/
- break;
-
-/****
- *INT_TO_TIME
- */
- case function_int_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(¶m_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::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_time*/
- break;
-
-/****
- *TRUNC
- */
- case function_trunc :
- {
- 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(¶m_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_real_type(IN_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_trunc*/
- break;
-
-/****
- *BCD_TO_UDINT
- */
- case function_bcd_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(¶m_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::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bcd_to_udint*/
- break;
-
-/****
- *BCD_TO_UINT
- */
- case function_bcd_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(¶m_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::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bcd_to_uint*/
- break;
-
-/****
- *BCD_TO_ULINT
- */
- case function_bcd_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(¶m_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::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bcd_to_ulint*/
- break;
-
-/****
- *BCD_TO_USINT
- */
- case function_bcd_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(¶m_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::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bcd_to_usint*/
- break;
-
-/****
- *UDINT_TO_BCD
- */
- case function_udint_to_bcd :
- {
- 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(¶m_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::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_bcd*/
- break;
-
-/****
- *UINT_TO_BCD
- */
- case function_uint_to_bcd :
- {
- 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(¶m_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::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_bcd*/
- break;
-
-/****
- *USINT_TO_BCD
- */
- case function_usint_to_bcd :
- {
- 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(¶m_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::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_bcd*/
- break;
-
-/****
- *ULINT_TO_BCD
- */
- case function_ulint_to_bcd :
- {
- 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(¶m_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::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_bcd*/
- break;
-
-/****
- *DATE_AND_TIME_TO_TIME_OF_DAY
- */
- case function_date_and_time_to_time_of_day :
- {
- 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(¶m_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::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_date_and_time_to_time_of_day*/
- break;
-
-/****
- *DATE_AND_TIME_TO_DATE
- */
- case function_date_and_time_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(¶m_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::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_date_and_time_to_date*/
- break;
-
-/****
- *ABS
- */
- case function_abs :
- {
- 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(¶m_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_num_type(IN_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_abs*/
- break;
-
-/****
- *SQRT
- */
- case function_sqrt :
- {
- 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(¶m_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_real_type(IN_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_sqrt*/
- break;
-
-/****
- *LN
- */
- case function_ln :
- {
- 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(¶m_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_real_type(IN_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ln*/
- break;
-
-/****
- *LOG
- */
- case function_log :
- {
- 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(¶m_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_real_type(IN_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_log*/
- break;
-
-/****
- *EXP
- */
- case function_exp :
- {
- 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(¶m_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_real_type(IN_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_exp*/
- break;
-
-/****
- *SIN
- */
- case function_sin :
- {
- 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(¶m_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_real_type(IN_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_sin*/
- break;
-
-/****
- *COS
- */
- case function_cos :
- {
- 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(¶m_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_real_type(IN_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_cos*/
- break;
-
-/****
- *TAN
- */
- case function_tan :
- {
- 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(¶m_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_real_type(IN_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tan*/
- break;
-
-/****
- *ASIN
- */
- case function_asin :
- {
- 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(¶m_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_real_type(IN_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_asin*/
- break;
-
-/****
- *ACOS
- */
- case function_acos :
- {
- 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(¶m_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_real_type(IN_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_acos*/
- break;
-
-/****
- *ATAN
- */
- case function_atan :
- {
- 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(¶m_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_real_type(IN_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_atan*/
- break;
-
-/****
- *ADD
- */
- case function_add :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- identifier_c param_name("IN1");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN1_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN1_param_value == NULL)
- IN1_param_value = function_call_param_iterator.next();
- if (IN1_param_value != NULL) {
- IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
- last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
- {
-
- symbol_c * return_type_symbol = last_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_add*/
- break;
-
-/****
- *MUL
- */
- case function_mul :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- identifier_c param_name("IN1");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN1_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN1_param_value == NULL)
- IN1_param_value = function_call_param_iterator.next();
- if (IN1_param_value != NULL) {
- IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
- last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
- {
-
- symbol_c * return_type_symbol = last_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_mul*/
- break;
-
-/****
- *SUB
- */
- case function_sub :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- identifier_c param_name("IN1");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN1_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN1_param_value == NULL)
- IN1_param_value = function_call_param_iterator.next();
- if (IN1_param_value != NULL) {
- IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
- last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
- {
-
- symbol_c * return_type_symbol = last_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_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::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_sub*/
- break;
-
-/****
- *DIV
- */
- case function_div :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- identifier_c param_name("IN1");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN1_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN1_param_value == NULL)
- IN1_param_value = function_call_param_iterator.next();
- if (IN1_param_value != NULL) {
- IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
- last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
- {
-
- symbol_c * return_type_symbol = last_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_div*/
- break;
-
-/****
- *MOD
- */
- case function_mod :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- identifier_c param_name("IN1");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN1_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN1_param_value == NULL)
- IN1_param_value = function_call_param_iterator.next();
- if (IN1_param_value != NULL) {
- IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
- last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
- {
-
- symbol_c * return_type_symbol = last_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_mod*/
- break;
-
-/****
- *EXPT
- */
- case function_expt :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- identifier_c param_name("IN1");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN1_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN1_param_value == NULL)
- IN1_param_value = function_call_param_iterator.next();
- if (IN1_param_value != NULL) {
- IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
- last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_real_type(IN1_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
- {
-
- symbol_c * return_type_symbol = last_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_expt*/
- break;
-
-/****
- *MOVE
- */
- case function_move :
- {
- 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(¶m_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 ;
- }
-
-
- {
-
- symbol_c * return_type_symbol = last_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_move*/
- break;
-
-/****
- *SHL
- */
- case function_shl :
- {
- 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(¶m_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_binary_type(IN_type_symbol))
- {
-
- {
- identifier_c param_name("N");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *N_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *N_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (N_param_value == NULL)
- N_param_value = function_call_param_iterator.next();
- if (N_param_value != NULL) {
- N_type_symbol = search_expression_type->get_type(N_param_value);
- last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
- }
-
- if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_shl*/
- break;
-
-/****
- *SHR
- */
- case function_shr :
- {
- 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(¶m_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_binary_type(IN_type_symbol))
- {
-
- {
- identifier_c param_name("N");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *N_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *N_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (N_param_value == NULL)
- N_param_value = function_call_param_iterator.next();
- if (N_param_value != NULL) {
- N_type_symbol = search_expression_type->get_type(N_param_value);
- last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
- }
-
- if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_shr*/
- break;
-
-/****
- *ROR
- */
- case function_ror :
- {
- 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(¶m_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_nbinary_type(IN_type_symbol))
- {
-
- {
- identifier_c param_name("N");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *N_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *N_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (N_param_value == NULL)
- N_param_value = function_call_param_iterator.next();
- if (N_param_value != NULL) {
- N_type_symbol = search_expression_type->get_type(N_param_value);
- last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
- }
-
- if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_ror*/
- break;
-
-/****
- *ROL
- */
- case function_rol :
- {
- 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(¶m_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_nbinary_type(IN_type_symbol))
- {
-
- {
- identifier_c param_name("N");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *N_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *N_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (N_param_value == NULL)
- N_param_value = function_call_param_iterator.next();
- if (N_param_value != NULL) {
- N_type_symbol = search_expression_type->get_type(N_param_value);
- last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
- }
-
- if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_rol*/
- break;
-
-/****
- *AND
- */
- case function_and :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- identifier_c param_name("IN1");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN1_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN1_param_value == NULL)
- IN1_param_value = function_call_param_iterator.next();
- if (IN1_param_value != NULL) {
- IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
- last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_binary_type(IN1_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol))
- {
-
- symbol_c * return_type_symbol = last_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_and*/
- break;
-
-/****
- *OR
- */
- case function_or :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- identifier_c param_name("IN1");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN1_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN1_param_value == NULL)
- IN1_param_value = function_call_param_iterator.next();
- if (IN1_param_value != NULL) {
- IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
- last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_binary_type(IN1_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol))
- {
-
- symbol_c * return_type_symbol = last_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_or*/
- break;
-
-/****
- *XOR
- */
- case function_xor :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- identifier_c param_name("IN1");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN1_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN1_param_value == NULL)
- IN1_param_value = function_call_param_iterator.next();
- if (IN1_param_value != NULL) {
- IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
- last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_binary_type(IN1_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol))
- {
-
- symbol_c * return_type_symbol = last_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_xor*/
- break;
-
-/****
- *NOT
- */
- case function_not :
- {
- 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(¶m_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_binary_type(IN_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_not*/
- break;
-
-/****
- *SEL
- */
- case function_sel :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- identifier_c param_name("G");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *G_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *G_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (G_param_value == NULL)
- G_param_value = function_call_param_iterator.next();
- if (G_param_value != NULL) {
- G_type_symbol = search_expression_type->get_type(G_param_value);
- last_type_symbol = last_type_symbol && G_type_symbol && search_expression_type->is_same_type(G_type_symbol, last_type_symbol) ? search_expression_type->common_type(G_type_symbol, last_type_symbol) : G_type_symbol ;
- }
-
- if(G_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN0");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN0_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN0_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN0_param_value == NULL)
- IN0_param_value = function_call_param_iterator.next();
- if (IN0_param_value != NULL) {
- IN0_type_symbol = search_expression_type->get_type(IN0_param_value);
- last_type_symbol = last_type_symbol && IN0_type_symbol && search_expression_type->is_same_type(IN0_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN0_type_symbol, last_type_symbol) : IN0_type_symbol ;
- }
-
-
- {
-
- {
- identifier_c param_name("IN1");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN1_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN1_param_value == NULL)
- IN1_param_value = function_call_param_iterator.next();
- if (IN1_param_value != NULL) {
- IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
- last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
- }
-
-
- {
-
- symbol_c * return_type_symbol = last_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_sel*/
- break;
-
-/****
- *MAX
- */
- case function_max :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- identifier_c param_name("IN1");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN1_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN1_param_value == NULL)
- IN1_param_value = function_call_param_iterator.next();
- if (IN1_param_value != NULL) {
- IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
- last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
- }
-
-
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
-
- {
-
- symbol_c * return_type_symbol = last_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_max*/
- break;
-
-/****
- *MIN
- */
- case function_min :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- identifier_c param_name("IN1");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN1_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN1_param_value == NULL)
- IN1_param_value = function_call_param_iterator.next();
- if (IN1_param_value != NULL) {
- IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
- last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
- }
-
-
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
-
- {
-
- symbol_c * return_type_symbol = last_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_min*/
- break;
-
-/****
- *LIMIT
- */
- case function_limit :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- identifier_c param_name("MN");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *MN_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *MN_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (MN_param_value == NULL)
- MN_param_value = function_call_param_iterator.next();
- if (MN_param_value != NULL) {
- MN_type_symbol = search_expression_type->get_type(MN_param_value);
- last_type_symbol = last_type_symbol && MN_type_symbol && search_expression_type->is_same_type(MN_type_symbol, last_type_symbol) ? search_expression_type->common_type(MN_type_symbol, last_type_symbol) : MN_type_symbol ;
- }
-
-
- {
-
- {
- 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(¶m_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 ;
- }
-
-
- {
-
- {
- identifier_c param_name("MX");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *MX_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *MX_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (MX_param_value == NULL)
- MX_param_value = function_call_param_iterator.next();
- if (MX_param_value != NULL) {
- MX_type_symbol = search_expression_type->get_type(MX_param_value);
- last_type_symbol = last_type_symbol && MX_type_symbol && search_expression_type->is_same_type(MX_type_symbol, last_type_symbol) ? search_expression_type->common_type(MX_type_symbol, last_type_symbol) : MX_type_symbol ;
- }
-
-
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_limit*/
- break;
-
-/****
- *MUX
- */
- case function_mux :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- identifier_c param_name("K");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *K_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *K_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (K_param_value == NULL)
- K_param_value = function_call_param_iterator.next();
- if (K_param_value != NULL) {
- K_type_symbol = search_expression_type->get_type(K_param_value);
- last_type_symbol = last_type_symbol && K_type_symbol && search_expression_type->is_same_type(K_type_symbol, last_type_symbol) ? search_expression_type->common_type(K_type_symbol, last_type_symbol) : K_type_symbol ;
- }
-
- if(K_type_symbol == NULL || search_expression_type->is_integer_type(K_type_symbol))
- {
-
- {
- identifier_c param_name("IN0");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN0_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN0_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN0_param_value == NULL)
- IN0_param_value = function_call_param_iterator.next();
- if (IN0_param_value != NULL) {
- IN0_type_symbol = search_expression_type->get_type(IN0_param_value);
- last_type_symbol = last_type_symbol && IN0_type_symbol && search_expression_type->is_same_type(IN0_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN0_type_symbol, last_type_symbol) : IN0_type_symbol ;
- }
-
-
- {
-
- {
- identifier_c param_name("IN1");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN1_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN1_param_value == NULL)
- IN1_param_value = function_call_param_iterator.next();
- if (IN1_param_value != NULL) {
- IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
- last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
- }
-
-
- {
-
- symbol_c * return_type_symbol = last_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_mux*/
- break;
-
-/****
- *GT
- */
- case function_gt :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- identifier_c param_name("IN1");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN1_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN1_param_value == NULL)
- IN1_param_value = function_call_param_iterator.next();
- if (IN1_param_value != NULL) {
- IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
- last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
- }
-
-
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
-
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_gt*/
- break;
-
-/****
- *GE
- */
- case function_ge :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- identifier_c param_name("IN1");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN1_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN1_param_value == NULL)
- IN1_param_value = function_call_param_iterator.next();
- if (IN1_param_value != NULL) {
- IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
- last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
- }
-
-
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
-
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_ge*/
- break;
-
-/****
- *EQ
- */
- case function_eq :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- identifier_c param_name("IN1");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN1_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN1_param_value == NULL)
- IN1_param_value = function_call_param_iterator.next();
- if (IN1_param_value != NULL) {
- IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
- last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
- }
-
-
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
-
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_eq*/
- break;
-
-/****
- *LT
- */
- case function_lt :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- identifier_c param_name("IN1");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN1_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN1_param_value == NULL)
- IN1_param_value = function_call_param_iterator.next();
- if (IN1_param_value != NULL) {
- IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
- last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
- }
-
-
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
-
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_lt*/
- break;
-
-/****
- *LE
- */
- case function_le :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- identifier_c param_name("IN1");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN1_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN1_param_value == NULL)
- IN1_param_value = function_call_param_iterator.next();
- if (IN1_param_value != NULL) {
- IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
- last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
- }
-
-
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
-
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_le*/
- break;
-
-/****
- *NE
- */
- case function_ne :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- identifier_c param_name("IN1");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN1_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN1_param_value == NULL)
- IN1_param_value = function_call_param_iterator.next();
- if (IN1_param_value != NULL) {
- IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
- last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
- }
-
-
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
-
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_ne*/
- break;
-
-/****
- *LEN
- */
- case function_len :
- {
- 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(¶m_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::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_len*/
- break;
-
-/****
- *LEFT
- */
- case function_left :
- {
- 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(¶m_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::string_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("L");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *L_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *L_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (L_param_value == NULL)
- L_param_value = function_call_param_iterator.next();
- if (L_param_value != NULL) {
- L_type_symbol = search_expression_type->get_type(L_param_value);
- last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
- }
-
- if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_left*/
- break;
-
-/****
- *RIGHT
- */
- case function_right :
- {
- 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(¶m_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::string_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("L");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *L_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *L_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (L_param_value == NULL)
- L_param_value = function_call_param_iterator.next();
- if (L_param_value != NULL) {
- L_type_symbol = search_expression_type->get_type(L_param_value);
- last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
- }
-
- if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_right*/
- break;
-
-/****
- *MID
- */
- case function_mid :
- {
- 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(¶m_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::string_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("L");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *L_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *L_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (L_param_value == NULL)
- L_param_value = function_call_param_iterator.next();
- if (L_param_value != NULL) {
- L_type_symbol = search_expression_type->get_type(L_param_value);
- last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
- }
-
- if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol))
- {
-
- {
- identifier_c param_name("P");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *P_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *P_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (P_param_value == NULL)
- P_param_value = function_call_param_iterator.next();
- if (P_param_value != NULL) {
- P_type_symbol = search_expression_type->get_type(P_param_value);
- last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
- }
-
- if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_mid*/
- break;
-
-/****
- *CONCAT
- */
- case function_concat :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- identifier_c param_name("IN1");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN1_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN1_param_value == NULL)
- IN1_param_value = function_call_param_iterator.next();
- if (IN1_param_value != NULL) {
- IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
- last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_concat*/
- break;
-
-/****
- *INSERT
- */
- case function_insert :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- identifier_c param_name("IN1");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN1_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN1_param_value == NULL)
- IN1_param_value = function_call_param_iterator.next();
- if (IN1_param_value != NULL) {
- IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
- last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("P");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *P_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *P_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (P_param_value == NULL)
- P_param_value = function_call_param_iterator.next();
- if (P_param_value != NULL) {
- P_type_symbol = search_expression_type->get_type(P_param_value);
- last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
- }
-
- if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_insert*/
- break;
-
-/****
- *DELETE
- */
- case function_delete :
- {
- 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(¶m_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::string_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("L");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *L_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *L_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (L_param_value == NULL)
- L_param_value = function_call_param_iterator.next();
- if (L_param_value != NULL) {
- L_type_symbol = search_expression_type->get_type(L_param_value);
- last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
- }
-
- if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol))
- {
-
- {
- identifier_c param_name("P");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *P_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *P_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (P_param_value == NULL)
- P_param_value = function_call_param_iterator.next();
- if (P_param_value != NULL) {
- P_type_symbol = search_expression_type->get_type(P_param_value);
- last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
- }
-
- if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_delete*/
- break;
-
-/****
- *REPLACE
- */
- case function_replace :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- identifier_c param_name("IN1");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN1_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN1_param_value == NULL)
- IN1_param_value = function_call_param_iterator.next();
- if (IN1_param_value != NULL) {
- IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
- last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("L");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *L_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *L_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (L_param_value == NULL)
- L_param_value = function_call_param_iterator.next();
- if (L_param_value != NULL) {
- L_type_symbol = search_expression_type->get_type(L_param_value);
- last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
- }
-
- if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol))
- {
-
- {
- identifier_c param_name("P");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *P_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *P_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (P_param_value == NULL)
- P_param_value = function_call_param_iterator.next();
- if (P_param_value != NULL) {
- P_type_symbol = search_expression_type->get_type(P_param_value);
- last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
- }
-
- if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_replace*/
- break;
-
-/****
- *FIND
- */
- case function_find :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- identifier_c param_name("IN1");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN1_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN1_param_value == NULL)
- IN1_param_value = function_call_param_iterator.next();
- if (IN1_param_value != NULL) {
- IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
- last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_find*/
- break;
-
- case function_none :
- ERROR;
- }
- return NULL;
-}
-
-void *compute_standard_function_il(il_function_call_c *symbol, symbol_c *param_data_type) {
-
- function_type_t current_function_type = get_function_type((identifier_c *)symbol->function_name);
- function_call_param_iterator_c function_call_param_iterator(symbol);
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dword_to_tod*/
- break;
-
-/****
- *DWORD_TO_UDINT
- */
- case function_dword_to_udint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dword_to_udint*/
- break;
-
-/****
- *DWORD_TO_WORD
- */
- case function_dword_to_word :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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::word_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dword_to_word*/
- break;
-
-/****
- *DWORD_TO_STRING
- */
- case function_dword_to_string :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dword_to_string*/
- break;
-
-/****
- *DWORD_TO_LWORD
- */
- case function_dword_to_lword :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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::lword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dword_to_lword*/
- break;
-
-/****
- *DWORD_TO_UINT
- */
- case function_dword_to_uint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dword_to_uint*/
- break;
-
-/****
- *DWORD_TO_LREAL
- */
- case function_dword_to_lreal :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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::lreal_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dword_to_lreal*/
- break;
-
-/****
- *DWORD_TO_BYTE
- */
- case function_dword_to_byte :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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::byte_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dword_to_byte*/
- break;
-
-/****
- *DWORD_TO_USINT
- */
- case function_dword_to_usint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dword_to_usint*/
- break;
-
-/****
- *DWORD_TO_ULINT
- */
- case function_dword_to_ulint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dword_to_ulint*/
- break;
-
-/****
- *DWORD_TO_BOOL
- */
- case function_dword_to_bool :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dword_to_bool*/
- break;
-
-/****
- *DWORD_TO_TIME
- */
- case function_dword_to_time :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dword_to_time*/
- break;
-
-/****
- *DWORD_TO_INT
- */
- case function_dword_to_int :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dword_to_int*/
- break;
-
-/****
- *DT_TO_REAL
- */
- case function_dt_to_real :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_real*/
- break;
-
-/****
- *DT_TO_SINT
- */
- case function_dt_to_sint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_sint*/
- break;
-
-/****
- *DT_TO_LINT
- */
- case function_dt_to_lint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_lint*/
- break;
-
-/****
- *DT_TO_DINT
- */
- case function_dt_to_dint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_dint*/
- break;
-
-/****
- *DT_TO_DWORD
- */
- case function_dt_to_dword :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_dword*/
- break;
-
-/****
- *DT_TO_UDINT
- */
- case function_dt_to_udint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_udint*/
- break;
-
-/****
- *DT_TO_WORD
- */
- case function_dt_to_word :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_word*/
- break;
-
-/****
- *DT_TO_STRING
- */
- case function_dt_to_string :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_string*/
- break;
-
-/****
- *DT_TO_LWORD
- */
- case function_dt_to_lword :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_lword*/
- break;
-
-/****
- *DT_TO_UINT
- */
- case function_dt_to_uint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_uint*/
- break;
-
-/****
- *DT_TO_LREAL
- */
- case function_dt_to_lreal :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_lreal*/
- break;
-
-/****
- *DT_TO_BYTE
- */
- case function_dt_to_byte :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_byte*/
- break;
-
-/****
- *DT_TO_USINT
- */
- case function_dt_to_usint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_usint*/
- break;
-
-/****
- *DT_TO_ULINT
- */
- case function_dt_to_ulint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_ulint*/
- break;
-
-/****
- *DT_TO_INT
- */
- case function_dt_to_int :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_dt_to_int*/
- break;
-
-/****
- *TOD_TO_REAL
- */
- case function_tod_to_real :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_real*/
- break;
-
-/****
- *TOD_TO_SINT
- */
- case function_tod_to_sint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_sint*/
- break;
-
-/****
- *TOD_TO_LINT
- */
- case function_tod_to_lint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_lint*/
- break;
-
-/****
- *TOD_TO_DINT
- */
- case function_tod_to_dint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_dint*/
- break;
-
-/****
- *TOD_TO_DWORD
- */
- case function_tod_to_dword :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_dword*/
- break;
-
-/****
- *TOD_TO_UDINT
- */
- case function_tod_to_udint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_udint*/
- break;
-
-/****
- *TOD_TO_WORD
- */
- case function_tod_to_word :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_word*/
- break;
-
-/****
- *TOD_TO_STRING
- */
- case function_tod_to_string :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_string*/
- break;
-
-/****
- *TOD_TO_LWORD
- */
- case function_tod_to_lword :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_lword*/
- break;
-
-/****
- *TOD_TO_UINT
- */
- case function_tod_to_uint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_uint*/
- break;
-
-/****
- *TOD_TO_LREAL
- */
- case function_tod_to_lreal :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_lreal*/
- break;
-
-/****
- *TOD_TO_BYTE
- */
- case function_tod_to_byte :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_byte*/
- break;
-
-/****
- *TOD_TO_USINT
- */
- case function_tod_to_usint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_usint*/
- break;
-
-/****
- *TOD_TO_ULINT
- */
- case function_tod_to_ulint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_ulint*/
- break;
-
-/****
- *TOD_TO_INT
- */
- case function_tod_to_int :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tod_to_int*/
- break;
-
-/****
- *UDINT_TO_REAL
- */
- case function_udint_to_real :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_real*/
- break;
-
-/****
- *UDINT_TO_SINT
- */
- case function_udint_to_sint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_sint*/
- break;
-
-/****
- *UDINT_TO_LINT
- */
- case function_udint_to_lint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_lint*/
- break;
-
-/****
- *UDINT_TO_DINT
- */
- case function_udint_to_dint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_dint*/
- break;
-
-/****
- *UDINT_TO_DATE
- */
- case function_udint_to_date :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_date*/
- break;
-
-/****
- *UDINT_TO_DWORD
- */
- case function_udint_to_dword :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_dword*/
- break;
-
-/****
- *UDINT_TO_DT
- */
- case function_udint_to_dt :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_dt*/
- break;
-
-/****
- *UDINT_TO_TOD
- */
- case function_udint_to_tod :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_tod*/
- break;
-
-/****
- *UDINT_TO_WORD
- */
- case function_udint_to_word :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_word*/
- break;
-
-/****
- *UDINT_TO_STRING
- */
- case function_udint_to_string :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_string*/
- break;
-
-/****
- *UDINT_TO_LWORD
- */
- case function_udint_to_lword :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_lword*/
- break;
-
-/****
- *UDINT_TO_UINT
- */
- case function_udint_to_uint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_uint*/
- break;
-
-/****
- *UDINT_TO_LREAL
- */
- case function_udint_to_lreal :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_lreal*/
- break;
-
-/****
- *UDINT_TO_BYTE
- */
- case function_udint_to_byte :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_byte*/
- break;
-
-/****
- *UDINT_TO_USINT
- */
- case function_udint_to_usint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_usint*/
- break;
-
-/****
- *UDINT_TO_ULINT
- */
- case function_udint_to_ulint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_ulint*/
- break;
-
-/****
- *UDINT_TO_BOOL
- */
- case function_udint_to_bool :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_bool*/
- break;
-
-/****
- *UDINT_TO_TIME
- */
- case function_udint_to_time :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_time*/
- break;
-
-/****
- *UDINT_TO_INT
- */
- case function_udint_to_int :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_int*/
- break;
-
-/****
- *WORD_TO_REAL
- */
- case function_word_to_real :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_real*/
- break;
-
-/****
- *WORD_TO_SINT
- */
- case function_word_to_sint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_sint*/
- break;
-
-/****
- *WORD_TO_LINT
- */
- case function_word_to_lint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_lint*/
- break;
-
-/****
- *WORD_TO_DINT
- */
- case function_word_to_dint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_dint*/
- break;
-
-/****
- *WORD_TO_DATE
- */
- case function_word_to_date :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_date*/
- break;
-
-/****
- *WORD_TO_DWORD
- */
- case function_word_to_dword :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_dword*/
- break;
-
-/****
- *WORD_TO_DT
- */
- case function_word_to_dt :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_dt*/
- break;
-
-/****
- *WORD_TO_TOD
- */
- case function_word_to_tod :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_tod*/
- break;
-
-/****
- *WORD_TO_UDINT
- */
- case function_word_to_udint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_udint*/
- break;
-
-/****
- *WORD_TO_STRING
- */
- case function_word_to_string :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_string*/
- break;
-
-/****
- *WORD_TO_LWORD
- */
- case function_word_to_lword :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_lword*/
- break;
-
-/****
- *WORD_TO_UINT
- */
- case function_word_to_uint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_uint*/
- break;
-
-/****
- *WORD_TO_LREAL
- */
- case function_word_to_lreal :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_lreal*/
- break;
-
-/****
- *WORD_TO_BYTE
- */
- case function_word_to_byte :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_byte*/
- break;
-
-/****
- *WORD_TO_USINT
- */
- case function_word_to_usint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_usint*/
- break;
-
-/****
- *WORD_TO_ULINT
- */
- case function_word_to_ulint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_ulint*/
- break;
-
-/****
- *WORD_TO_BOOL
- */
- case function_word_to_bool :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_bool*/
- break;
-
-/****
- *WORD_TO_TIME
- */
- case function_word_to_time :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_time*/
- break;
-
-/****
- *WORD_TO_INT
- */
- case function_word_to_int :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_word_to_int*/
- break;
-
-/****
- *STRING_TO_REAL
- */
- case function_string_to_real :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_real*/
- break;
-
-/****
- *STRING_TO_SINT
- */
- case function_string_to_sint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_sint*/
- break;
-
-/****
- *STRING_TO_LINT
- */
- case function_string_to_lint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_lint*/
- break;
-
-/****
- *STRING_TO_DINT
- */
- case function_string_to_dint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_dint*/
- break;
-
-/****
- *STRING_TO_DATE
- */
- case function_string_to_date :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_date*/
- break;
-
-/****
- *STRING_TO_DWORD
- */
- case function_string_to_dword :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_dword*/
- break;
-
-/****
- *STRING_TO_DT
- */
- case function_string_to_dt :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_dt*/
- break;
-
-/****
- *STRING_TO_TOD
- */
- case function_string_to_tod :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_tod*/
- break;
-
-/****
- *STRING_TO_UDINT
- */
- case function_string_to_udint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_udint*/
- break;
-
-/****
- *STRING_TO_WORD
- */
- case function_string_to_word :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_word*/
- break;
-
-/****
- *STRING_TO_LWORD
- */
- case function_string_to_lword :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_lword*/
- break;
-
-/****
- *STRING_TO_UINT
- */
- case function_string_to_uint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_uint*/
- break;
-
-/****
- *STRING_TO_LREAL
- */
- case function_string_to_lreal :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_lreal*/
- break;
-
-/****
- *STRING_TO_BYTE
- */
- case function_string_to_byte :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_byte*/
- break;
-
-/****
- *STRING_TO_USINT
- */
- case function_string_to_usint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_usint*/
- break;
-
-/****
- *STRING_TO_ULINT
- */
- case function_string_to_ulint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_ulint*/
- break;
-
-/****
- *STRING_TO_BOOL
- */
- case function_string_to_bool :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_bool*/
- break;
-
-/****
- *STRING_TO_TIME
- */
- case function_string_to_time :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_time*/
- break;
-
-/****
- *STRING_TO_INT
- */
- case function_string_to_int :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_string_to_int*/
- break;
-
-/****
- *LWORD_TO_REAL
- */
- case function_lword_to_real :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_real*/
- break;
-
-/****
- *LWORD_TO_SINT
- */
- case function_lword_to_sint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_sint*/
- break;
-
-/****
- *LWORD_TO_LINT
- */
- case function_lword_to_lint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_lint*/
- break;
-
-/****
- *LWORD_TO_DINT
- */
- case function_lword_to_dint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_dint*/
- break;
-
-/****
- *LWORD_TO_DATE
- */
- case function_lword_to_date :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_date*/
- break;
-
-/****
- *LWORD_TO_DWORD
- */
- case function_lword_to_dword :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_dword*/
- break;
-
-/****
- *LWORD_TO_DT
- */
- case function_lword_to_dt :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_dt*/
- break;
-
-/****
- *LWORD_TO_TOD
- */
- case function_lword_to_tod :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_tod*/
- break;
-
-/****
- *LWORD_TO_UDINT
- */
- case function_lword_to_udint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_udint*/
- break;
-
-/****
- *LWORD_TO_WORD
- */
- case function_lword_to_word :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_word*/
- break;
-
-/****
- *LWORD_TO_STRING
- */
- case function_lword_to_string :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_string*/
- break;
-
-/****
- *LWORD_TO_UINT
- */
- case function_lword_to_uint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_uint*/
- break;
-
-/****
- *LWORD_TO_LREAL
- */
- case function_lword_to_lreal :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_lreal*/
- break;
-
-/****
- *LWORD_TO_BYTE
- */
- case function_lword_to_byte :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_byte*/
- break;
-
-/****
- *LWORD_TO_USINT
- */
- case function_lword_to_usint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_usint*/
- break;
-
-/****
- *LWORD_TO_ULINT
- */
- case function_lword_to_ulint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_ulint*/
- break;
-
-/****
- *LWORD_TO_BOOL
- */
- case function_lword_to_bool :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_bool*/
- break;
-
-/****
- *LWORD_TO_TIME
- */
- case function_lword_to_time :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_time*/
- break;
-
-/****
- *LWORD_TO_INT
- */
- case function_lword_to_int :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lword_to_int*/
- break;
-
-/****
- *UINT_TO_REAL
- */
- case function_uint_to_real :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_real*/
- break;
-
-/****
- *UINT_TO_SINT
- */
- case function_uint_to_sint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_sint*/
- break;
-
-/****
- *UINT_TO_LINT
- */
- case function_uint_to_lint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_lint*/
- break;
-
-/****
- *UINT_TO_DINT
- */
- case function_uint_to_dint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_dint*/
- break;
-
-/****
- *UINT_TO_DATE
- */
- case function_uint_to_date :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_date*/
- break;
-
-/****
- *UINT_TO_DWORD
- */
- case function_uint_to_dword :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_dword*/
- break;
-
-/****
- *UINT_TO_DT
- */
- case function_uint_to_dt :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_dt*/
- break;
-
-/****
- *UINT_TO_TOD
- */
- case function_uint_to_tod :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_tod*/
- break;
-
-/****
- *UINT_TO_UDINT
- */
- case function_uint_to_udint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_udint*/
- break;
-
-/****
- *UINT_TO_WORD
- */
- case function_uint_to_word :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_word*/
- break;
-
-/****
- *UINT_TO_STRING
- */
- case function_uint_to_string :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_string*/
- break;
-
-/****
- *UINT_TO_LWORD
- */
- case function_uint_to_lword :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_lword*/
- break;
-
-/****
- *UINT_TO_LREAL
- */
- case function_uint_to_lreal :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_lreal*/
- break;
-
-/****
- *UINT_TO_BYTE
- */
- case function_uint_to_byte :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_byte*/
- break;
-
-/****
- *UINT_TO_USINT
- */
- case function_uint_to_usint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_usint*/
- break;
-
-/****
- *UINT_TO_ULINT
- */
- case function_uint_to_ulint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_ulint*/
- break;
-
-/****
- *UINT_TO_BOOL
- */
- case function_uint_to_bool :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_bool*/
- break;
-
-/****
- *UINT_TO_TIME
- */
- case function_uint_to_time :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_time*/
- break;
-
-/****
- *UINT_TO_INT
- */
- case function_uint_to_int :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_int*/
- break;
-
-/****
- *LREAL_TO_REAL
- */
- case function_lreal_to_real :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_real*/
- break;
-
-/****
- *LREAL_TO_SINT
- */
- case function_lreal_to_sint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_sint*/
- break;
-
-/****
- *LREAL_TO_LINT
- */
- case function_lreal_to_lint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_lint*/
- break;
-
-/****
- *LREAL_TO_DINT
- */
- case function_lreal_to_dint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_dint*/
- break;
-
-/****
- *LREAL_TO_DATE
- */
- case function_lreal_to_date :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_date*/
- break;
-
-/****
- *LREAL_TO_DWORD
- */
- case function_lreal_to_dword :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_dword*/
- break;
-
-/****
- *LREAL_TO_DT
- */
- case function_lreal_to_dt :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_dt*/
- break;
-
-/****
- *LREAL_TO_TOD
- */
- case function_lreal_to_tod :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_tod*/
- break;
-
-/****
- *LREAL_TO_UDINT
- */
- case function_lreal_to_udint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_udint*/
- break;
-
-/****
- *LREAL_TO_WORD
- */
- case function_lreal_to_word :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_word*/
- break;
-
-/****
- *LREAL_TO_STRING
- */
- case function_lreal_to_string :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_string*/
- break;
-
-/****
- *LREAL_TO_LWORD
- */
- case function_lreal_to_lword :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_lword*/
- break;
-
-/****
- *LREAL_TO_UINT
- */
- case function_lreal_to_uint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_uint*/
- break;
-
-/****
- *LREAL_TO_BYTE
- */
- case function_lreal_to_byte :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_byte*/
- break;
-
-/****
- *LREAL_TO_USINT
- */
- case function_lreal_to_usint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_usint*/
- break;
-
-/****
- *LREAL_TO_ULINT
- */
- case function_lreal_to_ulint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_ulint*/
- break;
-
-/****
- *LREAL_TO_BOOL
- */
- case function_lreal_to_bool :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_bool*/
- break;
-
-/****
- *LREAL_TO_TIME
- */
- case function_lreal_to_time :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_time*/
- break;
-
-/****
- *LREAL_TO_INT
- */
- case function_lreal_to_int :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_lreal_to_int*/
- break;
-
-/****
- *BYTE_TO_REAL
- */
- case function_byte_to_real :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_real*/
- break;
-
-/****
- *BYTE_TO_SINT
- */
- case function_byte_to_sint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_sint*/
- break;
-
-/****
- *BYTE_TO_LINT
- */
- case function_byte_to_lint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_lint*/
- break;
-
-/****
- *BYTE_TO_DINT
- */
- case function_byte_to_dint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_dint*/
- break;
-
-/****
- *BYTE_TO_DATE
- */
- case function_byte_to_date :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_date*/
- break;
-
-/****
- *BYTE_TO_DWORD
- */
- case function_byte_to_dword :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_dword*/
- break;
-
-/****
- *BYTE_TO_DT
- */
- case function_byte_to_dt :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_dt*/
- break;
-
-/****
- *BYTE_TO_TOD
- */
- case function_byte_to_tod :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_tod*/
- break;
-
-/****
- *BYTE_TO_UDINT
- */
- case function_byte_to_udint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_udint*/
- break;
-
-/****
- *BYTE_TO_WORD
- */
- case function_byte_to_word :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_word*/
- break;
-
-/****
- *BYTE_TO_STRING
- */
- case function_byte_to_string :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_string*/
- break;
-
-/****
- *BYTE_TO_LWORD
- */
- case function_byte_to_lword :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_lword*/
- break;
-
-/****
- *BYTE_TO_UINT
- */
- case function_byte_to_uint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_uint*/
- break;
-
-/****
- *BYTE_TO_LREAL
- */
- case function_byte_to_lreal :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_lreal*/
- break;
-
-/****
- *BYTE_TO_USINT
- */
- case function_byte_to_usint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_usint*/
- break;
-
-/****
- *BYTE_TO_ULINT
- */
- case function_byte_to_ulint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_ulint*/
- break;
-
-/****
- *BYTE_TO_BOOL
- */
- case function_byte_to_bool :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_bool*/
- break;
-
-/****
- *BYTE_TO_TIME
- */
- case function_byte_to_time :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_time*/
- break;
-
-/****
- *BYTE_TO_INT
- */
- case function_byte_to_int :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_byte_to_int*/
- break;
-
-/****
- *USINT_TO_REAL
- */
- case function_usint_to_real :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_real*/
- break;
-
-/****
- *USINT_TO_SINT
- */
- case function_usint_to_sint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_sint*/
- break;
-
-/****
- *USINT_TO_LINT
- */
- case function_usint_to_lint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_lint*/
- break;
-
-/****
- *USINT_TO_DINT
- */
- case function_usint_to_dint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_dint*/
- break;
-
-/****
- *USINT_TO_DATE
- */
- case function_usint_to_date :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_date*/
- break;
-
-/****
- *USINT_TO_DWORD
- */
- case function_usint_to_dword :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_dword*/
- break;
-
-/****
- *USINT_TO_DT
- */
- case function_usint_to_dt :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_dt*/
- break;
-
-/****
- *USINT_TO_TOD
- */
- case function_usint_to_tod :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_tod*/
- break;
-
-/****
- *USINT_TO_UDINT
- */
- case function_usint_to_udint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_udint*/
- break;
-
-/****
- *USINT_TO_WORD
- */
- case function_usint_to_word :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_word*/
- break;
-
-/****
- *USINT_TO_STRING
- */
- case function_usint_to_string :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_string*/
- break;
-
-/****
- *USINT_TO_LWORD
- */
- case function_usint_to_lword :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_lword*/
- break;
-
-/****
- *USINT_TO_UINT
- */
- case function_usint_to_uint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_uint*/
- break;
-
-/****
- *USINT_TO_LREAL
- */
- case function_usint_to_lreal :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_lreal*/
- break;
-
-/****
- *USINT_TO_BYTE
- */
- case function_usint_to_byte :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_byte*/
- break;
-
-/****
- *USINT_TO_ULINT
- */
- case function_usint_to_ulint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_ulint*/
- break;
-
-/****
- *USINT_TO_BOOL
- */
- case function_usint_to_bool :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_bool*/
- break;
-
-/****
- *USINT_TO_TIME
- */
- case function_usint_to_time :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_time*/
- break;
-
-/****
- *USINT_TO_INT
- */
- case function_usint_to_int :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_int*/
- break;
-
-/****
- *ULINT_TO_REAL
- */
- case function_ulint_to_real :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_real*/
- break;
-
-/****
- *ULINT_TO_SINT
- */
- case function_ulint_to_sint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_sint*/
- break;
-
-/****
- *ULINT_TO_LINT
- */
- case function_ulint_to_lint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_lint*/
- break;
-
-/****
- *ULINT_TO_DINT
- */
- case function_ulint_to_dint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_dint*/
- break;
-
-/****
- *ULINT_TO_DATE
- */
- case function_ulint_to_date :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_date*/
- break;
-
-/****
- *ULINT_TO_DWORD
- */
- case function_ulint_to_dword :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_dword*/
- break;
-
-/****
- *ULINT_TO_DT
- */
- case function_ulint_to_dt :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_dt*/
- break;
-
-/****
- *ULINT_TO_TOD
- */
- case function_ulint_to_tod :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_tod*/
- break;
-
-/****
- *ULINT_TO_UDINT
- */
- case function_ulint_to_udint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_udint*/
- break;
-
-/****
- *ULINT_TO_WORD
- */
- case function_ulint_to_word :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_word*/
- break;
-
-/****
- *ULINT_TO_STRING
- */
- case function_ulint_to_string :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_string*/
- break;
-
-/****
- *ULINT_TO_LWORD
- */
- case function_ulint_to_lword :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_lword*/
- break;
-
-/****
- *ULINT_TO_UINT
- */
- case function_ulint_to_uint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_uint*/
- break;
-
-/****
- *ULINT_TO_LREAL
- */
- case function_ulint_to_lreal :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_lreal*/
- break;
-
-/****
- *ULINT_TO_BYTE
- */
- case function_ulint_to_byte :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_byte*/
- break;
-
-/****
- *ULINT_TO_USINT
- */
- case function_ulint_to_usint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_usint*/
- break;
-
-/****
- *ULINT_TO_BOOL
- */
- case function_ulint_to_bool :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_bool*/
- break;
-
-/****
- *ULINT_TO_TIME
- */
- case function_ulint_to_time :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_time*/
- break;
-
-/****
- *ULINT_TO_INT
- */
- case function_ulint_to_int :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_int*/
- break;
-
-/****
- *BOOL_TO_REAL
- */
- case function_bool_to_real :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_real*/
- break;
-
-/****
- *BOOL_TO_SINT
- */
- case function_bool_to_sint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_sint*/
- break;
-
-/****
- *BOOL_TO_LINT
- */
- case function_bool_to_lint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_lint*/
- break;
-
-/****
- *BOOL_TO_DINT
- */
- case function_bool_to_dint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_dint*/
- break;
-
-/****
- *BOOL_TO_DATE
- */
- case function_bool_to_date :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_date*/
- break;
-
-/****
- *BOOL_TO_DWORD
- */
- case function_bool_to_dword :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_dword*/
- break;
-
-/****
- *BOOL_TO_DT
- */
- case function_bool_to_dt :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_dt*/
- break;
-
-/****
- *BOOL_TO_TOD
- */
- case function_bool_to_tod :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_tod*/
- break;
-
-/****
- *BOOL_TO_UDINT
- */
- case function_bool_to_udint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_udint*/
- break;
-
-/****
- *BOOL_TO_WORD
- */
- case function_bool_to_word :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_word*/
- break;
-
-/****
- *BOOL_TO_STRING
- */
- case function_bool_to_string :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_string*/
- break;
-
-/****
- *BOOL_TO_LWORD
- */
- case function_bool_to_lword :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_lword*/
- break;
-
-/****
- *BOOL_TO_UINT
- */
- case function_bool_to_uint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_uint*/
- break;
-
-/****
- *BOOL_TO_LREAL
- */
- case function_bool_to_lreal :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_lreal*/
- break;
-
-/****
- *BOOL_TO_BYTE
- */
- case function_bool_to_byte :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_byte*/
- break;
-
-/****
- *BOOL_TO_USINT
- */
- case function_bool_to_usint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_usint*/
- break;
-
-/****
- *BOOL_TO_ULINT
- */
- case function_bool_to_ulint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_ulint*/
- break;
-
-/****
- *BOOL_TO_TIME
- */
- case function_bool_to_time :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_time*/
- break;
-
-/****
- *BOOL_TO_INT
- */
- case function_bool_to_int :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bool_to_int*/
- break;
-
-/****
- *TIME_TO_REAL
- */
- case function_time_to_real :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_real*/
- break;
-
-/****
- *TIME_TO_SINT
- */
- case function_time_to_sint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_sint*/
- break;
-
-/****
- *TIME_TO_LINT
- */
- case function_time_to_lint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_lint*/
- break;
-
-/****
- *TIME_TO_DINT
- */
- case function_time_to_dint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_dint*/
- break;
-
-/****
- *TIME_TO_DWORD
- */
- case function_time_to_dword :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_dword*/
- break;
-
-/****
- *TIME_TO_UDINT
- */
- case function_time_to_udint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_udint*/
- break;
-
-/****
- *TIME_TO_WORD
- */
- case function_time_to_word :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_word*/
- break;
-
-/****
- *TIME_TO_STRING
- */
- case function_time_to_string :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_string*/
- break;
-
-/****
- *TIME_TO_LWORD
- */
- case function_time_to_lword :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_lword*/
- break;
-
-/****
- *TIME_TO_UINT
- */
- case function_time_to_uint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_uint*/
- break;
-
-/****
- *TIME_TO_LREAL
- */
- case function_time_to_lreal :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_lreal*/
- break;
-
-/****
- *TIME_TO_BYTE
- */
- case function_time_to_byte :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_byte*/
- break;
-
-/****
- *TIME_TO_USINT
- */
- case function_time_to_usint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_usint*/
- break;
-
-/****
- *TIME_TO_ULINT
- */
- case function_time_to_ulint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_ulint*/
- break;
-
-/****
- *TIME_TO_INT
- */
- case function_time_to_int :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_time_to_int*/
- break;
-
-/****
- *INT_TO_REAL
- */
- case function_int_to_real :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_real*/
- break;
-
-/****
- *INT_TO_SINT
- */
- case function_int_to_sint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_sint*/
- break;
-
-/****
- *INT_TO_LINT
- */
- case function_int_to_lint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_lint*/
- break;
-
-/****
- *INT_TO_DINT
- */
- case function_int_to_dint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_dint*/
- break;
-
-/****
- *INT_TO_DATE
- */
- case function_int_to_date :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_date*/
- break;
-
-/****
- *INT_TO_DWORD
- */
- case function_int_to_dword :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_dword*/
- break;
-
-/****
- *INT_TO_DT
- */
- case function_int_to_dt :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_dt*/
- break;
-
-/****
- *INT_TO_TOD
- */
- case function_int_to_tod :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_tod*/
- break;
-
-/****
- *INT_TO_UDINT
- */
- case function_int_to_udint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_udint*/
- break;
-
-/****
- *INT_TO_WORD
- */
- case function_int_to_word :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_word*/
- break;
-
-/****
- *INT_TO_STRING
- */
- case function_int_to_string :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_string*/
- break;
-
-/****
- *INT_TO_LWORD
- */
- case function_int_to_lword :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_lword*/
- break;
-
-/****
- *INT_TO_UINT
- */
- case function_int_to_uint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_uint*/
- break;
-
-/****
- *INT_TO_LREAL
- */
- case function_int_to_lreal :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_lreal*/
- break;
-
-/****
- *INT_TO_BYTE
- */
- case function_int_to_byte :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_byte*/
- break;
-
-/****
- *INT_TO_USINT
- */
- case function_int_to_usint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_usint*/
- break;
-
-/****
- *INT_TO_ULINT
- */
- case function_int_to_ulint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_ulint*/
- break;
-
-/****
- *INT_TO_BOOL
- */
- case function_int_to_bool :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_bool*/
- break;
-
-/****
- *INT_TO_TIME
- */
- case function_int_to_time :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_int_to_time*/
- break;
-
-/****
- *TRUNC
- */
- case function_trunc :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_trunc*/
- break;
-
-/****
- *BCD_TO_UDINT
- */
- case function_bcd_to_udint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- 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::udint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bcd_to_udint*/
- break;
-
-/****
- *BCD_TO_UINT
- */
- case function_bcd_to_uint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bcd_to_uint*/
- break;
-
-/****
- *BCD_TO_ULINT
- */
- case function_bcd_to_ulint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bcd_to_ulint*/
- break;
-
-/****
- *BCD_TO_USINT
- */
- case function_bcd_to_usint :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_bcd_to_usint*/
- break;
-
-/****
- *UDINT_TO_BCD
- */
- case function_udint_to_bcd :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_udint_to_bcd*/
- break;
-
-/****
- *UINT_TO_BCD
- */
- case function_uint_to_bcd :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_uint_to_bcd*/
- break;
-
-/****
- *USINT_TO_BCD
- */
- case function_usint_to_bcd :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_usint_to_bcd*/
- break;
-
-/****
- *ULINT_TO_BCD
- */
- case function_ulint_to_bcd :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ulint_to_bcd*/
- break;
-
-/****
- *DATE_AND_TIME_TO_TIME_OF_DAY
- */
- case function_date_and_time_to_time_of_day :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_date_and_time_to_time_of_day*/
- break;
-
-/****
- *DATE_AND_TIME_TO_DATE
- */
- case function_date_and_time_to_date :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_date_and_time_to_date*/
- break;
-
-/****
- *ABS
- */
- case function_abs :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_num_type(IN_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_abs*/
- break;
-
-/****
- *SQRT
- */
- case function_sqrt :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_sqrt*/
- break;
-
-/****
- *LN
- */
- case function_ln :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_ln*/
- break;
-
-/****
- *LOG
- */
- case function_log :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_log*/
- break;
-
-/****
- *EXP
- */
- case function_exp :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_exp*/
- break;
-
-/****
- *SIN
- */
- case function_sin :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_sin*/
- break;
-
-/****
- *COS
- */
- case function_cos :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_cos*/
- break;
-
-/****
- *TAN
- */
- case function_tan :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_tan*/
- break;
-
-/****
- *ASIN
- */
- case function_asin :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_asin*/
- break;
-
-/****
- *ACOS
- */
- case function_acos :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_acos*/
- break;
-
-/****
- *ATAN
- */
- case function_atan :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_atan*/
- break;
-
-/****
- *ADD
- */
- case function_add :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN1_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
- {
-
- symbol_c * return_type_symbol = last_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_add*/
- break;
-
-/****
- *MUL
- */
- case function_mul :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN1_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
- {
-
- symbol_c * return_type_symbol = last_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_mul*/
- break;
-
-/****
- *SUB
- */
- case function_sub :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN1_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
- {
-
- symbol_c * return_type_symbol = last_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_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::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_sub*/
- break;
-
-/****
- *DIV
- */
- case function_div :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN1_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
- {
-
- symbol_c * return_type_symbol = last_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_div*/
- break;
-
-/****
- *MOD
- */
- case function_mod :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN1_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
- {
-
- symbol_c * return_type_symbol = last_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_mod*/
- break;
-
-/****
- *EXPT
- */
- case function_expt :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN1_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN1_type_symbol == NULL || search_expression_type->is_real_type(IN1_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
- {
-
- symbol_c * return_type_symbol = last_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_expt*/
- break;
-
-/****
- *MOVE
- */
- case function_move :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
-
- {
-
- symbol_c * return_type_symbol = last_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_move*/
- break;
-
-/****
- *SHL
- */
- case function_shl :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_binary_type(IN_type_symbol))
- {
-
- {
- identifier_c param_name("N");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *N_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *N_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (N_param_value == NULL)
- N_param_value = function_call_param_iterator.next();
- if (N_param_value != NULL) {
- N_type_symbol = search_expression_type->get_type(N_param_value);
- last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
- }
-
- if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_shl*/
- break;
-
-/****
- *SHR
- */
- case function_shr :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_binary_type(IN_type_symbol))
- {
-
- {
- identifier_c param_name("N");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *N_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *N_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (N_param_value == NULL)
- N_param_value = function_call_param_iterator.next();
- if (N_param_value != NULL) {
- N_type_symbol = search_expression_type->get_type(N_param_value);
- last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
- }
-
- if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_shr*/
- break;
-
-/****
- *ROR
- */
- case function_ror :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_nbinary_type(IN_type_symbol))
- {
-
- {
- identifier_c param_name("N");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *N_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *N_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (N_param_value == NULL)
- N_param_value = function_call_param_iterator.next();
- if (N_param_value != NULL) {
- N_type_symbol = search_expression_type->get_type(N_param_value);
- last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
- }
-
- if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_ror*/
- break;
-
-/****
- *ROL
- */
- case function_rol :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_nbinary_type(IN_type_symbol))
- {
-
- {
- identifier_c param_name("N");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *N_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *N_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (N_param_value == NULL)
- N_param_value = function_call_param_iterator.next();
- if (N_param_value != NULL) {
- N_type_symbol = search_expression_type->get_type(N_param_value);
- last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
- }
-
- if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_rol*/
- break;
-
-/****
- *AND
- */
- case function_and :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN1_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN1_type_symbol == NULL || search_expression_type->is_binary_type(IN1_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol))
- {
-
- symbol_c * return_type_symbol = last_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_and*/
- break;
-
-/****
- *OR
- */
- case function_or :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN1_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN1_type_symbol == NULL || search_expression_type->is_binary_type(IN1_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol))
- {
-
- symbol_c * return_type_symbol = last_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_or*/
- break;
-
-/****
- *XOR
- */
- case function_xor :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN1_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN1_type_symbol == NULL || search_expression_type->is_binary_type(IN1_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol))
- {
-
- symbol_c * return_type_symbol = last_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_xor*/
- break;
-
-/****
- *NOT
- */
- case function_not :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_binary_type(IN_type_symbol))
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_not*/
- break;
-
-/****
- *SEL
- */
- case function_sel :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *G_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(G_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN0");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN0_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN0_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN0_param_value == NULL)
- IN0_param_value = function_call_param_iterator.next();
- if (IN0_param_value != NULL) {
- IN0_type_symbol = search_expression_type->get_type(IN0_param_value);
- last_type_symbol = last_type_symbol && IN0_type_symbol && search_expression_type->is_same_type(IN0_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN0_type_symbol, last_type_symbol) : IN0_type_symbol ;
- }
-
-
- {
-
- {
- identifier_c param_name("IN1");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN1_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN1_param_value == NULL)
- IN1_param_value = function_call_param_iterator.next();
- if (IN1_param_value != NULL) {
- IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
- last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
- }
-
-
- {
-
- symbol_c * return_type_symbol = last_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_sel*/
- break;
-
-/****
- *MAX
- */
- case function_max :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN1_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
-
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
-
- {
-
- symbol_c * return_type_symbol = last_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_max*/
- break;
-
-/****
- *MIN
- */
- case function_min :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN1_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
-
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
-
- {
-
- symbol_c * return_type_symbol = last_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_min*/
- break;
-
-/****
- *LIMIT
- */
- case function_limit :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *MN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
-
- {
-
- {
- 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(¶m_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 ;
- }
-
-
- {
-
- {
- identifier_c param_name("MX");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *MX_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *MX_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (MX_param_value == NULL)
- MX_param_value = function_call_param_iterator.next();
- if (MX_param_value != NULL) {
- MX_type_symbol = search_expression_type->get_type(MX_param_value);
- last_type_symbol = last_type_symbol && MX_type_symbol && search_expression_type->is_same_type(MX_type_symbol, last_type_symbol) ? search_expression_type->common_type(MX_type_symbol, last_type_symbol) : MX_type_symbol ;
- }
-
-
- {
-
- symbol_c * return_type_symbol = IN_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_limit*/
- break;
-
-/****
- *MUX
- */
- case function_mux :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *K_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(K_type_symbol == NULL || search_expression_type->is_integer_type(K_type_symbol))
- {
-
- {
- identifier_c param_name("IN0");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN0_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN0_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN0_param_value == NULL)
- IN0_param_value = function_call_param_iterator.next();
- if (IN0_param_value != NULL) {
- IN0_type_symbol = search_expression_type->get_type(IN0_param_value);
- last_type_symbol = last_type_symbol && IN0_type_symbol && search_expression_type->is_same_type(IN0_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN0_type_symbol, last_type_symbol) : IN0_type_symbol ;
- }
-
-
- {
-
- {
- identifier_c param_name("IN1");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN1_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN1_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN1_param_value == NULL)
- IN1_param_value = function_call_param_iterator.next();
- if (IN1_param_value != NULL) {
- IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
- last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
- }
-
-
- {
-
- symbol_c * return_type_symbol = last_type_symbol;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_mux*/
- break;
-
-/****
- *GT
- */
- case function_gt :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN1_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
-
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
-
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_gt*/
- break;
-
-/****
- *GE
- */
- case function_ge :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN1_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
-
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
-
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_ge*/
- break;
-
-/****
- *EQ
- */
- case function_eq :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN1_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
-
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
-
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_eq*/
- break;
-
-/****
- *LT
- */
- case function_lt :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN1_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
-
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
-
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_lt*/
- break;
-
-/****
- *LE
- */
- case function_le :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN1_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
-
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
-
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_le*/
- break;
-
-/****
- *NE
- */
- case function_ne :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN1_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
-
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
-
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_ne*/
- break;
-
-/****
- *LEN
- */
- case function_len :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }/*function_len*/
- break;
-
-/****
- *LEFT
- */
- case function_left :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("L");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *L_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *L_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (L_param_value == NULL)
- L_param_value = function_call_param_iterator.next();
- if (L_param_value != NULL) {
- L_type_symbol = search_expression_type->get_type(L_param_value);
- last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
- }
-
- if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_left*/
- break;
-
-/****
- *RIGHT
- */
- case function_right :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("L");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *L_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *L_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (L_param_value == NULL)
- L_param_value = function_call_param_iterator.next();
- if (L_param_value != NULL) {
- L_type_symbol = search_expression_type->get_type(L_param_value);
- last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
- }
-
- if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_right*/
- break;
-
-/****
- *MID
- */
- case function_mid :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("L");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *L_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *L_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (L_param_value == NULL)
- L_param_value = function_call_param_iterator.next();
- if (L_param_value != NULL) {
- L_type_symbol = search_expression_type->get_type(L_param_value);
- last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
- }
-
- if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol))
- {
-
- {
- identifier_c param_name("P");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *P_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *P_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (P_param_value == NULL)
- P_param_value = function_call_param_iterator.next();
- if (P_param_value != NULL) {
- P_type_symbol = search_expression_type->get_type(P_param_value);
- last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
- }
-
- if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_mid*/
- break;
-
-/****
- *CONCAT
- */
- case function_concat :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN1_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
- if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_concat*/
- break;
-
-/****
- *INSERT
- */
- case function_insert :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN1_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("P");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *P_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *P_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (P_param_value == NULL)
- P_param_value = function_call_param_iterator.next();
- if (P_param_value != NULL) {
- P_type_symbol = search_expression_type->get_type(P_param_value);
- last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
- }
-
- if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_insert*/
- break;
-
-/****
- *DELETE
- */
- case function_delete :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("L");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *L_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *L_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (L_param_value == NULL)
- L_param_value = function_call_param_iterator.next();
- if (L_param_value != NULL) {
- L_type_symbol = search_expression_type->get_type(L_param_value);
- last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
- }
-
- if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol))
- {
-
- {
- identifier_c param_name("P");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *P_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *P_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (P_param_value == NULL)
- P_param_value = function_call_param_iterator.next();
- if (P_param_value != NULL) {
- P_type_symbol = search_expression_type->get_type(P_param_value);
- last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
- }
-
- if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_delete*/
- break;
-
-/****
- *REPLACE
- */
- case function_replace :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN1_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("L");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *L_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *L_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (L_param_value == NULL)
- L_param_value = function_call_param_iterator.next();
- if (L_param_value != NULL) {
- L_type_symbol = search_expression_type->get_type(L_param_value);
- last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
- }
-
- if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol))
- {
-
- {
- identifier_c param_name("P");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *P_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *P_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (P_param_value == NULL)
- P_param_value = function_call_param_iterator.next();
- if (P_param_value != NULL) {
- P_type_symbol = search_expression_type->get_type(P_param_value);
- last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
- }
-
- if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_replace*/
- break;
-
-/****
- *FIND
- */
- case function_find :
- {
- symbol_c *last_type_symbol = NULL;
-
- {
- symbol_c *IN1_type_symbol = param_data_type;
- last_type_symbol = param_data_type;
-
- if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- {
- identifier_c param_name("IN2");
- /* Get the value from a foo(<param_name> = <param_value>) style call */
- symbol_c *IN2_param_value = function_call_param_iterator.search(¶m_name);
- symbol_c *IN2_type_symbol = NULL;
-
- /* Get the value from a foo(<param_value>) style call */
- if (IN2_param_value == NULL)
- IN2_param_value = function_call_param_iterator.next();
- if (IN2_param_value != NULL) {
- IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
- last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
- }
-
- if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
- {
-
- symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
- return return_type_symbol;
-
- }
-
-
- ERROR;
- }
-
- }
-
-
- ERROR;
- }
-
- }/*function_find*/
- break;
-
- case function_none :
- ERROR;
- }
- return NULL;
-}
--- a/stage4/generate_c/search_var_instance_decl.cc Sat May 30 16:42:41 2009 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,507 +0,0 @@
-/*
- * (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 variable instance, including
- * function block instances.
- * A reference to the relevant variable declaration is returned.
- * The variable instance may NOT be a member of a structure of a memeber
- * of a structure of an element of an array of ...
- *
- * example:
- * window.points[1].coordinate.x
- * window.points[1].colour
- * etc... ARE NOT ALLOWED!
- *
- * This class must only be passed the name of the variable that will appear
- * in the variable declaration. In the above examples, this would be
- * 'window' !!
- *
- *
- * If you need to pass a complete name of a variable instance (such as
- * 'window.points[1].coordinate.x') use the search_varfb_instance_type_c instead!
- */
-/* Note that current_type_decl that this class returns may reference the
- * name of a type, or the type declaration itself!
- * For an example of the first, consider a variable declared as ...
- * x : AAA;
- * where the AAA type is previously declared as whatever.
- * For an example of the second, consider a variable declared as ...
- * x : array of int [10]; ----> is allowed
- *
- * If it is the first, we will return a reference to the name, if the second
- * we return a reference to the declaration!!
- */
-class search_var_instance_decl_c: public search_visitor_c {
-
- private:
- symbol_c *search_scope;
- symbol_c *search_name;
- symbol_c *current_type_decl;
-
- /* variable used to store the type of variable currently being processed... */
- /* Will contain a single value of generate_c_vardecl_c::XXXX_vt */
- unsigned int current_vartype;
-
- public:
- search_var_instance_decl_c(symbol_c *search_scope) {
- this->current_vartype = none_vt;
- this->search_scope = search_scope;
- this->search_name = NULL;
- this->current_type_decl = NULL;
- }
-
- symbol_c *get_decl(symbol_c *variable_instance_name) {
- this->search_name = variable_instance_name;
- return (symbol_c *)search_scope->accept(*this);
- }
-
- unsigned int get_vartype() {
- return current_vartype;
- }
-
- public:
-
- /* the types of variables that need to be processed... */
- static const unsigned int none_vt = 0x0000;
- static const unsigned int input_vt = 0x0001; // VAR_INPUT
- static const unsigned int output_vt = 0x0002; // VAR_OUTPUT
- static const unsigned int inoutput_vt = 0x0004; // VAR_IN_OUT
- static const unsigned int private_vt = 0x0008; // VAR
- static const unsigned int temp_vt = 0x0010; // VAR_TEMP
- static const unsigned int external_vt = 0x0020; // VAR_EXTERNAL
- static const unsigned int global_vt = 0x0040; // VAR_GLOBAL
- static const unsigned int located_vt = 0x0080; // VAR <var_name> AT <location>
-
-
-/***************************/
-/* B 0 - Programming Model */
-/***************************/
- void *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 */
-/******************************************/
-/* edge -> The F_EDGE or R_EDGE directive */
-// SYM_REF2(edge_declaration_c, edge, var1_list)
-// TODO
-
- void *visit(input_declarations_c *symbol) {
- current_vartype = input_vt;
- void *res = symbol->input_declaration_list->accept(*this);
- if (res == NULL) {
- current_vartype = none_vt;
- }
- return res;
- }
-
-/* VAR_OUTPUT [RETAIN | NON_RETAIN] var_init_decl_list END_VAR */
-/* option -> may be NULL ! */
- void *visit(output_declarations_c *symbol) {
- current_vartype = output_vt;
- void *res = symbol->var_init_decl_list->accept(*this);
- if (res == NULL) {
- current_vartype = none_vt;
- }
- return res;
- }
-
-/* VAR_IN_OUT var_declaration_list END_VAR */
- void *visit(input_output_declarations_c *symbol) {
- current_vartype = inoutput_vt;
- void *res = symbol->var_declaration_list->accept(*this);
- if (res == NULL) {
- current_vartype = none_vt;
- }
- return res;
- }
-
-/* VAR [CONSTANT] var_init_decl_list END_VAR */
-/* option -> may be NULL ! */
-/* helper symbol for input_declarations */
- void *visit(var_declarations_c *symbol) {
- current_vartype = private_vt;
- void *res = symbol->var_init_decl_list->accept(*this);
- if (res == NULL) {
- current_vartype = none_vt;
- }
- return res;
- }
-
-/* VAR RETAIN var_init_decl_list END_VAR */
- void *visit(retentive_var_declarations_c *symbol) {
- current_vartype = private_vt;
- void *res = symbol->var_init_decl_list->accept(*this);
- if (res == NULL) {
- current_vartype = none_vt;
- }
- return res;
- }
-
-/* 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)
- void *visit(located_var_declarations_c *symbol) {
- current_vartype = located_vt;
- void *res = symbol->located_var_decl_list->accept(*this);
- if (res == NULL) {
- current_vartype = none_vt;
- }
- return res;
- }
-
-/*| 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) {
- current_vartype = external_vt;
- void *res = symbol->external_declaration_list->accept(*this);
- if (res == NULL) {
- current_vartype = none_vt;
- }
- return res;
- }
-
-/*| 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)
- void *visit(global_var_declarations_c *symbol) {
- current_vartype = global_vt;
- void *res = symbol->global_var_decl_list->accept(*this);
- if (res == NULL) {
- current_vartype = none_vt;
- }
- return res;
- }
-
-/* var1_list is one of the following...
- * simple_spec_init_c *
- * subrange_spec_init_c *
- * enumerated_spec_init_c *
- */
-// SYM_REF2(var1_init_decl_c, var1_list, spec_init)
- void *visit(var1_init_decl_c *symbol) {
- current_type_decl = symbol->spec_init;
- return symbol->var1_list->accept(*this);
- }
-
-/* var1_list ',' variable_name */
-// SYM_LIST(var1_list_c)
- void *visit(var1_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_type_decl should be != NULL */
- return current_type_decl;
- }
- return NULL;
- }
-
-/* name_list ':' function_block_type_name ASSIGN structure_initialization */
-/* structure_initialization -> may be NULL ! */
- void *visit(fb_name_decl_c *symbol) {
- current_type_decl = symbol->function_block_type_name;
- return symbol->fb_name_list->accept(*this);
- }
-
-/* name_list ',' fb_name */
- void *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_type_decl;
- }
- return NULL;
- }
-
-/* 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) {
- current_type_decl = symbol->array_spec_init;
- return symbol->var1_list->accept(*this);
- }
-
-/* var1_list ':' initialized_structure */
-// SYM_REF2(structured_var_init_decl_c, var1_list, initialized_structure)
- void *visit(structured_var_init_decl_c *symbol) {
- current_type_decl = symbol->initialized_structure;
- return symbol->var1_list->accept(*this);
- }
-
-/* var1_list ':' array_specification */
-// SYM_REF2(array_var_declaration_c, var1_list, array_specification)
- void *visit(array_var_declaration_c *symbol) {
- current_type_decl = symbol->array_specification;
- return symbol->var1_list->accept(*this);
- }
-
-/* var1_list ':' structure_type_name */
-// SYM_REF2(structured_var_declaration_c, var1_list, structure_type_name)
- void *visit(structured_var_declaration_c *symbol) {
- current_type_decl = symbol->structure_type_name;
- return symbol->var1_list->accept(*this);
- }
-
-/* [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)
-// TODO!!
-
-/* 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 (compare_identifiers(symbol->global_var_name, search_name) == 0)
- return symbol->specification;
- return NULL;
- }
-
-/*| 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)
- void *visit(global_var_decl_c *symbol) {
- if (symbol->type_specification != NULL) {
- current_type_decl = symbol->type_specification;
- return symbol->global_var_spec->accept(*this);
- }
- else
- return NULL;
- }
-
-/*| global_var_name location */
-//SYM_REF2(global_var_spec_c, global_var_name, location)
- void *visit(global_var_spec_c *symbol) {
- if (symbol->global_var_name != NULL && compare_identifiers(symbol->global_var_name, search_name) == 0)
- return current_type_decl;
- else
- return symbol->location->accept(*this);
- }
-
-/*| global_var_list ',' global_var_name */
-//SYM_LIST(global_var_list_c)
- void *visit(global_var_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_type_decl should be != NULL */
- return current_type_decl;
- }
- return NULL;
- }
-
-/* [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)
- void *visit(located_var_decl_c *symbol) {
- if (symbol->variable_name != NULL && compare_identifiers(symbol->variable_name, search_name) == 0)
- return symbol->located_var_spec_init;
- else {
- current_type_decl = symbol->located_var_spec_init;
- return symbol->location->accept(*this);
- }
- }
-
-/*| 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)
-// TODO!!
-
-/* AT direct_variable */
-// SYM_REF2(location_c, direct_variable, unused)
- void *visit(location_c *symbol) {
- if (compare_identifiers(symbol->direct_variable, search_name) == 0)
- return current_type_decl;
- else
- return NULL;
- }
-
-/*| global_var_list ',' global_var_name */
-// SYM_LIST(global_var_list_c)
-// TODO!!
-
-/* var1_list ':' single_byte_string_spec */
-// SYM_REF2(single_byte_string_var_declaration_c, var1_list, single_byte_string_spec)
- void *visit(single_byte_string_var_declaration_c *symbol) {
- current_type_decl = symbol->single_byte_string_spec;
- return symbol->var1_list->accept(*this);
- }
-
-/* 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)
-// TODO!!
-
-/* var1_list ':' double_byte_string_spec */
-// SYM_REF2(double_byte_string_var_declaration_c, var1_list, double_byte_string_spec)
- void *visit(double_byte_string_var_declaration_c *symbol) {
- current_type_decl = symbol->double_byte_string_spec;
- return symbol->var1_list->accept(*this);
- }
-
-/* 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)
-// TODO!!
-
-/* variable_name incompl_location ':' var_spec */
-// SYM_REF4(incompl_located_var_decl_c, variable_name, incompl_location, var_spec, unused)
-// TODO!!
-
-/* AT incompl_location_token */
-// SYM_TOKEN(incompl_location_c)
-// TODO!!
-
-
-/**************************************/
-/* B.1.5 - Program organization units */
-/**************************************/
-/***********************/
-/* B 1.5.1 - Functions */
-/***********************/
-// SYM_REF4(function_declaration_c, derived_function_name, type_name, var_declarations_list, function_body)
- void *visit(function_declaration_c *symbol) {
- /* functions have a variable named after themselves, to store
- * the variable that will be returned!!
- */
- if (compare_identifiers(symbol->derived_function_name, search_name) == 0)
- return symbol->type_name;
-
- /* 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 *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 *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);
- }
-
-
-/********************************/
-/* 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)
-*/
- void *visit(configuration_declaration_c *symbol) {
- /* no need to search through all the configuration, so we only
- * visit the global variable declarations...!
- */
- if (symbol->global_var_declarations != NULL)
- return symbol->global_var_declarations->accept(*this);
- else
- return NULL;
- }
-
-/*
-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)
- void *visit(resource_declaration_c *symbol) {
- /* no need to search through all the resource, so we only
- * visit the global variable declarations...!
- */
- if (symbol->global_var_declarations != NULL)
- return symbol->global_var_declarations->accept(*this);
- else
- return NULL;
- }
-
-/* task_configuration_list program_configuration_list */
-// SYM_REF2(single_resource_declaration_c, task_configuration_list, program_configuration_list)
- void *visit(single_resource_declaration_c *symbol) {
- /* no need to search through all the resource,
- * and there is no global variable declarations...!
- */
- return NULL;
- }
-
-#if 0
-/*********************/
-/* B 1.4 - Variables */
-/*********************/
-SYM_REF2(symbolic_variable_c, var_name, unused)
-
-/********************************************/
-/* B.1.4.1 Directly Represented Variables */
-/********************************************/
-SYM_TOKEN(direct_variable_c)
-
-/*************************************/
-/* B.1.4.2 Multi-element Variables */
-/*************************************/
-/* subscripted_variable '[' subscript_list ']' */
-SYM_REF2(array_variable_c, subscripted_variable, subscript_list)
-
-/* subscript_list ',' subscript */
-SYM_LIST(subscript_list_c)
-
-/* 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)
-
-
-#endif
-};
-
--- a/stage4/generate_c/search_varfb_instance_type.cc Sat May 30 16:42:41 2009 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,323 +0,0 @@
-/*
- * (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 variable.
- * The variable may be a simple variable, a function block instance, a
- * struture element within a data structured type (a struct or a fb), or
- * an array element.
- * A mixture of array element of a structure element of a structure element
- * of a .... is also suported!
- *
- * A reference to the relevant base type __definition__ is returned.
- * This means that if we find that the variable is of type MY_INT,
- * which was previously declared to be
- * TYPE MY_INT: INT := 9;
- * this class wil return INT, and __not__ MY_INT !!
- *
- *
- * example:
- * window.points[1].coordinate.x
- * window.points[1].colour
- * etc... ARE ALLOWED!
- *
- * This class must be passed the scope within which the
- * variable was declared, and the variable name...
- */
-class search_varfb_instance_type_c: public search_base_type_c {
- private:
- search_var_instance_decl_c search_var_instance_decl;
- decompose_var_instance_name_c *decompose_var_instance_name;
- symbol_c *current_structelement_name;
- bool search_base_type;
-
- public:
- search_varfb_instance_type_c(symbol_c *search_scope): search_var_instance_decl(search_scope) {
- this->decompose_var_instance_name = NULL;
- this->current_structelement_name = NULL;
- this->search_base_type = false;
- }
-
- symbol_c *get_type(symbol_c *variable_name, bool base_type = true) {
- this->current_structelement_name = NULL;
- this->decompose_var_instance_name = new decompose_var_instance_name_c(variable_name);
- this->search_base_type = base_type;
- if (NULL == decompose_var_instance_name) ERROR;
-
- /* find the part of the variable name that will appear in the
- * variable declaration, for e.g., in window.point.x, this would be
- * window!
- */
- symbol_c *var_name_part = decompose_var_instance_name->next_part();
- if (NULL == var_name_part) ERROR;
-
- /* Now we try to find the variable instance declaration, to determine its type... */
- symbol_c *var_decl = search_var_instance_decl.get_decl(var_name_part);
- if (NULL == var_decl) {
- /* variable instance declaration not found! */
- ERROR;
- }
-
- /* if it is a struct or function block, we must search the type
- * of the struct or function block member.
- * This is done by this class visiting the var_decl.
- * This class, while visiting, will recursively call
- * decompose_var_instance_name->get_next() when and if required...
- */
- symbol_c *res = (symbol_c *)var_decl->accept(*this);
- if (NULL == res) ERROR;
-
- /* make sure that we have decomposed all strcuture elements of the variable name */
- symbol_c *var_name = decompose_var_instance_name->next_part();
- if (NULL != var_name) ERROR;
-
- return res;
- }
-
- unsigned int get_vartype(symbol_c *variable_name) {
- this->current_structelement_name = NULL;
- this->decompose_var_instance_name = new decompose_var_instance_name_c(variable_name);
- if (NULL == decompose_var_instance_name) ERROR;
-
- /* find the part of the variable name that will appear in the
- * variable declaration, for e.g., in window.point.x, this would be
- * window!
- */
- symbol_c *var_name_part = decompose_var_instance_name->next_part();
- if (NULL == var_name_part) ERROR;
-
- /* Now we try to find the variable instance declaration, to determine its type... */
- symbol_c *var_decl = search_var_instance_decl.get_decl(var_name_part);
- if (NULL == var_decl) {
- /* variable instance declaration not found! */
- return 0;
- }
-
- /* if it is a struct or function block, we must search the type
- * of the struct or function block member.
- * This is done by this class visiting the var_decl.
- * This class, while visiting, will recursively call
- * decompose_var_instance_name->get_next() when and if required...
- */
- unsigned int res = search_var_instance_decl.get_vartype();
-
- /* make sure that we have decomposed all strcuture elements of the variable name */
- symbol_c *var_name = decompose_var_instance_name->next_part();
- if (NULL != var_name) ERROR;
-
- return res;
- }
-
- private:
- /* a helper function... */
- void *visit_list(list_c *list) {
- if (NULL == current_structelement_name) ERROR;
-
- for(int i = 0; i < list->n; i++) {
- void *res = list->elements[i]->accept(*this);
- if (res != NULL)
- return res;
- }
- /* not found! */
- return NULL;
- }
-
- /* a helper function... */
- void *base_type(symbol_c *symbol) {
- search_base_type_c search_base_type;
- return symbol->accept(search_base_type);
- }
-
-
- private:
- /* We override the base class' visitor to identifier_c.
- * This is so because the base class does not consider a function block
- * to be a type, unlike this class that allows a variable instance
- * of a function block type...
- */
- void *visit(identifier_c *type_name) {
- /* look up the type declaration... */
- symbol_c *fb_decl = function_block_type_symtable.find_value(type_name);
- if (fb_decl != function_block_type_symtable.end_value())
- /* Type declaration found!! */
- return fb_decl->accept(*this);
-
- /* No. It is not a function block, so we let
- * the base class take care of it...
- */
- if (this->search_base_type)
- return search_base_type_c::visit(type_name);
- else
- return type_name;
- }
-
-/********************************/
-/* B 1.3.3 - Derived data types */
-/********************************/
-
-/* identifier ':' array_spec_init */
- void *visit(array_type_declaration_c *symbol) {
- return symbol->array_spec_init->accept(*this);
- }
-
-/* array_specification [ASSIGN array_initialization} */
-/* array_initialization may be NULL ! */
- void *visit(array_spec_init_c *symbol) {
- symbol_c *var_name = decompose_var_instance_name->next_part();
- if (NULL != var_name)
- current_structelement_name = var_name;
- return symbol->array_specification->accept(*this);
- }
-
-/* ARRAY '[' array_subrange_list ']' OF non_generic_type_name */
- void *visit(array_specification_c *symbol) {
- symbol_c *var_name = decompose_var_instance_name->next_part();
- if (NULL != var_name)
- current_structelement_name = var_name;
- return symbol->non_generic_type_name->accept(*this);
- }
-
-/* structure_type_name ':' structure_specification */
- void *visit(structure_type_declaration_c *symbol) {
- return symbol->structure_specification->accept(*this);
- /* NOTE: structure_specification will point to either a
- * initialized_structure_c
- * OR A
- * structure_element_declaration_list_c
- */
- }
-
-/* structure_type_name ASSIGN structure_initialization */
-/* structure_initialization may be NULL ! */
-// SYM_REF2(initialized_structure_c, structure_type_name, structure_initialization)
- void *visit(initialized_structure_c *symbol) {
- /* make sure that we have decomposed all strcuture elements of the variable name */
- symbol_c *var_name = decompose_var_instance_name->next_part();
- if (NULL == var_name) {
- /* this is it... !
- * No need to look any further...
- */
- /* NOTE: we could simply do a
- * return (void *)symbol;
- * nevertheless, note that this search_varfb_instance_type_c
- * class inherits from the search_base_type_c class,
- * which means that it will usually return the base type,
- * and not the derived type (*). If we are to be consistent,
- * we should guarantee that we always return the base type.
- * To do this we could use
- * return (void *)symbol->accept(*this);
- * since this class inherits from the search_base_type_c.
- * However, in this case we don't want it to follow
- * the structs as this search_varfb_instance_type_c does.
- * We therefore have to create a new search_base_type_c
- * instance to search through this type without going
- * through the structs...
- */
- return base_type(symbol->structure_type_name);
- }
-
- /* now search the structure declaration */
- current_structelement_name = var_name;
- /* recursively find out the data type of var_name... */
- 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 *visit(structure_element_declaration_list_c *symbol) {
- return visit_list(symbol);
- }
-
-/* structure_element_name ':' spec_init */
- void *visit(structure_element_declaration_c *symbol) {
- if (NULL == current_structelement_name) ERROR;
-
- if (compare_identifiers(symbol->structure_element_name, current_structelement_name) == 0)
- return symbol->spec_init->accept(*this);
-
- return NULL;
- }
-
-/* 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) {ERROR; return NULL;} /* should never get called... */
-/* structure_element_name ASSIGN value */
- void *visit(structure_element_initialization_c *symbol) {ERROR; return NULL;} /* should never get called... */
-
-
-
-/**************************************/
-/* B.1.5 - Program organization units */
-/**************************************/
-/*****************************/
-/* B 1.5.2 - Function Blocks */
-/*****************************/
-/* 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) {
- /* make sure that we have decomposed all strcuture elements of the variable name */
-
- symbol_c *var_name = decompose_var_instance_name->next_part();
- if (NULL == var_name) {
- /* this is it... !
- * No need to look any further...
- * Note also that, unlike for the struct types, a function block may
- * not be defined based on another (i.e. no inheritance is allowed),
- * so this function block is already the most base type.
- * We simply return it.
- */
- return (void *)symbol;
- }
-
- /* now search the function block declaration for the variable... */
- search_var_instance_decl_c search_decl(symbol);
- symbol_c *var_decl = search_decl.get_decl(var_name);
- if (NULL == var_decl) {
- /* variable instance declaration not found! */
- return NULL;
- }
-
- /* We have found the declaration.
- * Should we look any further?
- */
- var_name = decompose_var_instance_name->next_part();
- if (NULL == var_name) {
- /* this is it... ! */
- return base_type(var_decl);
- }
-
- current_structelement_name = var_name;
- /* recursively find out the data type of var_name... */
- return symbol->var_declarations->accept(*this);
- }
-
-};
-
-
-
-
-
--- a/stage4/generate_c/spec_init_separator.cc Sat May 30 16:42:41 2009 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,191 +0,0 @@
-/*
- * (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)
- *
- */
-
-
-/*
- * Seperation of type specification and default value constructs
- * (for e.g. simple_spec_init_c), into a type specificiation part,
- * and a default value part.
- */
-
-
-
-
-//#include <stdio.h> /* required for NULL */
-//#include <string>
-//#include <iostream>
-
-//#include "../../util/symtable.hh"
-
-
-
-
-
-
-
-class spec_init_sperator_c: public null_visitor_c {
- private:
- /* this is a singleton class... */
- static spec_init_sperator_c *class_instance;
- static spec_init_sperator_c *get_class_instance(void) {
- if (NULL == class_instance)
- class_instance = new spec_init_sperator_c();
-
- if (NULL == class_instance)
- ERROR;
-
- return class_instance;
- }
-
- private:
- typedef enum {search_spec, search_init} search_what_t;
- static search_what_t search_what;
-
- public:
- /* the only two public functions... */
- static symbol_c *get_spec(symbol_c *spec_init) {
- search_what = search_spec;
- return (symbol_c *)spec_init->accept(*get_class_instance());
- }
-
- static symbol_c *get_init(symbol_c *spec_init) {
- search_what = search_init;
- return (symbol_c *)spec_init->accept(*get_class_instance());
- }
-
-// private:
- public: /* probably needs to be public so it may be visited... !! */
-
-
-/*******************************************/
-/* B 1.1 - Letters, digits and identifiers */
-/*******************************************/
-// SYM_TOKEN(identifier_c)
-void *visit(identifier_c *symbol) {
- TRACE("spec_init_sperator_c::identifier_c");
- switch (search_what) {
- /* if we ever get called sith a simple identifier_c, then it must be a previously declared type... */
- case search_spec: return symbol;
- case search_init: return NULL;
- }
- ERROR; /* should never occur */
- return NULL;
-}
-
-
-/********************************/
-/* B 1.3.3 - Derived data types */
-/********************************/
-
-/* simple_specification ASSIGN constant */
-void *visit(simple_spec_init_c *symbol) {
- TRACE("spec_init_sperator_c::simple_spec_init_c");
- switch (search_what) {
- case search_spec: return symbol->simple_specification;
- case search_init: return symbol->constant;
- }
- ERROR; /* should never occur */
- return NULL;
-}
-
-/* subrange_specification ASSIGN signed_integer */
-void *visit(subrange_spec_init_c *symbol) {
- TRACE("spec_init_sperator_c::subrange_spec_init_c");
- switch (search_what) {
- case search_spec: return symbol->subrange_specification->accept(*this);
- case search_init: return symbol->signed_integer;
- }
- ERROR; /* should never occur */
- return NULL;
-}
-
-/* integer_type_name '(' subrange')' */
-void *visit(subrange_specification_c *symbol) {
- TRACE("spec_init_sperator_c::subrange_specification_c");
- switch (search_what) {
- case search_spec: return symbol->integer_type_name;
- case search_init: return NULL; /* should never occur */
- }
- ERROR; /* should never occur */
- return NULL;
-}
-
-/* array_specification [ASSIGN array_initialization} */
-/* array_initialization may be NULL ! */
-void *visit(array_spec_init_c *symbol) {
- TRACE("spec_init_sperator_c::array_spec_init_c");
- switch (search_what) {
- case search_spec: return symbol->array_specification;
- case search_init: return symbol->array_initialization;
- }
- return NULL;
-}
-
-/* enumerated_specification ASSIGN enumerated_value */
-void *visit(enumerated_spec_init_c *symbol) {
- TRACE("spec_init_sperator_c::enumerated_spec_init_c");
- switch (search_what) {
- case search_spec: return symbol->enumerated_specification;
- case search_init: return symbol->enumerated_value;
- }
- ERROR; /* should never occur */
- return NULL;
-}
-
-/* structure_type_name ASSIGN structure_initialization */
-/* structure_initialization may be NULL ! */
-//SYM_REF2(initialized_structure_c, structure_type_name, structure_initialization)
-void *visit(initialized_structure_c *symbol) {
- TRACE("spec_init_sperator_c::initialized_structure_c");
- switch (search_what) {
- case search_spec: return symbol->structure_type_name;
- case search_init: return symbol->structure_initialization;
- }
- ERROR; /* should never occur */
- return NULL;
-}
-
-
-/******************************************/
-/* B 1.4.3 - Declaration & Initialisation */
-/******************************************/
-
-/* fb_name_list ':' function_block_type_name ASSIGN structure_initialization */
-/* structure_initialization -> may be NULL ! */
-void *visit(fb_name_decl_c *symbol) {
- TRACE("spec_init_sperator_c::fb_name_decl_c");
- switch (search_what) {
- case search_spec: return symbol->function_block_type_name;
- case search_init: return symbol->structure_initialization;
- }
- ERROR; /* should never occur */
- return NULL;
-}
-
-}; /* class spec_init_sperator_c */
-
-
-
-spec_init_sperator_c *spec_init_sperator_c ::class_instance = NULL;
-spec_init_sperator_c::search_what_t spec_init_sperator_c::search_what;
--- a/stage4/generate_c/type_initial_value.cc Sat May 30 16:42:41 2009 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,386 +0,0 @@
-/*
- * (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 default initial value of a type declaration.
- *
- * This is part of the 4th stage that generates
- * a c++ source program equivalent to the IL and ST
- * code.
- */
-
-
-
-
-//#include <stdio.h> /* required for NULL */
-//#include <string>
-//#include <iostream>
-
-//#include "../../util/symtable.hh"
-
-//#include "generate_c.hh"
-
-
-
-
-
-/* Given a type definition declration, determine its default
- * initial value. Note that types based on other types
- * may have to iterate through each type it is based on
- * to determine the initial value.
- * E.g.
- * TYPE
- * A_t : INT := 10;
- * B_t : A_t := 20;
- * C_t : B_t;
- * D_t : C_t := 40;
- * END_TYPE
- * Where the default initial value for C_t is 20!
- */
-/* NOTE: The main program only needs one instance of
- * this class of object. This class
- * is therefore a singleton.
- */
-class type_initial_value_c : public null_visitor_c {
- private:
- static type_initial_value_c *_instance;
- /* constants for the default values of elementary data types... */
- static real_c *real_0;
- static integer_c *integer_0, *integer_1;
- static boolean_literal_c *bool_0;
- static date_literal_c *date_literal_0;
- static daytime_c *daytime_literal_0;
- static duration_c *time_0;
- static date_c *date_0;
- static time_of_day_c *tod_0;
- static date_and_time_c *dt_0;
- static single_byte_character_string_c *string_0;
- static double_byte_character_string_c *wstring_0;
-
- public:
- static type_initial_value_c *instance(void) {
- if (_instance != NULL)
- return _instance;
-
- _instance = new type_initial_value_c;
-
- real_0 = new real_c("0");
- integer_0 = new integer_c("0");
- integer_1 = new integer_c("1");
- bool_0 = new boolean_literal_c(new bool_type_name_c(),new boolean_false_c());
- /* FIXME: Our current implementation only allows dates from 1970 onwards,
- * but the standard defines the date 0001-01-01 as the default value
- * for the DATE data type. Untill we fix our implementation, we use 1970-01-01
- * as our default value!!
- */
-// date_literal_0 = new date_literal_c(integer_1, integer_1, integer_1);
- date_literal_0 = new date_literal_c(new integer_c("1970"), integer_1, integer_1);
- daytime_literal_0 = new daytime_c(integer_0, integer_0, real_0);
- time_0 = new duration_c(NULL, new seconds_c(integer_0, NULL)); // T#0S
- date_0 = new date_c(date_literal_0); // D#0001-01-01
- tod_0 = new time_of_day_c(daytime_literal_0); // TOD#00:00:00
- dt_0 = new date_and_time_c(date_literal_0, daytime_literal_0); // DT#0001-01-01-00:00:00
- string_0 = new single_byte_character_string_c("''");
- wstring_0 = new double_byte_character_string_c("\"\"");
-
- return _instance;
- }
-
- protected:
- type_initial_value_c(void) {}
-
- public:
- symbol_c *get(identifier_c *type_name) {
- TRACE("type_initial_value_c::get(): called ");
- return (symbol_c *)type_name->accept(*this);
- }
-
-
- private:
- void *handle_type_spec(symbol_c *base_type_name, symbol_c *type_spec_init) {
- if (type_spec_init != NULL)
- return type_spec_init;
- /* no initial value specified, so we return
- * the initial value of the type this type is based on...
- */
- return base_type_name->accept(*this);
- }
-
- public:
- void *visit(identifier_c *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!! */
- /* NOTE: Variables declared out of function block 'data types',
- * for eg: VAR timer: TON; END_VAR
- * do not have a default value, so (TON) will never be found in the
- * type symbol table. This means we cannot simply consider this
- * an error and abort, but must rather return a NULL.
- */
- return NULL;
-
- return type_decl->accept(*this);
- }
-
-/***********************************/
-/* B 1.3.1 - Elementary Data Types */
-/***********************************/
- void *visit(time_type_name_c *symbol) {return (void *)time_0;}
- void *visit(bool_type_name_c *symbol) {return (void *)bool_0;}
- void *visit(sint_type_name_c *symbol) {return (void *)integer_0;}
- void *visit(int_type_name_c *symbol) {return (void *)integer_0;}
- void *visit(dint_type_name_c *symbol) {return (void *)integer_0;}
- void *visit(lint_type_name_c *symbol) {return (void *)integer_0;}
- void *visit(usint_type_name_c *symbol) {return (void *)integer_0;}
- void *visit(uint_type_name_c *symbol) {return (void *)integer_0;}
- void *visit(udint_type_name_c *symbol) {return (void *)integer_0;}
- void *visit(ulint_type_name_c *symbol) {return (void *)integer_0;}
- void *visit(real_type_name_c *symbol) {return (void *)real_0;}
- void *visit(lreal_type_name_c *symbol) {return (void *)real_0;}
- void *visit(date_type_name_c *symbol) {return (void *)date_0;}
- void *visit(tod_type_name_c *symbol) {return (void *)tod_0;}
- void *visit(dt_type_name_c *symbol) {return (void *)dt_0;}
- void *visit(byte_type_name_c *symbol) {return (void *)integer_0;}
- void *visit(word_type_name_c *symbol) {return (void *)integer_0;}
- void *visit(dword_type_name_c *symbol) {return (void *)integer_0;}
- void *visit(lword_type_name_c *symbol) {return (void *)integer_0;}
- void *visit(string_type_name_c *symbol) {return (void *)string_0;}
- void *visit(wstring_type_name_c *symbol) {return (void *)wstring_0;}
-
-/********************************/
-/* B 1.3.3 - Derived data types */
-/********************************/
-/* simple_type_name ':' simple_spec_init */
- void *visit(simple_type_declaration_c *symbol) {
- return symbol->simple_spec_init->accept(*this);
- }
-/* simple_specification ASSIGN constant */
- void *visit(simple_spec_init_c *symbol) {
- return handle_type_spec(symbol->simple_specification, symbol->constant);
- }
-/* subrange_type_name ':' subrange_spec_init */
- void *visit(subrange_type_declaration_c *symbol) {
- return symbol->subrange_spec_init->accept(*this);
- }
-/* subrange_specification ASSIGN signed_integer */
- void *visit(subrange_spec_init_c *symbol) {
- return handle_type_spec(symbol->subrange_specification, symbol->signed_integer);
- }
-/* integer_type_name '(' subrange')' */
- void *visit(subrange_specification_c *symbol) {
- /* if no initial value explicitly given, then use the lowest value of the subrange */
- if (symbol->subrange != NULL)
- return symbol->subrange->accept(*this);
- else
- return symbol->integer_type_name->accept(*this);
- }
-/* signed_integer DOTDOT signed_integer */
- void *visit(subrange_c *symbol) {return symbol->lower_limit;}
-/* enumerated_type_name ':' enumerated_spec_init */
- void *visit(enumerated_type_declaration_c *symbol) {
- return symbol->enumerated_spec_init->accept(*this);
- }
-/* enumerated_specification ASSIGN enumerated_value */
- void *visit(enumerated_spec_init_c *symbol) {
- return handle_type_spec(symbol->enumerated_specification, symbol->enumerated_value);
- }
-/* helper symbol for enumerated_specification->enumerated_spec_init */
-/* enumerated_value_list ',' enumerated_value */
- void *visit(enumerated_value_list_c *symbol) {
- /* if no initial value explicitly given, then use the lowest value of the subrange */
- return (void *)symbol->elements[0];
- }
-/* enumerated_type_name '#' identifier */
-// SYM_REF2(enumerated_value_c, type, value)
- void *visit(enumerated_value_c *symbol) {ERROR; return NULL;}
-/* identifier ':' array_spec_init */
- void *visit(array_type_declaration_c *symbol) {
- return symbol->array_spec_init->accept(*this);
- }
-/* array_specification [ASSIGN array_initialization} */
-/* array_initialization may be NULL ! */
- void *visit(array_spec_init_c *symbol) {
- return handle_type_spec(symbol->array_specification, symbol->array_initialization);
- }
-/* ARRAY '[' array_subrange_list ']' OF non_generic_type_name */
- void *visit(array_specification_c *symbol) {
- //symbol_c *init_value = (symbol_c *)symbol->non_generic_type_name->accept(*this);
-
- /* Now build a array_initial_elements_list_c list, and populate it
- * with 1 element of the array_initial_elements_c class
- */
- /* The array_initial_elements_c will contain a reference to the init_value,
- * and another constant representing the number of elements in the array.
- * In essence, we are building the equivilant of the following ST/IL code:
- * New_array_t : ARRAY [1..30, 51..60] of INT := [40(XXX)];
- * from the user given code
- * New_array_t : ARRAY [1..30, 51..60] of INT;
- * and replacing XXX with the default initial value of INT.
- */
- /* now we need to determine the number of elements in the array... */
- /* Easier said than done, as the array may have a list of subranges, as in the
- * example given above!!
- */
- /* TODO !!!!!*/
- /* For now, just assume an array with 1 element.
- * I (Mario) want to finish off this part of the code before getting boged down
- * in something else...
- */
- // NOTE: We are leaking memory, as the integer will never get free'd!!
- //integer_c *integer = new integer_c("1");
- // NOTE: We are leaking memory, as the array_initial_elements will never get free'd!!
- //array_initial_elements_c *array_initial_elements = new array_initial_elements_c(integer, init_value);
- // NOTE: We are leaking memory, as the array_initial_elements_list will never get free'd!!
- array_initial_elements_list_c *array_initial_elements_list = new array_initial_elements_list_c();
- //array_initial_elements_list->add_element(array_initial_elements);
- return array_initial_elements_list;
- }
-/* helper symbol for array_specification */
-/* array_subrange_list ',' subrange */
- void *visit(array_subrange_list_c *symbol) {ERROR; return NULL;}
-/* 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) {ERROR; return NULL;}
-/* integer '(' [array_initial_element] ')' */
-/* array_initial_element may be NULL ! */
- void *visit(array_initial_elements_c *symbol) {ERROR; return NULL;}
-
-
-
- /* TODO: from this point forward... */
-
-/* structure_type_name ':' structure_specification */
- void *visit(structure_type_declaration_c *symbol) {return NULL;}
-/* structure_type_name ASSIGN structure_initialization */
-/* structure_initialization may be NULL ! */
- void *visit(initialized_structure_c *symbol) {
- return handle_type_spec(symbol->structure_type_name, symbol->structure_initialization);
- }
-/* 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_initialization_list_c *structure_element_initialization_list = new structure_element_initialization_list_c();
- return structure_element_initialization_list;
- }
-/* structure_element_name ':' *_spec_init */
- void *visit(structure_element_declaration_c *symbol) {return NULL;}
-/* 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) {return NULL;}
-/* structure_element_name ASSIGN value */
- void *visit(structure_element_initialization_c *symbol) {return NULL;}
-/* string_type_name ':' elementary_string_type_name string_type_declaration_size string_type_declaration_init */
-/*
- * NOTE:
- * (Summary: Contrary to what is expected, the
- * string_type_declaration_c is not used to store
- * simple string type declarations that do not include
- * size limits.
- * For e.g.:
- * str1_type: STRING := "hello!"
- * will be stored in a simple_type_declaration_c
- * instead of a string_type_declaration_c.
- * The following:
- * str2_type: STRING [64] := "hello!"
- * will be stored in a sring_type_declaration_c
- *
- * Read on for why this is done...
- * End Summary)
- *
- * According to the spec, the valid construct
- * TYPE new_str_type : STRING := "hello!"; END_TYPE
- * has two possible routes to type_declaration...
- *
- * Route 1:
- * type_declaration: single_element_type_declaration
- * single_element_type_declaration: simple_type_declaration
- * simple_type_declaration: identifier ':' simple_spec_init
- * simple_spec_init: simple_specification ASSIGN constant
- * (shift: identifier <- 'new_str_type')
- * simple_specification: elementary_type_name
- * elementary_type_name: STRING
- * (shift: elementary_type_name <- STRING)
- * (reduce: simple_specification <- elementary_type_name)
- * (shift: constant <- "hello!")
- * (reduce: simple_spec_init: simple_specification ASSIGN constant)
- * (reduce: ...)
- *
- *
- * Route 2:
- * type_declaration: string_type_declaration
- * string_type_declaration: identifier ':' elementary_string_type_name string_type_declaration_size string_type_declaration_init
- * (shift: identifier <- 'new_str_type')
- * elementary_string_type_name: STRING
- * (shift: elementary_string_type_name <- STRING)
- * (shift: string_type_declaration_size <- empty )
- * string_type_declaration_init: ASSIGN character_string
- * (shift: character_string <- "hello!")
- * (reduce: string_type_declaration_init <- ASSIGN character_string)
- * (reduce: string_type_declaration <- identifier ':' elementary_string_type_name string_type_declaration_size string_type_declaration_init )
- * (reduce: type_declaration <- string_type_declaration)
- *
- *
- * At first glance it seems that removing route 1 would make
- * the most sense. Unfortunately the construct 'simple_spec_init'
- * shows up multiple times in other rules, so changing this construct
- * would also mean changing all the rules in which it appears.
- * I (Mario) therefore chose to remove route 2 instead. This means
- * that the above declaration gets stored in a
- * simple_type_declaration_c, and not in a string_type_declaration_c
- * as would be expected!
- */
-/* string_type_name ':' elementary_string_type_name string_type_declaration_size string_type_declaration_init */
-#if 0
-SYM_REF4(string_type_declaration_c, string_type_name,
- elementary_string_type_name,
- string_type_declaration_size,
- string_type_declaration_init) /* may be == NULL! */
-#endif
- void *visit(string_type_declaration_c *symbol) {return NULL;}
-};
-
-type_initial_value_c *type_initial_value_c::_instance = NULL;
-real_c *type_initial_value_c::real_0 = NULL;
-integer_c *type_initial_value_c::integer_0 = NULL;
-integer_c *type_initial_value_c::integer_1 = NULL;
-boolean_literal_c *type_initial_value_c::bool_0 = NULL;
-date_literal_c *type_initial_value_c::date_literal_0 = NULL;
-daytime_c *type_initial_value_c::daytime_literal_0 = NULL;
-duration_c *type_initial_value_c::time_0 = NULL;
-date_c *type_initial_value_c::date_0 = NULL;
-time_of_day_c *type_initial_value_c::tod_0 = NULL;
-date_and_time_c *type_initial_value_c::dt_0 = NULL;
-single_byte_character_string_c *type_initial_value_c::string_0 = NULL;
-double_byte_character_string_c *type_initial_value_c::wstring_0 = NULL;
-
-
-
-
-
-