# HG changeset patch
# User etisserant
# Date 1184232272 -7200
# Node ID 873a5b60a7ea4785e9cd1d1a56f729bbf2408703
# Parent e08c65e27557741b0daa91e545aefb0f108541f9
Fixed -I library include path behavior + removed old lib implementation + added generated lib func names to stage 1_2 + added Makefile.Linux
diff -r e08c65e27557 -r 873a5b60a7ea .cdtproject
--- a/.cdtproject Wed Jul 11 09:53:27 2007 +0200
+++ b/.cdtproject Thu Jul 12 11:24:32 2007 +0200
@@ -1,9 +1,9 @@
-
+
+
-
-
@@ -53,5 +53,30 @@
+-
+
+
+make
+
+test
+true
+true
+
+
+make
+
+all
+true
+true
+
+
+make
+
+clean
+false
+true
+
+
+
diff -r e08c65e27557 -r 873a5b60a7ea Makefile
--- a/Makefile Wed Jul 11 09:53:27 2007 +0200
+++ b/Makefile Thu Jul 12 11:24:32 2007 +0200
@@ -1,6 +1,6 @@
# include the system specific Makefile
-#include ../../Makefile.$(shell uname)
-
+include Makefile.$(shell uname)
+
default: all
all: iec2cc iec2iec
@@ -25,18 +25,8 @@
# make something everywhere (ie, in all Makefiles that have that target)
find . -depth -mindepth 2 -maxdepth 2 -name Makefile -printf %h\\n | xargs -i make -C{} $@
-
-
-#get warnings, debugging information and optimization
-CXXFLAGS = -Wall -pedantic -Wpointer-arith -Wwrite-strings
-# CXXFLAGS += -Werror
-CXXFLAGS += -ggdb -O3 -funroll-loops
-# Note: if the optimizer crashes, we'll leave out the -O3 for those files
-
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
diff -r e08c65e27557 -r 873a5b60a7ea Makefile.Linux
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile.Linux Thu Jul 12 11:24:32 2007 +0200
@@ -0,0 +1,15 @@
+
+
+#get warnings, debugging information and optimization
+CFLAGS = -Wall -pedantic -Wpointer-arith -Wwrite-strings
+# CFLAGS += -Werror
+#CFLAGS += -ggdb -O3 -funroll-loops
+CFLAGS += -O3 -funroll-loops
+# Note: if the optimizer crashes, we'll leave out the -O3 for those files
+
+#get warnings, debugging information and optimization
+CXXFLAGS = -Wall -pedantic -Wpointer-arith -Wwrite-strings
+#CXXFLAGS += -ggdb -O3 -funroll-loops
+CXXFLAGS += -O3 -funroll-loops
+
+IECLIBDIR=lib
diff -r e08c65e27557 -r 873a5b60a7ea lib/bcd_to_int.txt
--- a/lib/bcd_to_int.txt Wed Jul 11 09:53:27 2007 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +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)
- *
- *)
-
-(*
- * This is part of the library conatining the functions
- * and function blocks defined in the standard.
- *
- * Conversion from BCD
- * -------------------
- *)
-
-
-
-FUNCTION BYTE_BCD_TO_USINT: USINT
- VAR_INPUT
- BCD : BYTE;
- END_VAR
-
- BYTE_BCD_TO_USINT := BCD MOD 16;
- BCD := BCD / 16;
- BYTE_BCD_TO_USINT := BYTE_BCD_TO_USINT + 10*BCD;
-END_FUNCTION
-
-
-
-
-FUNCTION WORD_BCD_TO_UINT: UINT
- VAR_INPUT
- BCD : WORD;
- END_VAR
-
- WORD_BCD_TO_UINT := BCD MOD 16;
- BCD := BCD / 16;
- WORD_BCD_TO_UINT := WORD_BCD_TO_UINT + 10*(BCD MOD 16);
- BCD := BCD / 16;
- WORD_BCD_TO_UINT := WORD_BCD_TO_UINT + 100*(BCD MOD 16);
- BCD := BCD / 16;
- WORD_BCD_TO_UINT := WORD_BCD_TO_UINT + 1000*BCD;
-END_FUNCTION
-
-
-
-
-FUNCTION DWORD_BCD_TO_UDINT: UDINT
- VAR_INPUT
- BCD : DWORD;
- END_VAR
-
- DWORD_BCD_TO_UDINT := BCD MOD 16;
- BCD := BCD / 16;
- DWORD_BCD_TO_UDINT := DWORD_BCD_TO_UDINT + 10*(BCD MOD 16);
- BCD := BCD / 16;
- DWORD_BCD_TO_UDINT := DWORD_BCD_TO_UDINT + 100*(BCD MOD 16);
- BCD := BCD / 16;
- DWORD_BCD_TO_UDINT := DWORD_BCD_TO_UDINT + 1000*(BCD MOD 16);
- BCD := BCD / 16;
- DWORD_BCD_TO_UDINT := DWORD_BCD_TO_UDINT + 1_0000*(BCD MOD 16);
- BCD := BCD / 16;
- DWORD_BCD_TO_UDINT := DWORD_BCD_TO_UDINT + 10_0000*(BCD MOD 16);
- BCD := BCD / 16;
- DWORD_BCD_TO_UDINT := DWORD_BCD_TO_UDINT + 100_0000*(BCD MOD 16);
- BCD := BCD / 16;
- DWORD_BCD_TO_UDINT := DWORD_BCD_TO_UDINT + 1000_0000*BCD;
-END_FUNCTION
-
-
-
-
-FUNCTION LWORD_BCD_TO_ULINT: ULINT
- VAR_INPUT
- BCD : LWORD;
- END_VAR
-
- LWORD_BCD_TO_ULINT := DWORD_BCD_TO_UDINT(BCD MOD (256*256*256*256));
- BCD := BCD / (256*256*256*256);
- LWORD_BCD_TO_ULINT := LWORD_BCD_TO_ULINT + 1_0000_0000*DWORD_BCD_TO_UDINT(BCD);
-END_FUNCTION
diff -r e08c65e27557 -r 873a5b60a7ea lib/iec_std_lib.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/iec_std_lib.h Thu Jul 12 11:24:32 2007 +0200
@@ -0,0 +1,906 @@
+/****
+ * IEC 61131-3 standard function lib
+ */
+
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#include "iec_std_lib_generated.h"
+
+/*****************/
+/* Types defs */
+/*****************/
+
+typedef u_int8_t BOOL;
+
+#define TRUE 1
+#define FALSE 0
+
+typedef int8_t SINT;
+typedef int16_t INT;
+typedef int32_t DINT;
+typedef int64_t LINT;
+
+typedef u_int8_t USINT;
+typedef u_int16_t UINT;
+typedef u_int32_t UDINT;
+typedef u_int64_t ULINT;
+
+typedef u_int8_t BYTE;
+typedef u_int16_t WORD;
+typedef u_int32_t DWORD;
+typedef u_int64_t LWORD;
+
+typedef float REAL;
+typedef double LREAL;
+
+typedef struct timespec TIME;
+typedef struct timespec DATE;
+typedef struct timespec DT;
+typedef struct timespec TOD;
+
+#define __TIME_CMP(t1, t2) (t2.tv_sec == t1.tv_sec ? t2.tv_nsec - t1.tv_nsec : t1.tv_sec - t2.tv_sec)
+
+#define STR_MAX_LEN 40
+typedef int8_t __strlen_t;
+typedef struct {
+ __strlen_t len;
+ u_int8_t body[STR_MAX_LEN];
+} STRING;
+
+#define __STR_CMP(str1, str2) memcmp((char*)&str1.body,(char*)&str2.body, str1.len < str2.len ? str1.len : str2.len)
+
+
+/* TODO
+typedef struct {
+ __strlen_t len;
+ u_int16_t body[STR_MAX_LEN];
+} WSTRING;
+*/
+
+typedef union __IL_DEFVAR_T {
+ BOOL BOOLvar;
+
+ SINT SINTvar;
+ INT INTvar;
+ DINT DINTvar;
+ LINT LINTvar;
+
+ USINT USINTvar;
+ UINT UINTvar;
+ UDINT UDINTvar;
+ ULINT ULINTvar;
+
+ BYTE BYTEvar;
+ WORD WORDvar;
+ DWORD DWORDvar;
+ LWORD LWORDvar;
+
+ REAL REALvar;
+ LREAL LREALvar;
+
+ TIME TIMEvar;
+ TOD TODvar;
+ DT DTvar;
+ DATE DATEvar;
+} __IL_DEFVAR_T;
+
+
+
+
+/*****************/
+/* Misc internal */
+/*****************/
+
+/* function that generates an IEC runtime error */
+void IEC_error(void) {
+ /* TODO... */
+ fprintf(stderr, "IEC 61131-3 runtime error.\n");
+ /*exit(1);*/
+}
+
+
+static inline void __normalize_timespec (struct timespec *ts) {
+ if( ts->tv_nsec < -1000000000 || (( ts->tv_sec > 0 ) && ( ts->tv_nsec < 0 ))){
+ ts->tv_sec--;
+ ts->tv_nsec += 1000000000;
+ }
+ if( ts->tv_nsec > 1000000000 || (( ts->tv_sec < 0 ) && ( ts->tv_nsec > 0 ))){
+ ts->tv_sec++;
+ ts->tv_nsec -= 1000000000;
+ }
+}
+
+static inline struct timespec __time_to_timespec(int sign, double mseconds, double seconds, double minutes, double hours, double days) {
+ struct timespec ts;
+
+ /* sign is 1 for positive values, -1 for negative time... */
+ long double total_sec = ((days*24 + hours)*60 + minutes)*60 + seconds + mseconds/1e3;
+ if (sign >= 0) sign = 1; else sign = -1;
+ ts.tv_sec = sign * (long int)total_sec;
+ ts.tv_nsec = sign * (long int)((total_sec - ts.tv_sec)*1e9);
+
+ return ts;
+}
+
+
+static inline struct timespec __tod_to_timespec(double seconds, double minutes, double hours) {
+ struct timespec ts;
+
+ long double total_sec = (hours*60 + minutes)*60 + seconds;
+ ts.tv_sec = (long int)total_sec;
+ ts.tv_nsec = (long int)((total_sec - ts.tv_sec)*1e9);
+
+ return ts;
+}
+
+static inline struct timespec __date_to_timespec(int day, int month, int year) {
+ struct timespec ts;
+ struct tm broken_down_time;
+
+ broken_down_time.tm_sec = 0;
+ broken_down_time.tm_min = 0;
+ broken_down_time.tm_hour = 0;
+ broken_down_time.tm_mday = day; /* day of month, from 1 to 31 */
+ broken_down_time.tm_mon = month - 1; /* month since January, in the range 0 to 11 */
+ broken_down_time.tm_year = year - 1900; /* number of years since 1900 */
+
+ time_t epoch_seconds = mktime(&broken_down_time); /* determine number of seconds since the epoch, i.e. Jan 1st 1970 */
+
+ if ((time_t)(-1) == epoch_seconds)
+ IEC_error();
+
+ ts.tv_sec = epoch_seconds;
+ ts.tv_nsec = 0;
+
+ return ts;
+}
+
+static inline struct timespec __dt_to_timespec(double seconds, double minutes, double hours, int day, int month, int year) {
+ struct timespec ts;
+
+ long double total_sec = (hours*60 + minutes)*60 + seconds;
+ ts.tv_sec = (long int)total_sec;
+ ts.tv_nsec = (long int)((total_sec - ts.tv_sec)*1e9);
+
+ struct tm broken_down_time;
+ broken_down_time.tm_sec = 0;
+ broken_down_time.tm_min = 0;
+ broken_down_time.tm_hour = 0;
+ broken_down_time.tm_mday = day; /* day of month, from 1 to 31 */
+ broken_down_time.tm_mon = month - 1; /* month since January, in the range 0 to 11 */
+ broken_down_time.tm_year = year - 1900; /* number of years since 1900 */
+
+ time_t epoch_seconds = mktime(&broken_down_time); /* determine number of seconds since the epoch, i.e. Jan 1st 1970 */
+ if ((time_t)(-1) == epoch_seconds)
+ IEC_error();
+
+ ts.tv_sec += epoch_seconds;
+ if (ts.tv_sec < epoch_seconds)
+ /* since the TOD is always positive, if the above happens then we had an overflow */
+ IEC_error();
+
+ return ts;
+}
+
+/***************/
+/* Time ops */
+/***************/
+inline TIME __date_and_time_to_time_of_day(TIME IN){
+ return (TIME){IN.tv_sec % 86400, IN.tv_nsec};
+}
+inline TIME __date_and_time_to_date(TIME IN){
+ return (TIME){IN.tv_sec - (IN.tv_sec % (24*60*60)), 0};
+}
+inline TIME __time_add(TIME IN1, TIME IN2){
+ TIME res ={IN1.tv_sec + IN2.tv_sec,
+ IN1.tv_nsec + IN2.tv_nsec };
+ __normalize_timespec(&res);
+ return res;
+}
+inline TIME __time_sub(TIME IN1, TIME IN2){
+ TIME res ={IN1.tv_sec - IN2.tv_sec,
+ IN1.tv_nsec - IN2.tv_nsec };
+ __normalize_timespec(&res);
+ return res;
+}
+inline TIME __time_mul(TIME IN1, LREAL IN2){
+ LREAL s_f = IN1.tv_sec * IN2;
+ time_t s = s_f;
+ div_t ns = div((LREAL)IN1.tv_nsec * IN2, 1000000000);
+ TIME res = {s + ns.quot,
+ ns.rem + (s_f - s) * 1000000000 };
+ __normalize_timespec(&res);
+ return res;
+}
+inline TIME __time_div(TIME IN1, LREAL IN2){
+ LREAL s_f = IN1.tv_sec / IN2;
+ time_t s = s_f;
+ TIME res = {s,
+ IN1.tv_nsec / IN2 + (s_f - s) * 1000000000 };
+ __normalize_timespec(&res);
+ return res;
+}
+
+/***************/
+/* String ops */
+/***************/
+inline UINT __len(STRING IN){
+ return IN.len;
+}
+inline STRING __left(STRING IN, SINT L){
+ STRING res = {0,};
+ memcpy(&res.body, &IN.body, L < res.len ? L : res.len);
+ return res;
+}
+inline STRING __right(STRING IN, SINT L){
+ STRING res = {0,};
+ L = L < IN.len ? L : IN.len;
+ memcpy(&res, &IN.body[IN.len - L], L);
+ res.len = L;
+ return res;
+}
+inline STRING __mid(STRING IN, SINT L, SINT P){
+ STRING res = {0,};
+ if(P <= IN.len){
+ P -= 1; /* now can be used as [index]*/
+ L = L + P <= IN.len ? L : IN.len - P;
+ memcpy(&res, &IN.body[P] , L);
+ res.len = L;
+ }
+ return res;
+}
+inline STRING __concat(SINT param_count, ...){
+ va_list ap;
+ UINT i;
+ __strlen_t charcount = 0;
+ STRING res = {0,};
+
+ va_start (ap, param_count); /* Initialize the argument list. */
+
+ for (i = 0; i < param_count && charcount < STR_MAX_LEN; i++)
+ {
+ STRING tmp = va_arg(ap, STRING);
+ __strlen_t charrem = STR_MAX_LEN - charcount;
+ __strlen_t to_write = tmp.len > charrem ? charrem : tmp.len;
+ memcpy(&res.body[charcount], &tmp.body , to_write);
+ charcount += to_write;
+ }
+
+ res.len = charcount;
+
+ va_end (ap); /* Clean up. */
+ return res;
+}
+inline STRING __insert(STRING IN1, STRING IN2, SINT P){
+ STRING res = {0,};
+ __strlen_t to_copy;
+
+ to_copy = P > IN1.len ? IN1.len : P;
+ memcpy(&res.body, &IN1.body , to_copy);
+ P = res.len = to_copy;
+
+ to_copy = IN2.len + res.len > STR_MAX_LEN ? STR_MAX_LEN - res.len : IN2.len;
+ memcpy(&res.body[res.len], &IN2.body , to_copy);
+ res.len += to_copy;
+
+ to_copy = IN1.len - P < STR_MAX_LEN - res.len ? IN1.len - P : STR_MAX_LEN - res.len ;
+ memcpy(&res.body[res.len], &IN1.body[P] , to_copy);
+ res.len += to_copy;
+
+ return res;
+}
+inline STRING __delete(STRING IN, SINT L_value, SINT P){
+ STRING res = {0,};
+ __strlen_t to_copy;
+
+ to_copy = P > IN.len ? IN.len : P;
+ memcpy(&res.body, &IN.body , to_copy);
+ P = res.len = to_copy;
+
+ to_copy = IN.len - P;
+ memcpy(&res.body[res.len], &IN.body[P] , to_copy);
+ res.len += to_copy;
+
+ return res;
+}
+inline STRING __replace(STRING IN1, STRING IN2, SINT L, SINT P){
+ STRING res = {0,};
+ __strlen_t to_copy;
+
+ to_copy = P > IN1.len ? IN1.len : P;
+ memcpy(&res.body, &IN1.body , to_copy);
+ P = res.len = to_copy;
+
+ to_copy = IN2.len + res.len > STR_MAX_LEN ? STR_MAX_LEN - res.len : IN2.len;
+ memcpy(&res.body[res.len], &IN2.body , to_copy);
+ res.len += to_copy;
+
+ to_copy = res.len < IN1.len ? IN1.len - res.len : 0;
+ memcpy(&res.body[res.len], &IN1.body[res.len] , to_copy);
+ res.len += to_copy;
+
+ return res;
+}
+
+
+
+inline UINT __pfind(STRING* IN1, STRING* IN2){
+ UINT count1 = 0;
+ UINT count2 = 0;
+ while(count1 + count2 < IN1->len && count2 < IN2->len)
+ {
+ if(IN1->body[count1 + count2] != IN2->body[count2++]){
+ count1 += count2;
+ count2 = 0;
+ }
+ }
+ return count2 == IN2->len ? 0 : count1;
+}
+inline UINT __find(STRING IN1, STRING IN2){
+ return __pfind(&IN1, &IN2);
+}
+
+/***************/
+/* Convertions */
+/***************/
+ /***************/
+ /* TO_STRING */
+ /***************/
+inline STRING __bool_to_string(BOOL IN)
+{
+ if(IN)
+ return (STRING){4, "TRUE"};
+ return (STRING){5,"FALSE"};
+}
+inline STRING __bit_to_string(LWORD IN){
+ STRING res = {0,};
+ res.len = snprintf(res.body, STR_MAX_LEN, "16#%llx", IN);
+ if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN;
+ return res;
+}
+inline STRING __real_to_string(LREAL IN){
+ STRING res = {0,};
+ res.len = snprintf(res.body, STR_MAX_LEN, "%g", IN);
+ if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN;
+ return res;
+}
+inline STRING __sint_to_string(LINT IN){
+ STRING res = {0,};
+ res.len = snprintf(res.body, STR_MAX_LEN, "%lld", IN);
+ if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN;
+ return res;
+}
+inline STRING __uint_to_string(ULINT IN){
+ STRING res = {0,};
+ res.len = snprintf(res.body, STR_MAX_LEN, "16#%llu", IN);
+ if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN;
+ return res;
+}
+ /***************/
+ /* FROM_STRING */
+ /***************/
+inline BOOL __string_to_bool(STRING IN){
+ return IN.len == 5 ? !memcmp(&IN.body,"TRUE", IN.len) : 0;
+}
+
+inline LINT __pstring_to_sint(STRING* IN){
+ LINT res = 0;
+ char tmp[STR_MAX_LEN];
+ char tmp2[STR_MAX_LEN];
+ __strlen_t l;
+ unsigned int shift = 0;
+
+ if(IN->body[0]=='2' && IN->body[1]=='#'){
+ /* 2#0101_1010_1011_1111 */
+ for(l = IN->len - 1; l >= 2 && shift < 64; l--)
+ {
+ char c = IN->body[l];
+ if( c >= '0' && c <= '1'){
+ res |= ( c - '0') << shift;
+ shift += 1;
+ }
+ }
+ }else if(IN->body[0]=='8' && IN->body[1]=='#'){
+ /* 8#1234_5665_4321 */
+ for(l = IN->len - 1; l >= 2 && shift < 64; l--)
+ {
+ char c = IN->body[l];
+ if( c >= '0' && c <= '7'){
+ res |= ( c - '0') << shift;
+ shift += 3;
+ }
+ }
+ }else if(IN->body[0]=='1' && IN->body[1]=='6' && IN->body[1]=='#'){
+ /* 16#1234_5678_9abc_DEFG */
+ for(l = IN->len - 1; l >= 3 && shift < 64; l--)
+ {
+ char c = IN->body[l];
+ if( c >= '0' && c <= '9'){
+ res |= ( c - '0') << shift;
+ shift += 4;
+ }else if( c >= 'a' && c <= 'f'){
+ res |= ( c - 'a' + 10 ) << shift;
+ shift += 4;
+ }else if( c >= 'A' && c <= 'F'){
+ res |= ( c - 'A' + 10 ) << shift;
+ shift += 4;
+ }
+ }
+ }else{
+ /* -123456789 */
+ LINT fac = IN->body[0] == '-' ? -1 : 1;
+ for(l = IN->len - 1; l >= 0 && shift < 20; l--)
+ {
+ char c = IN->body[l];
+ if( c >= '0' && c <= '9'){
+ res += ( c - '0') * fac;
+ fac *= 10;
+ shift += 1;
+ }
+ }
+ }
+ return res;
+}
+
+inline LINT __string_to_sint(STRING IN){
+ return (LWORD)__pstring_to_sint(&IN);
+}
+inline LWORD __string_to_bit(STRING IN){
+ return (LWORD)__pstring_to_sint(&IN);
+}
+inline ULINT __string_to_uint(STRING IN){
+ return (ULINT)__pstring_to_sint(&IN);
+}
+inline LREAL __string_to_real(STRING IN){
+ /* search the dot */
+ __strlen_t l = IN.len;
+ while(--l > 0 && IN.body[l] != '.');
+ if(l != 0){
+ return atof((const char *)&IN.body);
+ }else{
+ return (LREAL)__pstring_to_sint(&IN);
+ }
+}
+
+ /***************/
+ /* TO_TIME */
+ /***************/
+inline TIME __int_to_time(LINT IN){
+ return (TIME){IN, 0};
+}
+
+inline TIME __real_to_time(LREAL IN){
+ return (TIME){IN, (IN - (LINT)IN) * 1000000000};
+}
+inline TIME __string_to_time(STRING IN){
+ /* TODO :
+ *
+ * Duration literals without underlines: T#14ms T#-14ms T#14.7s T#14.7m
+ * short prefix T#14.7h t#14.7d t#25h15m
+ * t#5d14h12m18s3.5ms
+ * long prefix TIME#14ms TIME#-14ms time#14.7s
+ * Duration literals with underlines:
+ * short prefix t#25h_15m t#5d_14h_12m_18s_3.5ms
+ * long prefix TIME#25h_15m
+ * time#5d_14h_12m_18s_3.5ms
+ *
+ * Long prefix notation Short prefix notation
+ * DATE#1984-06-25 D#1984-06-25
+ * date#1984-06-25 d#1984-06-25
+ * TIME_OF_DAY#15:36:55.36 TOD#15:36:55.36
+ * time_of_day#15:36:55.36 tod#15:36:55.36
+ * DATE_AND_TIME#1984-06-25-15:36:55.36 DT#1984-06-25-15:36:55.36
+ * date_and_time#1984-06-25-15:36:55.36 dt#1984-06-25-15:36:55.36
+ *
+ */
+ /* Quick hack : only transform seconds */
+ /* search the dot */
+ __strlen_t l = IN.len;
+ while(--l > 0 && IN.body[l] != '.');
+ if(l != 0){
+ LREAL IN_val = atof((const char *)&IN.body);
+ return (TIME){IN_val, (IN_val - (LINT)IN_val)*1000000000};
+ }else{
+ return (TIME){__pstring_to_sint(&IN), 0};
+ }
+}
+
+ /***************/
+ /* FROM_TIME */
+ /***************/
+inline LREAL __time_to_real(TIME IN){
+ return (LREAL)IN.tv_sec + ((LREAL)IN.tv_nsec/1000000000);
+}
+inline LINT __time_to_int(TIME IN){
+ return IN.tv_sec;
+}
+inline STRING __time_to_string(TIME IN){
+ /*t#5d14h12m18s3.5ms*/
+ STRING res = {0,};
+ div_t days = div(IN.tv_sec ,86400);
+ if(!days.rem && IN.tv_nsec == 0){
+ res.len = snprintf((char*)&res.body, STR_MAX_LEN, "T#%dd", days.quot);
+ }else{
+ div_t hours = div(days.rem, 3600);
+ if(!hours.rem && IN.tv_nsec == 0){
+ res.len = snprintf((char*)&res.body, STR_MAX_LEN, "T#%dd%dh", days.quot, hours.quot);
+ }else{
+ div_t minuts = div(hours.rem, 60);
+ if(!minuts.rem && IN.tv_nsec == 0){
+ res.len = snprintf((char*)&res.body, STR_MAX_LEN, "T#%dd%dh%dm", days.quot, hours.quot, minuts.quot);
+ }else{
+ if(IN.tv_nsec == 0){
+ res.len = snprintf((char*)&res.body, STR_MAX_LEN, "T#%dd%dh%dm%ds", days.quot, hours.quot, minuts.quot, minuts.rem);
+ }else{
+ res.len = snprintf((char*)&res.body, STR_MAX_LEN, "T#%dd%dh%dm%ds%gms", days.quot, hours.quot, minuts.quot, minuts.rem, IN.tv_nsec / 1000000);
+ }
+ }
+ }
+ }
+ if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN;
+ return res;
+}
+inline STRING __date_to_string(DATE IN){
+ /* D#1984-06-25 */
+ STRING res = {0,};
+ struct tm broken_down_time;
+ time_t seconds = IN.tv_sec;
+ if (NULL == gmtime_r(&seconds, &broken_down_time)){ /* get the UTC (GMT) broken down time */
+ IEC_error();
+ return (STRING){7,"D#ERROR"};
+ }
+ res.len = snprintf((char*)&res.body, STR_MAX_LEN, "D#%d-%2.2d-%2.2d", broken_down_time.tm_year, broken_down_time.tm_mon, broken_down_time.tm_mday);
+ if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN;
+ return res;
+}
+inline STRING __tod_to_string(TOD IN){
+ /* TOD#15:36:55.36 */
+ STRING res = {0,};
+ struct tm broken_down_time;
+ time_t seconds = IN.tv_sec;
+ if (NULL == gmtime_r(&seconds, &broken_down_time)){ /* get the UTC (GMT) broken down time */
+ IEC_error();
+ return (STRING){9,"TOD#ERROR"};
+ }
+ if(IN.tv_nsec == 0){
+ res.len = snprintf((char*)&res.body, STR_MAX_LEN, "TOD#%2.2d:%2.2d:%d", broken_down_time.tm_hour, broken_down_time.tm_min, broken_down_time.tm_sec);
+ }else{
+ res.len = snprintf((char*)&res.body, STR_MAX_LEN, "TOD#%2.2d:%2.2d:%g", broken_down_time.tm_hour, broken_down_time.tm_min, (LREAL)broken_down_time.tm_sec + (LREAL)IN.tv_nsec / 1000000);
+ }
+ if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN;
+ return res;
+}
+inline STRING __dt_to_string(DT IN){
+ /* DT#1984-06-25-15:36:55.36 */
+ STRING res;
+ struct tm broken_down_time;
+ time_t seconds = IN.tv_sec;
+ if (NULL == gmtime_r(&seconds, &broken_down_time)){ /* get the UTC (GMT) broken down time */
+ IEC_error();
+ return (STRING){8,"DT#ERROR"};
+ }
+ if(IN.tv_nsec == 0){
+ res.len = snprintf((char*)&res.body, STR_MAX_LEN, "DT#%d-%2.2d-%2.2d-%2.2d:%2.2d:%d",
+ broken_down_time.tm_year,
+ broken_down_time.tm_mon,
+ broken_down_time.tm_mday,
+ broken_down_time.tm_hour,
+ broken_down_time.tm_min,
+ broken_down_time.tm_sec);
+ }else{
+ res.len = snprintf((char*)&res.body, STR_MAX_LEN, "DT#%d-%2.2d-%2.2d-%2.2d:%2.2d:%d",
+ broken_down_time.tm_year,
+ broken_down_time.tm_mon,
+ broken_down_time.tm_mday,
+ broken_down_time.tm_hour,
+ broken_down_time.tm_min,
+ (LREAL)broken_down_time.tm_sec + ((LREAL)IN.tv_nsec / 1000000));
+ }
+ if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN;
+ return res;
+}
+ /* BCD */
+inline ULINT __bcd_to_uint(LWORD IN){
+ return IN & 0xf +
+ ((IN >>= 4) & 0xf) * 10 +
+ ((IN >>= 4) & 0xf) * 100 +
+ ((IN >>= 4) & 0xf) * 1000 +
+ ((IN >>= 4) & 0xf) * 10000 +
+ ((IN >>= 4) & 0xf) * 100000 +
+ ((IN >>= 4) & 0xf) * 1000000 +
+ ((IN >>= 4) & 0xf) * 10000000 +
+ ((IN >>= 4) & 0xf) * 100000000 +
+ ((IN >>= 4) & 0xf) * 1000000000 +
+ ((IN >>= 4) & 0xf) * 10000000000 +
+ ((IN >>= 4) & 0xf) * 100000000000 +
+ ((IN >>= 4) & 0xf) * 1000000000000 +
+ ((IN >>= 4) & 0xf) * 10000000000000 +
+ ((IN >>= 4) & 0xf) * 100000000000000 +
+ ((IN >>= 4) & 0xf) * 1000000000000000;
+}
+inline LWORD __uint_to_bcd(ULINT IN){
+ return (IN - (IN /= 10))|
+ (IN - (IN /= 10)) << 4 |
+ (IN - (IN /= 10)) << 8 |
+ (IN - (IN /= 10)) << 12 |
+ (IN - (IN /= 10)) << 16 |
+ (IN - (IN /= 10)) << 20 |
+ (IN - (IN /= 10)) << 24 |
+ (IN - (IN /= 10)) << 28 |
+ (IN - (IN /= 10)) << 32 |
+ (IN - (IN /= 10)) << 36 |
+ (IN - (IN /= 10)) << 40 |
+ (IN - (IN /= 10)) << 44 |
+ (IN - (IN /= 10)) << 48 |
+ (IN - (IN /= 10)) << 52 |
+ (IN - (IN /= 10)) << 56 |
+ (IN - (IN /= 10)) << 60;
+}
+
+/**************/
+/* Binary ops */
+/**************/
+#define __ror_(TYPENAME)\
+inline TYPENAME __ror_##TYPENAME( TYPENAME IN, USINT N){\
+ N %= 8*sizeof(TYPENAME);\
+ return (IN >> N) | (IN << 8*sizeof(TYPENAME)-N);\
+}
+/* Call previously defined macro for each ANY_NBIT */
+ANY_NBIT(__ror_)
+
+#define __rol_(TYPENAME)\
+inline TYPENAME __rol_##TYPENAME( TYPENAME IN, USINT N){\
+ N %= 8*sizeof(TYPENAME);\
+ return (IN << N) | (IN >> 8*sizeof(TYPENAME)-N);\
+}
+/* Call previously defined macro for each ANY_NBIT */
+ANY_NBIT(__rol_)
+
+/**************/
+/* Selection */
+/**************/
+ /**************/
+ /* limit */
+ /**************/
+
+#define __limit_(TYPENAME)\
+inline TYPENAME __limit_##TYPENAME( TYPENAME MN, TYPENAME IN, TYPENAME MX){\
+ return IN > MN ? IN < MX ? IN : MX : MN;\
+}
+
+/* Call previously defined macro for each concerned type */
+ANY_NBIT(__limit_)
+ANY_NUM(__limit_)
+
+#define __limit_time(TYPENAME)\
+inline TIME __limit_##TYPENAME( TYPENAME MN, TYPENAME IN, TYPENAME MX){\
+ return __TIME_CMP(IN, MN) > 0 ? /* IN>MN ?*/\
+ __TIME_CMP(IN, MX) < 0 ? /* IN 0 ? __STR_CMP(IN, MX) < 0 ? IN : MX : MN;
+}
+
+ /**************/
+ /* MAX */
+ /**************/
+
+/* workaround for va-atgs limitation on shorter that int params */
+#define VA_ARGS_REAL LREAL
+#define VA_ARGS_LREAL LREAL
+#define VA_ARGS_SINT DINT
+#define VA_ARGS_INT DINT
+#define VA_ARGS_DINT DINT
+#define VA_ARGS_LINT LINT
+#define VA_ARGS_USINT UDINT
+#define VA_ARGS_UINT UDINT
+#define VA_ARGS_UDINT UDINT
+#define VA_ARGS_ULINT ULINT
+#define VA_ARGS_TIME TIME
+#define VA_ARGS_BOOL DWORD
+#define VA_ARGS_BYTE DWORD
+#define VA_ARGS_WORD DWORD
+#define VA_ARGS_DWORD DWORD
+#define VA_ARGS_LWORD LWORD
+#define VA_ARGS_STRING STRING
+#define VA_ARGS_WSTRING WSTRING
+#define VA_ARGS_DATE DATE
+#define VA_ARGS_TOD TOD
+#define VA_ARGS_DT DT
+
+#define __extrem_(fname,TYPENAME, COND) \
+inline TYPENAME fname##TYPENAME( UINT param_count, TYPENAME op1, ...){\
+ va_list ap;\
+ UINT i;\
+ \
+ va_start (ap, op1); /* Initialize the argument list. */\
+ \
+ for (i = 0; i < param_count; i++){\
+ TYPENAME tmp = va_arg (ap, VA_ARGS_##TYPENAME);\
+ op1 = COND ? tmp : op1;\
+ }\
+ \
+ va_end (ap); /* Clean up. */\
+ return op1;\
+}
+
+#define __max_num(TYPENAME) __extrem_(__max_,TYPENAME, op1 < tmp)
+ANY_NBIT(__max_num)
+ANY_NUM(__max_num)
+
+__extrem_(__max_, STRING, __STR_CMP(op1,tmp) < 0)
+#define __max_time(TYPENAME) __extrem_(__max_, TYPENAME, __TIME_CMP(op1, tmp) < 0)
+
+/* Call previously defined macro for each concerned type */
+ANY_DATE(__max_time)
+__max_time(TIME)
+
+ /**************/
+ /* MIN */
+ /**************/
+#define __min_num(TYPENAME) __extrem_(__min, TYPENAME, op1 > tmp)
+ANY_NBIT(__min_num)
+ANY_NUM(__min_num)
+
+__extrem_(__min, STRING, __STR_CMP(op1,tmp) > 0)
+
+#define __min_time(TYPENAME) __extrem_(__min_, TYPENAME, __TIME_CMP(op1, tmp) > 0)
+
+/* Call previously defined macro for each concerned type */
+ANY_DATE(__min_time)
+__min_time(TIME)
+
+ /**************/
+ /* MUX */
+ /**************/
+#define __mux_(TYPENAME) \
+inline TYPENAME __mux_##TYPENAME( UINT param_count, UINT K, TYPENAME op1, ...){\
+ va_list ap;\
+ UINT i;\
+ \
+ va_start (ap, op1); /* Initialize the argument list. */\
+ \
+ for (i = 0; i < param_count; i++){\
+ if(K == i){\
+ TYPENAME tmp = va_arg (ap, VA_ARGS_##TYPENAME);\
+ va_end (ap); /* Clean up. */\
+ return tmp;\
+ }else{\
+ va_arg (ap, VA_ARGS_##TYPENAME);\
+ }\
+ }\
+ \
+ va_end (ap); /* Clean up. */\
+ return op1;\
+}
+
+ANY(__mux_)
+
+/**************/
+/* Comparison */
+/**************/
+
+#define __compare_(fname,TYPENAME, COND) \
+inline BOOL fname##TYPENAME( UINT param_count, TYPENAME op1, ...){\
+ va_list ap;\
+ UINT i;\
+ \
+ va_start (ap, op1); /* Initialize the argument list. */\
+ \
+ for (i = 0; i < param_count; i++){\
+ TYPENAME tmp = va_arg (ap, VA_ARGS_##TYPENAME);\
+ if(COND){\
+ op1 = tmp;\
+ }else{\
+ va_end (ap); /* Clean up. */\
+ return 0;\
+ }\
+ }\
+ \
+ va_end (ap); /* Clean up. */\
+ return 1;\
+}
+
+#define __compare_num(fname, TYPENAME, TEST) __compare_(fname, TYPENAME, op1 TEST tmp )
+#define __compare_time(fname, TYPENAME, TEST) __compare_(fname, TYPENAME, __TIME_CMP(op1, tmp) TEST 0)
+#define __compare_string(fname, TEST) __compare_(fname, STRING, __STR_CMP(op1, tmp) TEST 0 )
+
+ /**************/
+ /* GT */
+ /**************/
+
+#define __gt_num(TYPENAME) __compare_num(__gt_, TYPENAME, > )
+ANY_NBIT(__gt_num)
+ANY_NUM(__gt_num)
+
+#define __gt_time(TYPENAME) __compare_time(__gt_, TYPENAME, > )
+ANY_DATE(__gt_time)
+__gt_time(TIME)
+
+__compare_string(__gt_, > )
+
+ /**************/
+ /* GE */
+ /**************/
+
+#define __ge_num(TYPENAME) __compare_num(__ge_, TYPENAME, >= )
+ANY_NBIT(__ge_num)
+ANY_NUM(__ge_num)
+
+#define __ge_time(TYPENAME) __compare_time(__ge_, TYPENAME, >= )
+ANY_DATE(__ge_time)
+__ge_time(TIME)
+
+__compare_string(__ge_, >=)
+
+ /**************/
+ /* EQ */
+ /**************/
+
+#define __eq_num(TYPENAME) __compare_num(__eq_, TYPENAME, == )
+ANY_NBIT(__eq_num)
+ANY_NUM(__eq_num)
+
+#define __eq_time(TYPENAME) __compare_time(__eq_, TYPENAME, == )
+ANY_DATE(__eq_time)
+__eq_time(TIME)
+
+__compare_string(__eq_, == )
+
+ /**************/
+ /* LT */
+ /**************/
+
+#define __lt_num(TYPENAME) __compare_num(__lt_, TYPENAME, < )
+ANY_NBIT(__lt_num)
+ANY_NUM(__lt_num)
+
+#define __lt_time(TYPENAME) __compare_time(__lt_, TYPENAME, < )
+ANY_DATE(__lt_time)
+__lt_time(TIME)
+
+__compare_string(__lt_, < )
+
+ /**************/
+ /* LE */
+ /**************/
+
+#define __le_num(TYPENAME) __compare_num(__le_, TYPENAME, <= )
+ANY_NBIT(__le_num)
+ANY_NUM(__le_num)
+
+#define __le_time(TYPENAME) __compare_time(__le_, TYPENAME, <= )
+ANY_DATE(__le_time)
+__le_time(TIME)
+
+__compare_string(__le_, <= )
+
+ /**************/
+ /* NE */
+ /**************/
+
+#define __ne_num(TYPENAME) __compare_num(__ne_, TYPENAME, != )
+ANY_NBIT(__ne_num)
+ANY_NUM(__ne_num)
+
+#define __ne_time(TYPENAME) __compare_time(__ne_, TYPENAME, != )
+ANY_DATE(__ne_time)
+__ne_time(TIME)
+
+__compare_string(__ne_, != )
+
+
diff -r e08c65e27557 -r 873a5b60a7ea lib/iec_std_lib_generated.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/iec_std_lib_generated.h Thu Jul 12 11:24:32 2007 +0200
@@ -0,0 +1,20 @@
+
+/****
+ * IEC 61131-3 standard function lib
+ * generated code, do not edit by hand
+ */
+
+/* Macro that expand to subtypes */
+#define ANY(DO) ANY_DERIVED(DO) ANY_ELEMENTARY(DO)
+#define ANY_DERIVED(DO)
+#define ANY_ELEMENTARY(DO) ANY_MAGNITUDE(DO) ANY_BIT(DO) ANY_STRING(DO) ANY_DATE(DO)
+#define ANY_MAGNITUDE(DO) ANY_NUM(DO) DO(TIME)
+#define ANY_BIT(DO) ANY_NBIT(DO) DO(BOOL)
+#define ANY_NBIT(DO) DO(BYTE) DO(WORD) DO(DWORD) DO(LWORD)
+#define ANY_STRING(DO) DO(STRING)
+#define ANY_DATE(DO) DO(DATE) DO(TOD) DO(DT)
+#define ANY_NUM(DO) ANY_REAL(DO) ANY_INT(DO)
+#define ANY_REAL(DO) DO(REAL) DO(LREAL)
+#define ANY_INT(DO) ANY_SINT(DO) ANY_UINT(DO)
+#define ANY_SINT(DO) DO(SINT) DO(INT) DO(DINT) DO(LINT)
+#define ANY_UINT(DO) DO(USINT) DO(UINT) DO(UDINT) DO(ULINT)
diff -r e08c65e27557 -r 873a5b60a7ea lib/ieclib.txt
--- a/lib/ieclib.txt Wed Jul 11 09:53:27 2007 +0200
+++ b/lib/ieclib.txt Thu Jul 12 11:24:32 2007 +0200
@@ -23,15 +23,11 @@
*)
(*
- * This is the library conatining the functions
- * and function blocks defined in the standard.
+ * This is the library conatining the function blocks defined in the standard.
*)
-(*{#include "bcd_to_int.txt" }*)
-(*{#include "int_to_bcd.txt" }*)
{#include "edge_detection.txt" }
{#include "bistable.txt" }
{#include "counter.txt" }
-{#include "timer.txt" }
-(*{#include "time_math.txt" }*)
\ No newline at end of file
+{#include "timer.txt" }
\ No newline at end of file
diff -r e08c65e27557 -r 873a5b60a7ea lib/int_to_bcd.txt
--- a/lib/int_to_bcd.txt Wed Jul 11 09:53:27 2007 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +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)
- *
- *)
-
-(*
- * This is part of the library conatining the functions
- * and function blocks defined in the standard.
- *
- * Conversion to BCD
- * -----------------
- *)
-
-
-
-
-FUNCTION USINT_TO_BCD_BYTE: BYTE
- VAR_INPUT
- VALUE : USINT;
- END_VAR
-
- USINT_TO_BCD_BYTE := VALUE MOD 10;
- VALUE := VALUE / 10;
- USINT_TO_BCD_BYTE := USINT_TO_BCD_BYTE + 16*VALUE;
- IF VALUE > 9
- THEN
- (* The standard is silent on how to handle overflows!! *)
- (* We simply set it to the highets value! *)
- USINT_TO_BCD_BYTE := 16#99;
- END_IF;
-END_FUNCTION
-
-
-
-
-FUNCTION UINT_TO_BCD_WORD: WORD
- VAR_INPUT
- VALUE : UINT;
- END_VAR
-
- UINT_TO_BCD_WORD := VALUE MOD 10;
- VALUE := VALUE / 10;
- UINT_TO_BCD_WORD := UINT_TO_BCD_WORD + 16*(VALUE MOD 10);
- VALUE := VALUE / 10;
- UINT_TO_BCD_WORD := UINT_TO_BCD_WORD + 16*16*(VALUE MOD 10);
- VALUE := VALUE / 10;
- UINT_TO_BCD_WORD := UINT_TO_BCD_WORD + 16*16*16*VALUE;
- IF VALUE > 9
- THEN
- (* The standard is silent on how to handle overflows!! *)
- (* We simply set it to the highets value! *)
- UINT_TO_BCD_WORD := 16#9999;
- END_IF;
-END_FUNCTION
-
-
-
-
-FUNCTION UDINT_TO_BCD_DWORD: DWORD
- VAR_INPUT
- VALUE : UINT;
- END_VAR
-
- UDINT_TO_BCD_DWORD := VALUE MOD 16;
- VALUE := VALUE / 10;
- UDINT_TO_BCD_DWORD := UDINT_TO_BCD_DWORD + 16*(VALUE MOD 10);
- VALUE := VALUE / 10;
- UDINT_TO_BCD_DWORD := UDINT_TO_BCD_DWORD + 256*(VALUE MOD 10);
- VALUE := VALUE / 10;
- UDINT_TO_BCD_DWORD := UDINT_TO_BCD_DWORD + 16*256*(VALUE MOD 10);
- VALUE := VALUE / 10;
- UDINT_TO_BCD_DWORD := UDINT_TO_BCD_DWORD + 256*256*(VALUE MOD 10);
- VALUE := VALUE / 10;
- UDINT_TO_BCD_DWORD := UDINT_TO_BCD_DWORD + 16*256*256*(VALUE MOD 10);
- VALUE := VALUE / 10;
- UDINT_TO_BCD_DWORD := UDINT_TO_BCD_DWORD + 256*256*256*(VALUE MOD 10);
- VALUE := VALUE / 10;
- UDINT_TO_BCD_DWORD := UDINT_TO_BCD_DWORD + 16*256*256*256*VALUE;
- IF VALUE > 9
- THEN
- (* The standard is silent on how to handle overflows!! *)
- (* We simply set it to the highest value! *)
- UDINT_TO_BCD_DWORD := 16#9999_9999;
- END_IF;
-END_FUNCTION
-
-
-
-
-FUNCTION ULINT_TO_BCD_LWORD: LWORD
- VAR_INPUT
- VALUE : UINT;
- END_VAR
-
- ULINT_TO_BCD_LWORD := UDINT_TO_BCD_DWORD(VALUE MOD 1_0000_0000);
- VALUE := VALUE / 1_0000_0000;
- ULINT_TO_BCD_LWORD := ULINT_TO_BCD_LWORD + 256*256*256*256*UDINT_TO_BCD_DWORD(VALUE);
-END_FUNCTION
diff -r e08c65e27557 -r 873a5b60a7ea lib/time_math.txt
--- a/lib/time_math.txt Wed Jul 11 09:53:27 2007 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,360 +0,0 @@
-(*
- * (c) 2005 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 part of the library conatining the functions
- * and function blocks defined in the standard.
- *
- * Math functions on Time and Date data types.
- * -------------------------------------------
- *
- * We also include the two data type conversions defined in table 30 of the IEC 61131-3 standard (version
- *)
-
-
-(* NOTE: The IEC 61131-3 standard library includes overloaded functions, which are not
- * allowed in user code. Since our compiler does not yet support overloaded functions, these
- * are commented out in the following library for the moment...
- *)
-
-(***************)
-(* TIME + TIME *)
-(***************)
-
-FUNCTION ADD : TIME
- VAR_INPUT
- IN1 : TIME;
- IN2 : TIME;
- END_VAR
-
- ADD := IN1 + IN2;
-END_FUNCTION
-
-
-FUNCTION ADD_TIME : TIME
- VAR_INPUT
- IN1 : TIME;
- IN2 : TIME;
- END_VAR
-
- ADD_TIME := IN1 + IN2;
-END_FUNCTION
-
-
-FUNCTION SUB : TIME
- VAR_INPUT
- IN1 : TIME;
- IN2 : TIME;
- END_VAR
-
- SUB := IN1 - IN2;
-END_FUNCTION
-
-
-FUNCTION SUB_TIME : TIME
- VAR_INPUT
- IN1 : TIME;
- IN2 : TIME;
- END_VAR
-
- SUB_TIME := IN1 - IN2;
-END_FUNCTION
-
-
-
-(**************)
-(* TIME + TOD *)
-(**************)
-
-FUNCTION ADD : TOD
- VAR_INPUT
- IN1 : TOD;
- IN2 : TIME;
- END_VAR
-
- ADD := IN1 + IN2;
-END_FUNCTION
-
-
-(* The following function is not defined in the standard, but its existance makes sense. *)
-FUNCTION ADD : TOD
- VAR_INPUT
- IN1 : TIME;
- IN2 : TOD;
- END_VAR
-
- ADD := IN1 + IN2;
-END_FUNCTION
-
-
-FUNCTION ADD_TOD_TIME : TOD
- VAR_INPUT
- IN1 : TOD;
- IN2 : TIME;
- END_VAR
-
- ADD_TOD_TIME := IN1 + IN2;
-END_FUNCTION
-
-
-FUNCTION SUB : TOD
- VAR_INPUT
- IN1 : TOD;
- IN2 : TIME;
- END_VAR
-
- SUB := IN1 - IN2;
-END_FUNCTION
-
-
-FUNCTION SUB_TOD_TIME : TOD
- VAR_INPUT
- IN1 : TOD;
- IN2 : TIME;
- END_VAR
-
- SUB_TOD_TIME := IN1 - IN2;
-END_FUNCTION
-
-
-
-(*************)
-(* TIME + DT *)
-(*************)
-
-FUNCTION ADD : DT
- VAR_INPUT
- IN1 : DT;
- IN2 : TIME;
- END_VAR
-
- ADD := IN1 + IN2;
-END_FUNCTION
-
-
-(* The following function is not defined in the standard, but its existance makes sense. *)
-FUNCTION ADD : DT
- VAR_INPUT
- IN1 : TIME;
- IN2 : DT;
- END_VAR
-
- ADD := IN1 + IN2;
-END_FUNCTION
-
-
-FUNCTION ADD_DT_TIME : DT
- VAR_INPUT
- IN1 : DT;
- IN2 : TIME;
- END_VAR
-
- ADD_DT_TIME := IN1 + IN2;
-END_FUNCTION
-
-
-
-(***************)
-(* DATE + DATE *)
-(***************)
-
-FUNCTION SUB : TIME
- VAR_INPUT
- IN1 : DATE;
- IN2 : DATE;
- END_VAR
-
- SUB := IN1 - IN2;
-END_FUNCTION
-
-
-FUNCTION SUB_DATE_DATE : TIME
- VAR_INPUT
- IN1 : DATE;
- IN2 : DATE;
- END_VAR
-
- SUB_DATE_DATE := IN1 - IN2;
-END_FUNCTION
-
-
-
-(*************)
-(* TOD + TOD *)
-(*************)
-
-FUNCTION SUB : TIME
- VAR_INPUT
- IN1 : TOD;
- IN2 : TOD;
- END_VAR
-
- SUB := IN1 - IN2;
-END_FUNCTION
-
-
-FUNCTION SUB_TOD_TOD : TIME
- VAR_INPUT
- IN1 : TOD;
- IN2 : TOD;
- END_VAR
-
- SUB_TOD_TOD := IN1 - IN2;
-END_FUNCTION
-
-
-
-(*************)
-(* TIME + DT *)
-(*************)
-
-FUNCTION SUB : DT
- VAR_INPUT
- IN1 : DT;
- IN2 : TIME;
- END_VAR
-
- SUB := IN1 - IN2;
-END_FUNCTION
-
-
-FUNCTION SUB_DT_TIME : DT
- VAR_INPUT
- IN1 : DT;
- IN2 : TIME;
- END_VAR
-
- SUB_DT_TIME := IN1 - IN2;
-END_FUNCTION
-
-
-
-(***********)
-(* DT + DT *)
-(***********)
-
-FUNCTION SUB : TIME
- VAR_INPUT
- IN1 : DT;
- IN2 : DT;
- END_VAR
-
- SUB := IN1 - IN2;
-END_FUNCTION
-
-
-FUNCTION SUB_DT_DT : TIME
- VAR_INPUT
- IN1 : DT;
- IN2 : DT;
- END_VAR
-
- SUB_DT_DT := IN1 - IN2;
-END_FUNCTION
-
-
-
-(******************)
-(* TIME * ANY_NUM *)
-(******************)
-
-FUNCTION MUL : TIME
- VAR_INPUT
- IN1 : TIME;
- IN2 : LREAL;
- END_VAR
-
- MUL := IN1 * IN2;
-END_FUNCTION
-
-
-FUNCTION MULTIME : TIME
- VAR_INPUT
- IN1 : TIME;
- IN2 : LREAL;
- END_VAR
-
- MULTIME := IN1 * IN2;
-END_FUNCTION
-
-
-FUNCTION DIV : TIME
- VAR_INPUT
- IN1 : TIME;
- IN2 : LREAL;
- END_VAR
-
- DIV := IN1 / IN2;
-END_FUNCTION
-
-
-FUNCTION DIVTIME : TIME
- VAR_INPUT
- IN1 : TIME;
- IN2 : LREAL;
- END_VAR
-
- DIVTIME := IN1 / IN2;
-END_FUNCTION
-
-
-
-(*************)
-(* DATE + DT *)
-(*************)
-
-FUNCTION CONCAT_DATE_TOD : DT
- VAR_INPUT
- IN1 : DATE;
- IN2 : TOD;
- END_VAR
-
- CONCAT_DATE_TOD := IN1 + IN2;
-END_FUNCTION
-
-
-
-(*************************)
-(* Data Type Conversions *)
-(*************************)
-
-FUNCTION DT_TO_DATE : DATE
- VAR_INPUT
- IN1 : DT;
- END_VAR
-
- {DT_TO_DATE = IN1.__to_DATE();}
-END_FUNCTION
-
-
-
-FUNCTION DT_TO_TOD : TOD
- VAR_INPUT
- IN1 : DT;
- END_VAR
-
- {DT_TO_TOD = IN1.__to_TOD();}
-END_FUNCTION
-
-
diff -r e08c65e27557 -r 873a5b60a7ea stage1_2/Makefile
--- a/stage1_2/Makefile Wed Jul 11 09:53:27 2007 +0200
+++ b/stage1_2/Makefile Thu Jul 12 11:24:32 2007 +0200
@@ -1,5 +1,5 @@
# include the system specific Makefile
-#include ../../../Makefile.$(shell uname)
+include ../Makefile.$(shell uname)
@@ -15,12 +15,6 @@
-rm -f iec.flex.c iec.y.cc iec.y.hh iec.y.output
-rm -f test_flex
-#get warnings, debugging information and optimization
-CFLAGS = -Wall -pedantic -Wpointer-arith -Wwrite-strings
-# CFLAGS += -Werror
-
-CFLAGS += -ggdb -O3 -funroll-loops
-# Note: if the optimizer crashes, we'll leave out the -O3 for those files
CFLAGS += -I. -I../* -I../../absyntax
@@ -33,13 +27,13 @@
flex -oiec.flex.c iec.flex
iec.flex.o: iec.y.hh iec.flex.c
- $(CXX) -c iec.flex.c -D LIBDIRECTORY='"$(IECLIBDIR)"' $(CFLAGS)
+ $(CXX) -c iec.flex.c -D DEFAULT_LIBDIR='"$(IECLIBDIR)"' $(CFLAGS)
iec.y.hh iec.y.cc: iec.y
bison -d -v -o iec.y.cc iec.y
iec.y.o: iec.y.cc iec.y.hh
- $(CXX) -c iec.y.cc -D LIBDIRECTORY='"$(IECLIBDIR)"' $(CFLAGS)
+ $(CXX) -c iec.y.cc $(CFLAGS)
diff -r e08c65e27557 -r 873a5b60a7ea stage1_2/iec.flex
--- a/stage1_2/iec.flex Wed Jul 11 09:53:27 2007 +0200
+++ b/stage1_2/iec.flex Thu Jul 12 11:24:32 2007 +0200
@@ -101,7 +101,7 @@
* in the syntax parser header file...
*/
#ifdef TEST_MAIN
-#define LIBDIRECTORY "just_testing"
+#define DEFAULT_LIBDIR "just_testing"
#endif
@@ -347,12 +347,11 @@
int include_stack_ptr = 0;
const char *INCLUDE_DIRECTORIES[] = {
- "",
- "lib/",
- "/lib/",
- "/usr/lib/",
- "/usr/lib/iec/",
- LIBDIRECTORY "/",
+ DEFAULT_LIBDIR,
+ ".",
+ "/lib",
+ "/usr/lib",
+ "/usr/lib/iec",
NULL /* must end with NULL!! */
};
@@ -666,7 +665,7 @@
current_filename = strdup(yytext);
for (i = 0, yyin = NULL; (INCLUDE_DIRECTORIES[i] != NULL) && (yyin == NULL); i++) {
- char *full_name = strdup2(INCLUDE_DIRECTORIES[i], yytext);
+ char *full_name = strdup3(INCLUDE_DIRECTORIES[i], "/", yytext);
if (full_name == NULL) {
fprintf(stderr, "Out of memory!\n");
exit( 1 );
diff -r e08c65e27557 -r 873a5b60a7ea stage1_2/iec.y
--- a/stage1_2/iec.y Wed Jul 11 09:53:27 2007 +0200
+++ b/stage1_2/iec.y Thu Jul 12 11:24:32 2007 +0200
@@ -5289,63 +5289,7 @@
}
-
-
-const char *standard_function_names[] = {
-// 2.5.1.5.1 Type conversion functions
-/*
- *_TO_**
- TRUNC
- *_BCD_TO_**
- **_TO_BCD_*
- (REAL or LREAL to SINT, INT, DINT or LINT)
-*/
-"TRUNC",
-"TIME_TO_REAL",
-// 2.5.1.5.2 Numerical functions
-// Table 23 - Standard functions of one numeric variable
-"ABS","SQRT","LN","LOG","EXP","SIN","COS","TAN","ASIN","ACOS","ATAN",
-// Table 24 - Standard arithmetic functions
-"ADD","MUL","SUB","DIV","MOD"/* See note (a) */,"EXPT","MOVE",
-// 2.5.1.5.3 Bit string functions
-// Table 25 - Standard bit shift functions
-"SHL","SHR","ROR","ROL",
-// 2.5.1.5.4 Selection and comparison functions
-// Table 26 - Standard bitwise Boolean functions
-"AND","OR","XOR","NOT",
-// Table 27 - Standard selection functions
-"SEL","MAX","MIN","LIMIT","MUX",
-// Table 28 - Standard comparison functions
-"GT","GE","EQ","LE","LT","NE",
-// 2.5.1.5.5 Character string functions
-// Table 29 - Standard character string functions
-"LEN","LEFT","RIGHT","MID","CONCAT","INSERT","DELETE","REPLACE","FIND",
-// 2.5.1.5.6 Functions of time data types
-// Table 30 - Functions of time data types
-"ADD_TIME","ADD_TOD_TIME","ADD_DT_TIME","SUB_TIME","SUB_DATE_DATE",
-"SUB_TOD_TIME","SUB_TOD_TOD","SUB_DT_TIME","SUB_DT_DT","MULTIME",
-"DIVTIME","CONCAT_DATE_TOD",
-// 2.5.1.5.7 Functions of enumerated data types
-// Table 31 - Functions of enumerated data types
-// "SEL", /* already above! We cannot have duplicates! */
-// "MUX", /* already above! We cannot have duplicates! */
-// "EQ", /* already above! We cannot have duplicates! */
-// "NE", /* already above! We cannot have duplicates! */
-
-/* end of array marker! Do not remove! */
-NULL
-
-/* Note (a):
- * This function has a name equal to a reserved keyword.
- * This means that adding it here is irrelevant because the
- * lexical parser will consider it the XXX token before
- * it interprets it as an identifier and looks it up
- * in the library elements symbol table.
- */
-};
-
-
-
+#include "standard_function_names.c"
const char *standard_function_block_names[] = {
// 2.5.2.3.1 Bistable elements
@@ -5370,6 +5314,8 @@
#define LIBFILE "ieclib.txt"
#define DEF_LIBFILENAME LIBDIRECTORY "/" LIBFILE
+extern const char *INCLUDE_DIRECTORIES[];
+
int stage1_2__(const char *filename, const char *includedir, symbol_c **tree_root_ref) {
FILE *in_file = NULL, *lib_file = NULL;
char *libfilename = NULL;
@@ -5382,30 +5328,17 @@
}
if (includedir != NULL) {
- if ((libfilename = strdup3(includedir, "/", LIBFILE)) == NULL) {
- fprintf (stderr, "Out of memory. Bailing out!\n");
- return -1;
- }
-
- if((lib_file = fopen(libfilename, "r")) == NULL) {
- char *errmsg = strdup2("Error opening library file ", libfilename);
- perror(errmsg);
- free(errmsg);
- }
+ INCLUDE_DIRECTORIES[0] = includedir;
}
-
- if (lib_file == NULL) {
- /* we try again... */
- if ((libfilename = strdup(DEF_LIBFILENAME)) == NULL) {
- fprintf (stderr, "Out of memory. Bailing out!\n");
- return -1;
- }
-
- if((lib_file = fopen(libfilename, "r")) == NULL) {
- char *errmsg = strdup2("Error opening library file ", libfilename);
- perror(errmsg);
- free(errmsg);
- }
+ if ((libfilename = strdup3(INCLUDE_DIRECTORIES[0], "/", LIBFILE)) == NULL) {
+ fprintf (stderr, "Out of memory. Bailing out!\n");
+ return -1;
+ }
+
+ if((lib_file = fopen(libfilename, "r")) == NULL) {
+ char *errmsg = strdup2("Error opening library file ", libfilename);
+ perror(errmsg);
+ free(errmsg);
}
if (lib_file == NULL) {
diff -r e08c65e27557 -r 873a5b60a7ea stage1_2/standard_function_names.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/stage1_2/standard_function_names.c Thu Jul 12 11:24:32 2007 +0200
@@ -0,0 +1,437 @@
+
+/****
+ * IEC 61131-3 standard function lib
+ * generated code, do not edit by hand
+ */
+
+const char *standard_function_names[] = {
+"BOOL_TO_SINT",
+"BOOL_TO_INT",
+"BOOL_TO_DINT",
+"BOOL_TO_LINT",
+"BOOL_TO_USINT",
+"BOOL_TO_UINT",
+"BOOL_TO_UDINT",
+"BOOL_TO_ULINT",
+"BOOL_TO_REAL",
+"BOOL_TO_LREAL",
+"BOOL_TO_TIME",
+"BOOL_TO_DATE",
+"BOOL_TO_TOD",
+"BOOL_TO_DT",
+"BOOL_TO_STRING",
+"BOOL_TO_BYTE",
+"BOOL_TO_WORD",
+"BOOL_TO_DWORD",
+"BOOL_TO_LWORD",
+"SINT_TO_BOOL",
+"SINT_TO_INT",
+"SINT_TO_DINT",
+"SINT_TO_LINT",
+"SINT_TO_USINT",
+"SINT_TO_UINT",
+"SINT_TO_UDINT",
+"SINT_TO_ULINT",
+"SINT_TO_REAL",
+"SINT_TO_LREAL",
+"SINT_TO_TIME",
+"SINT_TO_DATE",
+"SINT_TO_TOD",
+"SINT_TO_DT",
+"SINT_TO_STRING",
+"SINT_TO_BYTE",
+"SINT_TO_WORD",
+"SINT_TO_DWORD",
+"SINT_TO_LWORD",
+"INT_TO_BOOL",
+"INT_TO_SINT",
+"INT_TO_DINT",
+"INT_TO_LINT",
+"INT_TO_USINT",
+"INT_TO_UINT",
+"INT_TO_UDINT",
+"INT_TO_ULINT",
+"INT_TO_REAL",
+"INT_TO_LREAL",
+"INT_TO_TIME",
+"INT_TO_DATE",
+"INT_TO_TOD",
+"INT_TO_DT",
+"INT_TO_STRING",
+"INT_TO_BYTE",
+"INT_TO_WORD",
+"INT_TO_DWORD",
+"INT_TO_LWORD",
+"DINT_TO_BOOL",
+"DINT_TO_SINT",
+"DINT_TO_INT",
+"DINT_TO_LINT",
+"DINT_TO_USINT",
+"DINT_TO_UINT",
+"DINT_TO_UDINT",
+"DINT_TO_ULINT",
+"DINT_TO_REAL",
+"DINT_TO_LREAL",
+"DINT_TO_TIME",
+"DINT_TO_DATE",
+"DINT_TO_TOD",
+"DINT_TO_DT",
+"DINT_TO_STRING",
+"DINT_TO_BYTE",
+"DINT_TO_WORD",
+"DINT_TO_DWORD",
+"DINT_TO_LWORD",
+"LINT_TO_BOOL",
+"LINT_TO_SINT",
+"LINT_TO_INT",
+"LINT_TO_DINT",
+"LINT_TO_USINT",
+"LINT_TO_UINT",
+"LINT_TO_UDINT",
+"LINT_TO_ULINT",
+"LINT_TO_REAL",
+"LINT_TO_LREAL",
+"LINT_TO_TIME",
+"LINT_TO_DATE",
+"LINT_TO_TOD",
+"LINT_TO_DT",
+"LINT_TO_STRING",
+"LINT_TO_BYTE",
+"LINT_TO_WORD",
+"LINT_TO_DWORD",
+"LINT_TO_LWORD",
+"USINT_TO_BOOL",
+"USINT_TO_SINT",
+"USINT_TO_INT",
+"USINT_TO_DINT",
+"USINT_TO_LINT",
+"USINT_TO_UINT",
+"USINT_TO_UDINT",
+"USINT_TO_ULINT",
+"USINT_TO_REAL",
+"USINT_TO_LREAL",
+"USINT_TO_TIME",
+"USINT_TO_DATE",
+"USINT_TO_TOD",
+"USINT_TO_DT",
+"USINT_TO_STRING",
+"USINT_TO_BYTE",
+"USINT_TO_WORD",
+"USINT_TO_DWORD",
+"USINT_TO_LWORD",
+"UINT_TO_BOOL",
+"UINT_TO_SINT",
+"UINT_TO_INT",
+"UINT_TO_DINT",
+"UINT_TO_LINT",
+"UINT_TO_USINT",
+"UINT_TO_UDINT",
+"UINT_TO_ULINT",
+"UINT_TO_REAL",
+"UINT_TO_LREAL",
+"UINT_TO_TIME",
+"UINT_TO_DATE",
+"UINT_TO_TOD",
+"UINT_TO_DT",
+"UINT_TO_STRING",
+"UINT_TO_BYTE",
+"UINT_TO_WORD",
+"UINT_TO_DWORD",
+"UINT_TO_LWORD",
+"UDINT_TO_BOOL",
+"UDINT_TO_SINT",
+"UDINT_TO_INT",
+"UDINT_TO_DINT",
+"UDINT_TO_LINT",
+"UDINT_TO_USINT",
+"UDINT_TO_UINT",
+"UDINT_TO_ULINT",
+"UDINT_TO_REAL",
+"UDINT_TO_LREAL",
+"UDINT_TO_TIME",
+"UDINT_TO_DATE",
+"UDINT_TO_TOD",
+"UDINT_TO_DT",
+"UDINT_TO_STRING",
+"UDINT_TO_BYTE",
+"UDINT_TO_WORD",
+"UDINT_TO_DWORD",
+"UDINT_TO_LWORD",
+"ULINT_TO_BOOL",
+"ULINT_TO_SINT",
+"ULINT_TO_INT",
+"ULINT_TO_DINT",
+"ULINT_TO_LINT",
+"ULINT_TO_USINT",
+"ULINT_TO_UINT",
+"ULINT_TO_UDINT",
+"ULINT_TO_REAL",
+"ULINT_TO_LREAL",
+"ULINT_TO_TIME",
+"ULINT_TO_DATE",
+"ULINT_TO_TOD",
+"ULINT_TO_DT",
+"ULINT_TO_STRING",
+"ULINT_TO_BYTE",
+"ULINT_TO_WORD",
+"ULINT_TO_DWORD",
+"ULINT_TO_LWORD",
+"REAL_TO_BOOL",
+"REAL_TO_SINT",
+"REAL_TO_INT",
+"REAL_TO_DINT",
+"REAL_TO_LINT",
+"REAL_TO_USINT",
+"REAL_TO_UINT",
+"REAL_TO_UDINT",
+"REAL_TO_ULINT",
+"REAL_TO_LREAL",
+"REAL_TO_TIME",
+"REAL_TO_DATE",
+"REAL_TO_TOD",
+"REAL_TO_DT",
+"REAL_TO_STRING",
+"REAL_TO_BYTE",
+"REAL_TO_WORD",
+"REAL_TO_DWORD",
+"REAL_TO_LWORD",
+"LREAL_TO_BOOL",
+"LREAL_TO_SINT",
+"LREAL_TO_INT",
+"LREAL_TO_DINT",
+"LREAL_TO_LINT",
+"LREAL_TO_USINT",
+"LREAL_TO_UINT",
+"LREAL_TO_UDINT",
+"LREAL_TO_ULINT",
+"LREAL_TO_REAL",
+"LREAL_TO_TIME",
+"LREAL_TO_DATE",
+"LREAL_TO_TOD",
+"LREAL_TO_DT",
+"LREAL_TO_STRING",
+"LREAL_TO_BYTE",
+"LREAL_TO_WORD",
+"LREAL_TO_DWORD",
+"LREAL_TO_LWORD",
+"TIME_TO_BOOL",
+"TIME_TO_SINT",
+"TIME_TO_INT",
+"TIME_TO_DINT",
+"TIME_TO_LINT",
+"TIME_TO_USINT",
+"TIME_TO_UINT",
+"TIME_TO_UDINT",
+"TIME_TO_ULINT",
+"TIME_TO_REAL",
+"TIME_TO_LREAL",
+"TIME_TO_STRING",
+"TIME_TO_BYTE",
+"TIME_TO_WORD",
+"TIME_TO_DWORD",
+"TIME_TO_LWORD",
+"DATE_TO_BOOL",
+"DATE_TO_SINT",
+"DATE_TO_INT",
+"DATE_TO_DINT",
+"DATE_TO_LINT",
+"DATE_TO_USINT",
+"DATE_TO_UINT",
+"DATE_TO_UDINT",
+"DATE_TO_ULINT",
+"DATE_TO_REAL",
+"DATE_TO_LREAL",
+"DATE_TO_STRING",
+"DATE_TO_BYTE",
+"DATE_TO_WORD",
+"DATE_TO_DWORD",
+"DATE_TO_LWORD",
+"TOD_TO_BOOL",
+"TOD_TO_SINT",
+"TOD_TO_INT",
+"TOD_TO_DINT",
+"TOD_TO_LINT",
+"TOD_TO_USINT",
+"TOD_TO_UINT",
+"TOD_TO_UDINT",
+"TOD_TO_ULINT",
+"TOD_TO_REAL",
+"TOD_TO_LREAL",
+"TOD_TO_STRING",
+"TOD_TO_BYTE",
+"TOD_TO_WORD",
+"TOD_TO_DWORD",
+"TOD_TO_LWORD",
+"DT_TO_BOOL",
+"DT_TO_SINT",
+"DT_TO_INT",
+"DT_TO_DINT",
+"DT_TO_LINT",
+"DT_TO_USINT",
+"DT_TO_UINT",
+"DT_TO_UDINT",
+"DT_TO_ULINT",
+"DT_TO_REAL",
+"DT_TO_LREAL",
+"DT_TO_STRING",
+"DT_TO_BYTE",
+"DT_TO_WORD",
+"DT_TO_DWORD",
+"DT_TO_LWORD",
+"STRING_TO_BOOL",
+"STRING_TO_SINT",
+"STRING_TO_INT",
+"STRING_TO_DINT",
+"STRING_TO_LINT",
+"STRING_TO_USINT",
+"STRING_TO_UINT",
+"STRING_TO_UDINT",
+"STRING_TO_ULINT",
+"STRING_TO_REAL",
+"STRING_TO_LREAL",
+"STRING_TO_TIME",
+"STRING_TO_DATE",
+"STRING_TO_TOD",
+"STRING_TO_DT",
+"STRING_TO_BYTE",
+"STRING_TO_WORD",
+"STRING_TO_DWORD",
+"STRING_TO_LWORD",
+"BYTE_TO_BOOL",
+"BYTE_TO_SINT",
+"BYTE_TO_INT",
+"BYTE_TO_DINT",
+"BYTE_TO_LINT",
+"BYTE_TO_USINT",
+"BYTE_TO_UINT",
+"BYTE_TO_UDINT",
+"BYTE_TO_ULINT",
+"BYTE_TO_REAL",
+"BYTE_TO_LREAL",
+"BYTE_TO_TIME",
+"BYTE_TO_DATE",
+"BYTE_TO_TOD",
+"BYTE_TO_DT",
+"BYTE_TO_STRING",
+"BYTE_TO_WORD",
+"BYTE_TO_DWORD",
+"BYTE_TO_LWORD",
+"WORD_TO_BOOL",
+"WORD_TO_SINT",
+"WORD_TO_INT",
+"WORD_TO_DINT",
+"WORD_TO_LINT",
+"WORD_TO_USINT",
+"WORD_TO_UINT",
+"WORD_TO_UDINT",
+"WORD_TO_ULINT",
+"WORD_TO_REAL",
+"WORD_TO_LREAL",
+"WORD_TO_TIME",
+"WORD_TO_DATE",
+"WORD_TO_TOD",
+"WORD_TO_DT",
+"WORD_TO_STRING",
+"WORD_TO_BYTE",
+"WORD_TO_DWORD",
+"WORD_TO_LWORD",
+"DWORD_TO_BOOL",
+"DWORD_TO_SINT",
+"DWORD_TO_INT",
+"DWORD_TO_DINT",
+"DWORD_TO_LINT",
+"DWORD_TO_USINT",
+"DWORD_TO_UINT",
+"DWORD_TO_UDINT",
+"DWORD_TO_ULINT",
+"DWORD_TO_REAL",
+"DWORD_TO_LREAL",
+"DWORD_TO_TIME",
+"DWORD_TO_DATE",
+"DWORD_TO_TOD",
+"DWORD_TO_DT",
+"DWORD_TO_STRING",
+"DWORD_TO_BYTE",
+"DWORD_TO_WORD",
+"DWORD_TO_LWORD",
+"LWORD_TO_BOOL",
+"LWORD_TO_SINT",
+"LWORD_TO_INT",
+"LWORD_TO_DINT",
+"LWORD_TO_LINT",
+"LWORD_TO_USINT",
+"LWORD_TO_UINT",
+"LWORD_TO_UDINT",
+"LWORD_TO_ULINT",
+"LWORD_TO_REAL",
+"LWORD_TO_LREAL",
+"LWORD_TO_TIME",
+"LWORD_TO_DATE",
+"LWORD_TO_TOD",
+"LWORD_TO_DT",
+"LWORD_TO_STRING",
+"LWORD_TO_BYTE",
+"LWORD_TO_WORD",
+"LWORD_TO_DWORD",
+"TRUNC",
+"BCD_TO_USINT",
+"BCD_TO_UINT",
+"BCD_TO_UDINT",
+"BCD_TO_ULINT",
+"USINT_TO_BCD",
+"UINT_TO_BCD",
+"UDINT_TO_BCD",
+"ULINT_TO_BCD",
+"DATE_AND_TIME_TO_TIME_OF_DAY",
+"DATE_AND_TIME_TO_DATE",
+"ABS",
+"SQRT",
+"LN",
+"LOG",
+"EXP",
+"SIN",
+"COS",
+"TAN",
+"ASIN",
+"ACOS",
+"ATAN",
+"ADD",
+"MUL",
+"SUB",
+"DIV",
+"MOD",
+"EXPT",
+"MOVE",
+"SHL",
+"SHR",
+"ROR",
+"ROL",
+"AND",
+"OR",
+"XOR",
+"NOT",
+"SEL",
+"MAX",
+"MIN",
+"LIMIT",
+"MUX",
+"GT",
+"GE",
+"EQ",
+"LT",
+"LE",
+"NE",
+"LEN",
+"LEFT",
+"RIGHT",
+"MID",
+"CONCAT",
+"INSERT",
+"DELETE",
+"REPLACE",
+"FIND",
+
+/* end of array marker! Do not remove! */
+NULL
+};
+
diff -r e08c65e27557 -r 873a5b60a7ea stage4/Makefile
--- a/stage4/Makefile Wed Jul 11 09:53:27 2007 +0200
+++ b/stage4/Makefile Thu Jul 12 11:24:32 2007 +0200
@@ -1,5 +1,5 @@
# include the system specific Makefile
-#include ../../../Makefile.$(shell uname)
+include ../Makefile.$(shell uname)
@@ -13,16 +13,7 @@
find . -depth -mindepth 2 -maxdepth 2 -name Makefile -printf %h\\n | xargs -i make -C{} $@
-#get warnings, debugging information and optimization
-CXXFLAGS = -Wall -pedantic -Wpointer-arith -Wwrite-strings
-# CXXFLAGS += -Werror
-
-CXXFLAGS += -ggdb -O3 -funroll-loops
-# Note: if the optimizer crashes, we'll leave out the -O3 for those files
-
-CXXFLAGS += -I. -I../* -I../../absyntax
-
-
+CXXFLAGS += -I. -I../*
#how to make things in subdirectories etc
../% /% absyntax/% stage1_2/% stage3/% stage4/% util/%:
diff -r e08c65e27557 -r 873a5b60a7ea stage4/generate_cc/Makefile
--- a/stage4/generate_cc/Makefile Wed Jul 11 09:53:27 2007 +0200
+++ b/stage4/generate_cc/Makefile Thu Jul 12 11:24:32 2007 +0200
@@ -1,9 +1,5 @@
# include the system specific Makefile
-#include ../../../../Makefile.$(shell uname)
-
-
-
-
+include ../../Makefile.$(shell uname)
default: all
@@ -12,17 +8,9 @@
clean:
-rm -f *.o */*.o Makefile.depend
-#get warnings, debugging information and optimization
-CXXFLAGS = -Wall -pedantic -Wpointer-arith -Wwrite-strings
-# CXXFLAGS += -Werror
-
-CXXFLAGS += -ggdb -O3 -funroll-loops
-# Note: if the optimizer crashes, we'll leave out the -O3 for those files
-
+CXXFLAGS += -Wno-unused
CXXFLAGS += -I. -I../* -I../../absyntax
-
-
#how to make things from other directories if they are missing
../% /%:
$(MAKE) -C $(@D) $(@F)
diff -r e08c65e27557 -r 873a5b60a7ea stage4/generate_cc/function_type_decl.h
--- a/stage4/generate_cc/function_type_decl.h Wed Jul 11 09:53:27 2007 +0200
+++ b/stage4/generate_cc/function_type_decl.h Thu Jul 12 11:24:32 2007 +0200
@@ -4,7 +4,178 @@
* generated code, do not edit by hand
*/
typedef enum {
- function_real_to_lreal,
+ function_bool_to_sint,
+ function_bool_to_int,
+ function_bool_to_dint,
+ function_bool_to_lint,
+ function_bool_to_usint,
+ function_bool_to_uint,
+ function_bool_to_udint,
+ function_bool_to_ulint,
+ function_bool_to_real,
+ function_bool_to_lreal,
+ function_bool_to_time,
+ function_bool_to_date,
+ function_bool_to_tod,
+ function_bool_to_dt,
+ function_bool_to_string,
+ function_bool_to_byte,
+ function_bool_to_word,
+ function_bool_to_dword,
+ function_bool_to_lword,
+ function_sint_to_bool,
+ function_sint_to_int,
+ function_sint_to_dint,
+ function_sint_to_lint,
+ function_sint_to_usint,
+ function_sint_to_uint,
+ function_sint_to_udint,
+ function_sint_to_ulint,
+ function_sint_to_real,
+ function_sint_to_lreal,
+ function_sint_to_time,
+ function_sint_to_date,
+ function_sint_to_tod,
+ function_sint_to_dt,
+ function_sint_to_string,
+ function_sint_to_byte,
+ function_sint_to_word,
+ function_sint_to_dword,
+ function_sint_to_lword,
+ function_int_to_bool,
+ function_int_to_sint,
+ function_int_to_dint,
+ function_int_to_lint,
+ function_int_to_usint,
+ function_int_to_uint,
+ function_int_to_udint,
+ function_int_to_ulint,
+ function_int_to_real,
+ function_int_to_lreal,
+ function_int_to_time,
+ function_int_to_date,
+ function_int_to_tod,
+ function_int_to_dt,
+ function_int_to_string,
+ function_int_to_byte,
+ function_int_to_word,
+ function_int_to_dword,
+ function_int_to_lword,
+ function_dint_to_bool,
+ function_dint_to_sint,
+ function_dint_to_int,
+ function_dint_to_lint,
+ function_dint_to_usint,
+ function_dint_to_uint,
+ function_dint_to_udint,
+ function_dint_to_ulint,
+ function_dint_to_real,
+ function_dint_to_lreal,
+ function_dint_to_time,
+ function_dint_to_date,
+ function_dint_to_tod,
+ function_dint_to_dt,
+ function_dint_to_string,
+ function_dint_to_byte,
+ function_dint_to_word,
+ function_dint_to_dword,
+ function_dint_to_lword,
+ function_lint_to_bool,
+ function_lint_to_sint,
+ function_lint_to_int,
+ function_lint_to_dint,
+ function_lint_to_usint,
+ function_lint_to_uint,
+ function_lint_to_udint,
+ function_lint_to_ulint,
+ function_lint_to_real,
+ function_lint_to_lreal,
+ function_lint_to_time,
+ function_lint_to_date,
+ function_lint_to_tod,
+ function_lint_to_dt,
+ function_lint_to_string,
+ function_lint_to_byte,
+ function_lint_to_word,
+ function_lint_to_dword,
+ function_lint_to_lword,
+ function_usint_to_bool,
+ function_usint_to_sint,
+ function_usint_to_int,
+ function_usint_to_dint,
+ function_usint_to_lint,
+ function_usint_to_uint,
+ function_usint_to_udint,
+ function_usint_to_ulint,
+ function_usint_to_real,
+ function_usint_to_lreal,
+ function_usint_to_time,
+ function_usint_to_date,
+ function_usint_to_tod,
+ function_usint_to_dt,
+ function_usint_to_string,
+ function_usint_to_byte,
+ function_usint_to_word,
+ function_usint_to_dword,
+ function_usint_to_lword,
+ function_uint_to_bool,
+ function_uint_to_sint,
+ function_uint_to_int,
+ function_uint_to_dint,
+ function_uint_to_lint,
+ function_uint_to_usint,
+ function_uint_to_udint,
+ function_uint_to_ulint,
+ function_uint_to_real,
+ function_uint_to_lreal,
+ function_uint_to_time,
+ function_uint_to_date,
+ function_uint_to_tod,
+ function_uint_to_dt,
+ function_uint_to_string,
+ function_uint_to_byte,
+ function_uint_to_word,
+ function_uint_to_dword,
+ function_uint_to_lword,
+ function_udint_to_bool,
+ function_udint_to_sint,
+ function_udint_to_int,
+ function_udint_to_dint,
+ function_udint_to_lint,
+ function_udint_to_usint,
+ function_udint_to_uint,
+ function_udint_to_ulint,
+ function_udint_to_real,
+ function_udint_to_lreal,
+ function_udint_to_time,
+ function_udint_to_date,
+ function_udint_to_tod,
+ function_udint_to_dt,
+ function_udint_to_string,
+ function_udint_to_byte,
+ function_udint_to_word,
+ function_udint_to_dword,
+ function_udint_to_lword,
+ function_ulint_to_bool,
+ function_ulint_to_sint,
+ function_ulint_to_int,
+ function_ulint_to_dint,
+ function_ulint_to_lint,
+ function_ulint_to_usint,
+ function_ulint_to_uint,
+ function_ulint_to_udint,
+ function_ulint_to_real,
+ function_ulint_to_lreal,
+ function_ulint_to_time,
+ function_ulint_to_date,
+ function_ulint_to_tod,
+ function_ulint_to_dt,
+ function_ulint_to_string,
+ function_ulint_to_byte,
+ function_ulint_to_word,
+ function_ulint_to_dword,
+ function_ulint_to_lword,
+ function_real_to_bool,
function_real_to_sint,
function_real_to_int,
function_real_to_dint,
@@ -13,17 +184,17 @@
function_real_to_uint,
function_real_to_udint,
function_real_to_ulint,
+ function_real_to_lreal,
function_real_to_time,
- function_real_to_bool,
+ function_real_to_date,
+ function_real_to_tod,
+ function_real_to_dt,
+ function_real_to_string,
function_real_to_byte,
function_real_to_word,
function_real_to_dword,
function_real_to_lword,
- function_real_to_string,
- function_real_to_date,
- function_real_to_tod,
- function_real_to_dt,
- function_lreal_to_real,
+ function_lreal_to_bool,
function_lreal_to_sint,
function_lreal_to_int,
function_lreal_to_dint,
@@ -32,170 +203,17 @@
function_lreal_to_uint,
function_lreal_to_udint,
function_lreal_to_ulint,
+ function_lreal_to_real,
function_lreal_to_time,
- function_lreal_to_bool,
+ function_lreal_to_date,
+ function_lreal_to_tod,
+ function_lreal_to_dt,
+ function_lreal_to_string,
function_lreal_to_byte,
function_lreal_to_word,
function_lreal_to_dword,
function_lreal_to_lword,
- function_lreal_to_string,
- function_lreal_to_date,
- function_lreal_to_tod,
- function_lreal_to_dt,
- function_sint_to_real,
- function_sint_to_lreal,
- function_sint_to_int,
- function_sint_to_dint,
- function_sint_to_lint,
- function_sint_to_usint,
- function_sint_to_uint,
- function_sint_to_udint,
- function_sint_to_ulint,
- function_sint_to_time,
- function_sint_to_bool,
- function_sint_to_byte,
- function_sint_to_word,
- function_sint_to_dword,
- function_sint_to_lword,
- function_sint_to_string,
- function_sint_to_date,
- function_sint_to_tod,
- function_sint_to_dt,
- function_int_to_real,
- function_int_to_lreal,
- function_int_to_sint,
- function_int_to_dint,
- function_int_to_lint,
- function_int_to_usint,
- function_int_to_uint,
- function_int_to_udint,
- function_int_to_ulint,
- function_int_to_time,
- function_int_to_bool,
- function_int_to_byte,
- function_int_to_word,
- function_int_to_dword,
- function_int_to_lword,
- function_int_to_string,
- function_int_to_date,
- function_int_to_tod,
- function_int_to_dt,
- function_dint_to_real,
- function_dint_to_lreal,
- function_dint_to_sint,
- function_dint_to_int,
- function_dint_to_lint,
- function_dint_to_usint,
- function_dint_to_uint,
- function_dint_to_udint,
- function_dint_to_ulint,
- function_dint_to_time,
- function_dint_to_bool,
- function_dint_to_byte,
- function_dint_to_word,
- function_dint_to_dword,
- function_dint_to_lword,
- function_dint_to_string,
- function_dint_to_date,
- function_dint_to_tod,
- function_dint_to_dt,
- function_lint_to_real,
- function_lint_to_lreal,
- function_lint_to_sint,
- function_lint_to_int,
- function_lint_to_dint,
- function_lint_to_usint,
- function_lint_to_uint,
- function_lint_to_udint,
- function_lint_to_ulint,
- function_lint_to_time,
- function_lint_to_bool,
- function_lint_to_byte,
- function_lint_to_word,
- function_lint_to_dword,
- function_lint_to_lword,
- function_lint_to_string,
- function_lint_to_date,
- function_lint_to_tod,
- function_lint_to_dt,
- function_usint_to_real,
- function_usint_to_lreal,
- function_usint_to_sint,
- function_usint_to_int,
- function_usint_to_dint,
- function_usint_to_lint,
- function_usint_to_uint,
- function_usint_to_udint,
- function_usint_to_ulint,
- function_usint_to_time,
- function_usint_to_bool,
- function_usint_to_byte,
- function_usint_to_word,
- function_usint_to_dword,
- function_usint_to_lword,
- function_usint_to_string,
- function_usint_to_date,
- function_usint_to_tod,
- function_usint_to_dt,
- function_uint_to_real,
- function_uint_to_lreal,
- function_uint_to_sint,
- function_uint_to_int,
- function_uint_to_dint,
- function_uint_to_lint,
- function_uint_to_usint,
- function_uint_to_udint,
- function_uint_to_ulint,
- function_uint_to_time,
- function_uint_to_bool,
- function_uint_to_byte,
- function_uint_to_word,
- function_uint_to_dword,
- function_uint_to_lword,
- function_uint_to_string,
- function_uint_to_date,
- function_uint_to_tod,
- function_uint_to_dt,
- function_udint_to_real,
- function_udint_to_lreal,
- function_udint_to_sint,
- function_udint_to_int,
- function_udint_to_dint,
- function_udint_to_lint,
- function_udint_to_usint,
- function_udint_to_uint,
- function_udint_to_ulint,
- function_udint_to_time,
- function_udint_to_bool,
- function_udint_to_byte,
- function_udint_to_word,
- function_udint_to_dword,
- function_udint_to_lword,
- function_udint_to_string,
- function_udint_to_date,
- function_udint_to_tod,
- function_udint_to_dt,
- function_ulint_to_real,
- function_ulint_to_lreal,
- function_ulint_to_sint,
- function_ulint_to_int,
- function_ulint_to_dint,
- function_ulint_to_lint,
- function_ulint_to_usint,
- function_ulint_to_uint,
- function_ulint_to_udint,
- function_ulint_to_time,
- function_ulint_to_bool,
- function_ulint_to_byte,
- function_ulint_to_word,
- function_ulint_to_dword,
- function_ulint_to_lword,
- function_ulint_to_string,
- function_ulint_to_date,
- function_ulint_to_tod,
- function_ulint_to_dt,
- function_time_to_real,
- function_time_to_lreal,
+ function_time_to_bool,
function_time_to_sint,
function_time_to_int,
function_time_to_dint,
@@ -204,33 +222,81 @@
function_time_to_uint,
function_time_to_udint,
function_time_to_ulint,
- function_time_to_bool,
+ function_time_to_real,
+ function_time_to_lreal,
+ function_time_to_string,
function_time_to_byte,
function_time_to_word,
function_time_to_dword,
function_time_to_lword,
- function_time_to_string,
- function_bool_to_real,
- function_bool_to_lreal,
- function_bool_to_sint,
- function_bool_to_int,
- function_bool_to_dint,
- function_bool_to_lint,
- function_bool_to_usint,
- function_bool_to_uint,
- function_bool_to_udint,
- function_bool_to_ulint,
- function_bool_to_time,
- function_bool_to_byte,
- function_bool_to_word,
- function_bool_to_dword,
- function_bool_to_lword,
- function_bool_to_string,
- function_bool_to_date,
- function_bool_to_tod,
- function_bool_to_dt,
- function_byte_to_real,
- function_byte_to_lreal,
+ function_date_to_bool,
+ function_date_to_sint,
+ function_date_to_int,
+ function_date_to_dint,
+ function_date_to_lint,
+ function_date_to_usint,
+ function_date_to_uint,
+ function_date_to_udint,
+ function_date_to_ulint,
+ function_date_to_real,
+ function_date_to_lreal,
+ function_date_to_string,
+ function_date_to_byte,
+ function_date_to_word,
+ function_date_to_dword,
+ function_date_to_lword,
+ function_tod_to_bool,
+ function_tod_to_sint,
+ function_tod_to_int,
+ function_tod_to_dint,
+ function_tod_to_lint,
+ function_tod_to_usint,
+ function_tod_to_uint,
+ function_tod_to_udint,
+ function_tod_to_ulint,
+ function_tod_to_real,
+ function_tod_to_lreal,
+ function_tod_to_string,
+ function_tod_to_byte,
+ function_tod_to_word,
+ function_tod_to_dword,
+ function_tod_to_lword,
+ function_dt_to_bool,
+ function_dt_to_sint,
+ function_dt_to_int,
+ function_dt_to_dint,
+ function_dt_to_lint,
+ function_dt_to_usint,
+ function_dt_to_uint,
+ function_dt_to_udint,
+ function_dt_to_ulint,
+ function_dt_to_real,
+ function_dt_to_lreal,
+ function_dt_to_string,
+ function_dt_to_byte,
+ function_dt_to_word,
+ function_dt_to_dword,
+ function_dt_to_lword,
+ function_string_to_bool,
+ function_string_to_sint,
+ function_string_to_int,
+ function_string_to_dint,
+ function_string_to_lint,
+ function_string_to_usint,
+ function_string_to_uint,
+ function_string_to_udint,
+ function_string_to_ulint,
+ function_string_to_real,
+ function_string_to_lreal,
+ function_string_to_time,
+ function_string_to_date,
+ function_string_to_tod,
+ function_string_to_dt,
+ function_string_to_byte,
+ function_string_to_word,
+ function_string_to_dword,
+ function_string_to_lword,
+ function_byte_to_bool,
function_byte_to_sint,
function_byte_to_int,
function_byte_to_dint,
@@ -239,17 +305,17 @@
function_byte_to_uint,
function_byte_to_udint,
function_byte_to_ulint,
+ function_byte_to_real,
+ function_byte_to_lreal,
function_byte_to_time,
- function_byte_to_bool,
+ function_byte_to_date,
+ function_byte_to_tod,
+ function_byte_to_dt,
+ function_byte_to_string,
function_byte_to_word,
function_byte_to_dword,
function_byte_to_lword,
- function_byte_to_string,
- function_byte_to_date,
- function_byte_to_tod,
- function_byte_to_dt,
- function_word_to_real,
- function_word_to_lreal,
+ function_word_to_bool,
function_word_to_sint,
function_word_to_int,
function_word_to_dint,
@@ -258,17 +324,17 @@
function_word_to_uint,
function_word_to_udint,
function_word_to_ulint,
+ function_word_to_real,
+ function_word_to_lreal,
function_word_to_time,
- function_word_to_bool,
+ function_word_to_date,
+ function_word_to_tod,
+ function_word_to_dt,
+ function_word_to_string,
function_word_to_byte,
function_word_to_dword,
function_word_to_lword,
- function_word_to_string,
- function_word_to_date,
- function_word_to_tod,
- function_word_to_dt,
- function_dword_to_real,
- function_dword_to_lreal,
+ function_dword_to_bool,
function_dword_to_sint,
function_dword_to_int,
function_dword_to_dint,
@@ -277,17 +343,17 @@
function_dword_to_uint,
function_dword_to_udint,
function_dword_to_ulint,
+ function_dword_to_real,
+ function_dword_to_lreal,
function_dword_to_time,
- function_dword_to_bool,
+ function_dword_to_date,
+ function_dword_to_tod,
+ function_dword_to_dt,
+ function_dword_to_string,
function_dword_to_byte,
function_dword_to_word,
function_dword_to_lword,
- function_dword_to_string,
- function_dword_to_date,
- function_dword_to_tod,
- function_dword_to_dt,
- function_lword_to_real,
- function_lword_to_lreal,
+ function_lword_to_bool,
function_lword_to_sint,
function_lword_to_int,
function_lword_to_dint,
@@ -296,82 +362,16 @@
function_lword_to_uint,
function_lword_to_udint,
function_lword_to_ulint,
+ function_lword_to_real,
+ function_lword_to_lreal,
function_lword_to_time,
- function_lword_to_bool,
+ function_lword_to_date,
+ function_lword_to_tod,
+ function_lword_to_dt,
+ function_lword_to_string,
function_lword_to_byte,
function_lword_to_word,
function_lword_to_dword,
- function_lword_to_string,
- function_lword_to_date,
- function_lword_to_tod,
- function_lword_to_dt,
- function_string_to_real,
- function_string_to_lreal,
- function_string_to_sint,
- function_string_to_int,
- function_string_to_dint,
- function_string_to_lint,
- function_string_to_usint,
- function_string_to_uint,
- function_string_to_udint,
- function_string_to_ulint,
- function_string_to_time,
- function_string_to_bool,
- function_string_to_byte,
- function_string_to_word,
- function_string_to_dword,
- function_string_to_lword,
- function_string_to_date,
- function_string_to_tod,
- function_string_to_dt,
- function_date_to_real,
- function_date_to_lreal,
- function_date_to_sint,
- function_date_to_int,
- function_date_to_dint,
- function_date_to_lint,
- function_date_to_usint,
- function_date_to_uint,
- function_date_to_udint,
- function_date_to_ulint,
- function_date_to_bool,
- function_date_to_byte,
- function_date_to_word,
- function_date_to_dword,
- function_date_to_lword,
- function_date_to_string,
- function_tod_to_real,
- function_tod_to_lreal,
- function_tod_to_sint,
- function_tod_to_int,
- function_tod_to_dint,
- function_tod_to_lint,
- function_tod_to_usint,
- function_tod_to_uint,
- function_tod_to_udint,
- function_tod_to_ulint,
- function_tod_to_bool,
- function_tod_to_byte,
- function_tod_to_word,
- function_tod_to_dword,
- function_tod_to_lword,
- function_tod_to_string,
- function_dt_to_real,
- function_dt_to_lreal,
- function_dt_to_sint,
- function_dt_to_int,
- function_dt_to_dint,
- function_dt_to_lint,
- function_dt_to_usint,
- function_dt_to_uint,
- function_dt_to_udint,
- function_dt_to_ulint,
- function_dt_to_bool,
- function_dt_to_byte,
- function_dt_to_word,
- function_dt_to_dword,
- function_dt_to_lword,
- function_dt_to_string,
function_trunc,
function_bcd_to_usint,
function_bcd_to_uint,
diff -r e08c65e27557 -r 873a5b60a7ea stage4/generate_cc/generate_cc.cc
--- a/stage4/generate_cc/generate_cc.cc Wed Jul 11 09:53:27 2007 +0200
+++ b/stage4/generate_cc/generate_cc.cc Thu Jul 12 11:24:32 2007 +0200
@@ -926,7 +926,7 @@
s4o.print("/* FILE GENERATED BY iec2cc */\n");
s4o.print("/* Editing this file is not recommended... */\n");
s4o.print("/*******************************************/\n\n");
- s4o.print("#include \"plciec.h\"\n\n");
+ s4o.print("#include \"iec_std_lib.h\"\n\n");
/* (A) configuration declaration... */
/* (A.1) configuration name in comment */
@@ -1138,7 +1138,7 @@
s4o.print("/* FILE GENERATED BY iec2cc */\n");
s4o.print("/* Editing this file is not recommended... */\n");
s4o.print("/*******************************************/\n\n");
- s4o.print("#include \"plciec.h\"\n\n");
+ s4o.print("#include \"iec_std_lib.h\"\n\n");
/* (A) resource declaration... */
/* (A.1) resource name in comment */
diff -r e08c65e27557 -r 873a5b60a7ea stage4/generate_cc/get_function_type_decl.c
--- a/stage4/generate_cc/get_function_type_decl.c Wed Jul 11 09:53:27 2007 +0200
+++ b/stage4/generate_cc/get_function_type_decl.c Thu Jul 12 11:24:32 2007 +0200
@@ -5,38 +5,563 @@
*/
function_type_t get_function_type(identifier_c *function_name) {
+if (!strcasecmp(function_name->value, "BOOL_TO_SINT"))
+ return function_bool_to_sint;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_INT"))
+ return function_bool_to_int;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_DINT"))
+ return function_bool_to_dint;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_LINT"))
+ return function_bool_to_lint;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_USINT"))
+ return function_bool_to_usint;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_UINT"))
+ return function_bool_to_uint;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_UDINT"))
+ return function_bool_to_udint;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_ULINT"))
+ return function_bool_to_ulint;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_REAL"))
+ return function_bool_to_real;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_LREAL"))
+ return function_bool_to_lreal;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_TIME"))
+ return function_bool_to_time;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_DATE"))
+ return function_bool_to_date;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_TOD"))
+ return function_bool_to_tod;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_DT"))
+ return function_bool_to_dt;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_STRING"))
+ return function_bool_to_string;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_BYTE"))
+ return function_bool_to_byte;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_WORD"))
+ return function_bool_to_word;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_DWORD"))
+ return function_bool_to_dword;
+
+if (!strcasecmp(function_name->value, "BOOL_TO_LWORD"))
+ return function_bool_to_lword;
+
+if (!strcasecmp(function_name->value, "SINT_TO_BOOL"))
+ return function_sint_to_bool;
+
+if (!strcasecmp(function_name->value, "SINT_TO_INT"))
+ return function_sint_to_int;
+
+if (!strcasecmp(function_name->value, "SINT_TO_DINT"))
+ return function_sint_to_dint;
+
+if (!strcasecmp(function_name->value, "SINT_TO_LINT"))
+ return function_sint_to_lint;
+
+if (!strcasecmp(function_name->value, "SINT_TO_USINT"))
+ return function_sint_to_usint;
+
+if (!strcasecmp(function_name->value, "SINT_TO_UINT"))
+ return function_sint_to_uint;
+
+if (!strcasecmp(function_name->value, "SINT_TO_UDINT"))
+ return function_sint_to_udint;
+
+if (!strcasecmp(function_name->value, "SINT_TO_ULINT"))
+ return function_sint_to_ulint;
+
+if (!strcasecmp(function_name->value, "SINT_TO_REAL"))
+ return function_sint_to_real;
+
+if (!strcasecmp(function_name->value, "SINT_TO_LREAL"))
+ return function_sint_to_lreal;
+
+if (!strcasecmp(function_name->value, "SINT_TO_TIME"))
+ return function_sint_to_time;
+
+if (!strcasecmp(function_name->value, "SINT_TO_DATE"))
+ return function_sint_to_date;
+
+if (!strcasecmp(function_name->value, "SINT_TO_TOD"))
+ return function_sint_to_tod;
+
+if (!strcasecmp(function_name->value, "SINT_TO_DT"))
+ return function_sint_to_dt;
+
+if (!strcasecmp(function_name->value, "SINT_TO_STRING"))
+ return function_sint_to_string;
+
+if (!strcasecmp(function_name->value, "SINT_TO_BYTE"))
+ return function_sint_to_byte;
+
+if (!strcasecmp(function_name->value, "SINT_TO_WORD"))
+ return function_sint_to_word;
+
+if (!strcasecmp(function_name->value, "SINT_TO_DWORD"))
+ return function_sint_to_dword;
+
+if (!strcasecmp(function_name->value, "SINT_TO_LWORD"))
+ return function_sint_to_lword;
+
+if (!strcasecmp(function_name->value, "INT_TO_BOOL"))
+ return function_int_to_bool;
+
+if (!strcasecmp(function_name->value, "INT_TO_SINT"))
+ return function_int_to_sint;
+
+if (!strcasecmp(function_name->value, "INT_TO_DINT"))
+ return function_int_to_dint;
+
+if (!strcasecmp(function_name->value, "INT_TO_LINT"))
+ return function_int_to_lint;
+
+if (!strcasecmp(function_name->value, "INT_TO_USINT"))
+ return function_int_to_usint;
+
+if (!strcasecmp(function_name->value, "INT_TO_UINT"))
+ return function_int_to_uint;
+
+if (!strcasecmp(function_name->value, "INT_TO_UDINT"))
+ return function_int_to_udint;
+
+if (!strcasecmp(function_name->value, "INT_TO_ULINT"))
+ return function_int_to_ulint;
+
+if (!strcasecmp(function_name->value, "INT_TO_REAL"))
+ return function_int_to_real;
+
+if (!strcasecmp(function_name->value, "INT_TO_LREAL"))
+ return function_int_to_lreal;
+
+if (!strcasecmp(function_name->value, "INT_TO_TIME"))
+ return function_int_to_time;
+
+if (!strcasecmp(function_name->value, "INT_TO_DATE"))
+ return function_int_to_date;
+
+if (!strcasecmp(function_name->value, "INT_TO_TOD"))
+ return function_int_to_tod;
+
+if (!strcasecmp(function_name->value, "INT_TO_DT"))
+ return function_int_to_dt;
+
+if (!strcasecmp(function_name->value, "INT_TO_STRING"))
+ return function_int_to_string;
+
+if (!strcasecmp(function_name->value, "INT_TO_BYTE"))
+ return function_int_to_byte;
+
+if (!strcasecmp(function_name->value, "INT_TO_WORD"))
+ return function_int_to_word;
+
+if (!strcasecmp(function_name->value, "INT_TO_DWORD"))
+ return function_int_to_dword;
+
+if (!strcasecmp(function_name->value, "INT_TO_LWORD"))
+ return function_int_to_lword;
+
+if (!strcasecmp(function_name->value, "DINT_TO_BOOL"))
+ return function_dint_to_bool;
+
+if (!strcasecmp(function_name->value, "DINT_TO_SINT"))
+ return function_dint_to_sint;
+
+if (!strcasecmp(function_name->value, "DINT_TO_INT"))
+ return function_dint_to_int;
+
+if (!strcasecmp(function_name->value, "DINT_TO_LINT"))
+ return function_dint_to_lint;
+
+if (!strcasecmp(function_name->value, "DINT_TO_USINT"))
+ return function_dint_to_usint;
+
+if (!strcasecmp(function_name->value, "DINT_TO_UINT"))
+ return function_dint_to_uint;
+
+if (!strcasecmp(function_name->value, "DINT_TO_UDINT"))
+ return function_dint_to_udint;
+
+if (!strcasecmp(function_name->value, "DINT_TO_ULINT"))
+ return function_dint_to_ulint;
+
+if (!strcasecmp(function_name->value, "DINT_TO_REAL"))
+ return function_dint_to_real;
+
+if (!strcasecmp(function_name->value, "DINT_TO_LREAL"))
+ return function_dint_to_lreal;
+
+if (!strcasecmp(function_name->value, "DINT_TO_TIME"))
+ return function_dint_to_time;
+
+if (!strcasecmp(function_name->value, "DINT_TO_DATE"))
+ return function_dint_to_date;
+
+if (!strcasecmp(function_name->value, "DINT_TO_TOD"))
+ return function_dint_to_tod;
+
+if (!strcasecmp(function_name->value, "DINT_TO_DT"))
+ return function_dint_to_dt;
+
+if (!strcasecmp(function_name->value, "DINT_TO_STRING"))
+ return function_dint_to_string;
+
+if (!strcasecmp(function_name->value, "DINT_TO_BYTE"))
+ return function_dint_to_byte;
+
+if (!strcasecmp(function_name->value, "DINT_TO_WORD"))
+ return function_dint_to_word;
+
+if (!strcasecmp(function_name->value, "DINT_TO_DWORD"))
+ return function_dint_to_dword;
+
+if (!strcasecmp(function_name->value, "DINT_TO_LWORD"))
+ return function_dint_to_lword;
+
+if (!strcasecmp(function_name->value, "LINT_TO_BOOL"))
+ return function_lint_to_bool;
+
+if (!strcasecmp(function_name->value, "LINT_TO_SINT"))
+ return function_lint_to_sint;
+
+if (!strcasecmp(function_name->value, "LINT_TO_INT"))
+ return function_lint_to_int;
+
+if (!strcasecmp(function_name->value, "LINT_TO_DINT"))
+ return function_lint_to_dint;
+
+if (!strcasecmp(function_name->value, "LINT_TO_USINT"))
+ return function_lint_to_usint;
+
+if (!strcasecmp(function_name->value, "LINT_TO_UINT"))
+ return function_lint_to_uint;
+
+if (!strcasecmp(function_name->value, "LINT_TO_UDINT"))
+ return function_lint_to_udint;
+
+if (!strcasecmp(function_name->value, "LINT_TO_ULINT"))
+ return function_lint_to_ulint;
+
+if (!strcasecmp(function_name->value, "LINT_TO_REAL"))
+ return function_lint_to_real;
+
+if (!strcasecmp(function_name->value, "LINT_TO_LREAL"))
+ return function_lint_to_lreal;
+
+if (!strcasecmp(function_name->value, "LINT_TO_TIME"))
+ return function_lint_to_time;
+
+if (!strcasecmp(function_name->value, "LINT_TO_DATE"))
+ return function_lint_to_date;
+
+if (!strcasecmp(function_name->value, "LINT_TO_TOD"))
+ return function_lint_to_tod;
+
+if (!strcasecmp(function_name->value, "LINT_TO_DT"))
+ return function_lint_to_dt;
+
+if (!strcasecmp(function_name->value, "LINT_TO_STRING"))
+ return function_lint_to_string;
+
+if (!strcasecmp(function_name->value, "LINT_TO_BYTE"))
+ return function_lint_to_byte;
+
+if (!strcasecmp(function_name->value, "LINT_TO_WORD"))
+ return function_lint_to_word;
+
+if (!strcasecmp(function_name->value, "LINT_TO_DWORD"))
+ return function_lint_to_dword;
+
+if (!strcasecmp(function_name->value, "LINT_TO_LWORD"))
+ return function_lint_to_lword;
+
+if (!strcasecmp(function_name->value, "USINT_TO_BOOL"))
+ return function_usint_to_bool;
+
+if (!strcasecmp(function_name->value, "USINT_TO_SINT"))
+ return function_usint_to_sint;
+
+if (!strcasecmp(function_name->value, "USINT_TO_INT"))
+ return function_usint_to_int;
+
+if (!strcasecmp(function_name->value, "USINT_TO_DINT"))
+ return function_usint_to_dint;
+
+if (!strcasecmp(function_name->value, "USINT_TO_LINT"))
+ return function_usint_to_lint;
+
+if (!strcasecmp(function_name->value, "USINT_TO_UINT"))
+ return function_usint_to_uint;
+
+if (!strcasecmp(function_name->value, "USINT_TO_UDINT"))
+ return function_usint_to_udint;
+
+if (!strcasecmp(function_name->value, "USINT_TO_ULINT"))
+ return function_usint_to_ulint;
+
+if (!strcasecmp(function_name->value, "USINT_TO_REAL"))
+ return function_usint_to_real;
+
+if (!strcasecmp(function_name->value, "USINT_TO_LREAL"))
+ return function_usint_to_lreal;
+
+if (!strcasecmp(function_name->value, "USINT_TO_TIME"))
+ return function_usint_to_time;
+
+if (!strcasecmp(function_name->value, "USINT_TO_DATE"))
+ return function_usint_to_date;
+
+if (!strcasecmp(function_name->value, "USINT_TO_TOD"))
+ return function_usint_to_tod;
+
+if (!strcasecmp(function_name->value, "USINT_TO_DT"))
+ return function_usint_to_dt;
+
+if (!strcasecmp(function_name->value, "USINT_TO_STRING"))
+ return function_usint_to_string;
+
+if (!strcasecmp(function_name->value, "USINT_TO_BYTE"))
+ return function_usint_to_byte;
+
+if (!strcasecmp(function_name->value, "USINT_TO_WORD"))
+ return function_usint_to_word;
+
+if (!strcasecmp(function_name->value, "USINT_TO_DWORD"))
+ return function_usint_to_dword;
+
+if (!strcasecmp(function_name->value, "USINT_TO_LWORD"))
+ return function_usint_to_lword;
+
+if (!strcasecmp(function_name->value, "UINT_TO_BOOL"))
+ return function_uint_to_bool;
+
+if (!strcasecmp(function_name->value, "UINT_TO_SINT"))
+ return function_uint_to_sint;
+
+if (!strcasecmp(function_name->value, "UINT_TO_INT"))
+ return function_uint_to_int;
+
+if (!strcasecmp(function_name->value, "UINT_TO_DINT"))
+ return function_uint_to_dint;
+
+if (!strcasecmp(function_name->value, "UINT_TO_LINT"))
+ return function_uint_to_lint;
+
+if (!strcasecmp(function_name->value, "UINT_TO_USINT"))
+ return function_uint_to_usint;
+
+if (!strcasecmp(function_name->value, "UINT_TO_UDINT"))
+ return function_uint_to_udint;
+
+if (!strcasecmp(function_name->value, "UINT_TO_ULINT"))
+ return function_uint_to_ulint;
+
+if (!strcasecmp(function_name->value, "UINT_TO_REAL"))
+ return function_uint_to_real;
+
+if (!strcasecmp(function_name->value, "UINT_TO_LREAL"))
+ return function_uint_to_lreal;
+
+if (!strcasecmp(function_name->value, "UINT_TO_TIME"))
+ return function_uint_to_time;
+
+if (!strcasecmp(function_name->value, "UINT_TO_DATE"))
+ return function_uint_to_date;
+
+if (!strcasecmp(function_name->value, "UINT_TO_TOD"))
+ return function_uint_to_tod;
+
+if (!strcasecmp(function_name->value, "UINT_TO_DT"))
+ return function_uint_to_dt;
+
+if (!strcasecmp(function_name->value, "UINT_TO_STRING"))
+ return function_uint_to_string;
+
+if (!strcasecmp(function_name->value, "UINT_TO_BYTE"))
+ return function_uint_to_byte;
+
+if (!strcasecmp(function_name->value, "UINT_TO_WORD"))
+ return function_uint_to_word;
+
+if (!strcasecmp(function_name->value, "UINT_TO_DWORD"))
+ return function_uint_to_dword;
+
+if (!strcasecmp(function_name->value, "UINT_TO_LWORD"))
+ return function_uint_to_lword;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_BOOL"))
+ return function_udint_to_bool;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_SINT"))
+ return function_udint_to_sint;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_INT"))
+ return function_udint_to_int;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_DINT"))
+ return function_udint_to_dint;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_LINT"))
+ return function_udint_to_lint;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_USINT"))
+ return function_udint_to_usint;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_UINT"))
+ return function_udint_to_uint;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_ULINT"))
+ return function_udint_to_ulint;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_REAL"))
+ return function_udint_to_real;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_LREAL"))
+ return function_udint_to_lreal;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_TIME"))
+ return function_udint_to_time;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_DATE"))
+ return function_udint_to_date;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_TOD"))
+ return function_udint_to_tod;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_DT"))
+ return function_udint_to_dt;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_STRING"))
+ return function_udint_to_string;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_BYTE"))
+ return function_udint_to_byte;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_WORD"))
+ return function_udint_to_word;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_DWORD"))
+ return function_udint_to_dword;
+
+if (!strcasecmp(function_name->value, "UDINT_TO_LWORD"))
+ return function_udint_to_lword;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_BOOL"))
+ return function_ulint_to_bool;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_SINT"))
+ return function_ulint_to_sint;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_INT"))
+ return function_ulint_to_int;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_DINT"))
+ return function_ulint_to_dint;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_LINT"))
+ return function_ulint_to_lint;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_USINT"))
+ return function_ulint_to_usint;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_UINT"))
+ return function_ulint_to_uint;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_UDINT"))
+ return function_ulint_to_udint;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_REAL"))
+ return function_ulint_to_real;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_LREAL"))
+ return function_ulint_to_lreal;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_TIME"))
+ return function_ulint_to_time;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_DATE"))
+ return function_ulint_to_date;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_TOD"))
+ return function_ulint_to_tod;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_DT"))
+ return function_ulint_to_dt;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_STRING"))
+ return function_ulint_to_string;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_BYTE"))
+ return function_ulint_to_byte;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_WORD"))
+ return function_ulint_to_word;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_DWORD"))
+ return function_ulint_to_dword;
+
+if (!strcasecmp(function_name->value, "ULINT_TO_LWORD"))
+ return function_ulint_to_lword;
+
+if (!strcasecmp(function_name->value, "REAL_TO_BOOL"))
+ return function_real_to_bool;
+
+if (!strcasecmp(function_name->value, "REAL_TO_SINT"))
+ return function_real_to_sint;
+
+if (!strcasecmp(function_name->value, "REAL_TO_INT"))
+ return function_real_to_int;
+
+if (!strcasecmp(function_name->value, "REAL_TO_DINT"))
+ return function_real_to_dint;
+
+if (!strcasecmp(function_name->value, "REAL_TO_LINT"))
+ return function_real_to_lint;
+
+if (!strcasecmp(function_name->value, "REAL_TO_USINT"))
+ return function_real_to_usint;
+
+if (!strcasecmp(function_name->value, "REAL_TO_UINT"))
+ return function_real_to_uint;
+
+if (!strcasecmp(function_name->value, "REAL_TO_UDINT"))
+ return function_real_to_udint;
+
+if (!strcasecmp(function_name->value, "REAL_TO_ULINT"))
+ return function_real_to_ulint;
+
if (!strcasecmp(function_name->value, "REAL_TO_LREAL"))
return function_real_to_lreal;
-if (!strcasecmp(function_name->value, "REAL_TO_SINT"))
- return function_real_to_sint;
-
-if (!strcasecmp(function_name->value, "REAL_TO_INT"))
- return function_real_to_int;
-
-if (!strcasecmp(function_name->value, "REAL_TO_DINT"))
- return function_real_to_dint;
-
-if (!strcasecmp(function_name->value, "REAL_TO_LINT"))
- return function_real_to_lint;
-
-if (!strcasecmp(function_name->value, "REAL_TO_USINT"))
- return function_real_to_usint;
-
-if (!strcasecmp(function_name->value, "REAL_TO_UINT"))
- return function_real_to_uint;
-
-if (!strcasecmp(function_name->value, "REAL_TO_UDINT"))
- return function_real_to_udint;
-
-if (!strcasecmp(function_name->value, "REAL_TO_ULINT"))
- return function_real_to_ulint;
-
if (!strcasecmp(function_name->value, "REAL_TO_TIME"))
return function_real_to_time;
-if (!strcasecmp(function_name->value, "REAL_TO_BOOL"))
- return function_real_to_bool;
+if (!strcasecmp(function_name->value, "REAL_TO_DATE"))
+ return function_real_to_date;
+
+if (!strcasecmp(function_name->value, "REAL_TO_TOD"))
+ return function_real_to_tod;
+
+if (!strcasecmp(function_name->value, "REAL_TO_DT"))
+ return function_real_to_dt;
+
+if (!strcasecmp(function_name->value, "REAL_TO_STRING"))
+ return function_real_to_string;
if (!strcasecmp(function_name->value, "REAL_TO_BYTE"))
return function_real_to_byte;
@@ -50,50 +575,50 @@
if (!strcasecmp(function_name->value, "REAL_TO_LWORD"))
return function_real_to_lword;
-if (!strcasecmp(function_name->value, "REAL_TO_STRING"))
- return function_real_to_string;
-
-if (!strcasecmp(function_name->value, "REAL_TO_DATE"))
- return function_real_to_date;
-
-if (!strcasecmp(function_name->value, "REAL_TO_TOD"))
- return function_real_to_tod;
-
-if (!strcasecmp(function_name->value, "REAL_TO_DT"))
- return function_real_to_dt;
+if (!strcasecmp(function_name->value, "LREAL_TO_BOOL"))
+ return function_lreal_to_bool;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_SINT"))
+ return function_lreal_to_sint;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_INT"))
+ return function_lreal_to_int;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_DINT"))
+ return function_lreal_to_dint;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_LINT"))
+ return function_lreal_to_lint;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_USINT"))
+ return function_lreal_to_usint;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_UINT"))
+ return function_lreal_to_uint;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_UDINT"))
+ return function_lreal_to_udint;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_ULINT"))
+ return function_lreal_to_ulint;
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_INT"))
- return function_lreal_to_int;
-
-if (!strcasecmp(function_name->value, "LREAL_TO_DINT"))
- return function_lreal_to_dint;
-
-if (!strcasecmp(function_name->value, "LREAL_TO_LINT"))
- return function_lreal_to_lint;
-
-if (!strcasecmp(function_name->value, "LREAL_TO_USINT"))
- return function_lreal_to_usint;
-
-if (!strcasecmp(function_name->value, "LREAL_TO_UINT"))
- return function_lreal_to_uint;
-
-if (!strcasecmp(function_name->value, "LREAL_TO_UDINT"))
- return function_lreal_to_udint;
-
-if (!strcasecmp(function_name->value, "LREAL_TO_ULINT"))
- return function_lreal_to_ulint;
-
if (!strcasecmp(function_name->value, "LREAL_TO_TIME"))
return function_lreal_to_time;
-if (!strcasecmp(function_name->value, "LREAL_TO_BOOL"))
- return function_lreal_to_bool;
+if (!strcasecmp(function_name->value, "LREAL_TO_DATE"))
+ return function_lreal_to_date;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_TOD"))
+ return function_lreal_to_tod;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_DT"))
+ return function_lreal_to_dt;
+
+if (!strcasecmp(function_name->value, "LREAL_TO_STRING"))
+ return function_lreal_to_string;
if (!strcasecmp(function_name->value, "LREAL_TO_BYTE"))
return function_lreal_to_byte;
@@ -107,473 +632,32 @@
if (!strcasecmp(function_name->value, "LREAL_TO_LWORD"))
return function_lreal_to_lword;
-if (!strcasecmp(function_name->value, "LREAL_TO_STRING"))
- return function_lreal_to_string;
-
-if (!strcasecmp(function_name->value, "LREAL_TO_DATE"))
- return function_lreal_to_date;
-
-if (!strcasecmp(function_name->value, "LREAL_TO_TOD"))
- return function_lreal_to_tod;
-
-if (!strcasecmp(function_name->value, "LREAL_TO_DT"))
- return function_lreal_to_dt;
-
-if (!strcasecmp(function_name->value, "SINT_TO_REAL"))
- return function_sint_to_real;
-
-if (!strcasecmp(function_name->value, "SINT_TO_LREAL"))
- return function_sint_to_lreal;
-
-if (!strcasecmp(function_name->value, "SINT_TO_INT"))
- return function_sint_to_int;
-
-if (!strcasecmp(function_name->value, "SINT_TO_DINT"))
- return function_sint_to_dint;
-
-if (!strcasecmp(function_name->value, "SINT_TO_LINT"))
- return function_sint_to_lint;
-
-if (!strcasecmp(function_name->value, "SINT_TO_USINT"))
- return function_sint_to_usint;
-
-if (!strcasecmp(function_name->value, "SINT_TO_UINT"))
- return function_sint_to_uint;
-
-if (!strcasecmp(function_name->value, "SINT_TO_UDINT"))
- return function_sint_to_udint;
-
-if (!strcasecmp(function_name->value, "SINT_TO_ULINT"))
- return function_sint_to_ulint;
-
-if (!strcasecmp(function_name->value, "SINT_TO_TIME"))
- return function_sint_to_time;
-
-if (!strcasecmp(function_name->value, "SINT_TO_BOOL"))
- return function_sint_to_bool;
-
-if (!strcasecmp(function_name->value, "SINT_TO_BYTE"))
- return function_sint_to_byte;
-
-if (!strcasecmp(function_name->value, "SINT_TO_WORD"))
- return function_sint_to_word;
-
-if (!strcasecmp(function_name->value, "SINT_TO_DWORD"))
- return function_sint_to_dword;
-
-if (!strcasecmp(function_name->value, "SINT_TO_LWORD"))
- return function_sint_to_lword;
-
-if (!strcasecmp(function_name->value, "SINT_TO_STRING"))
- return function_sint_to_string;
-
-if (!strcasecmp(function_name->value, "SINT_TO_DATE"))
- return function_sint_to_date;
-
-if (!strcasecmp(function_name->value, "SINT_TO_TOD"))
- return function_sint_to_tod;
-
-if (!strcasecmp(function_name->value, "SINT_TO_DT"))
- return function_sint_to_dt;
-
-if (!strcasecmp(function_name->value, "INT_TO_REAL"))
- return function_int_to_real;
-
-if (!strcasecmp(function_name->value, "INT_TO_LREAL"))
- return function_int_to_lreal;
-
-if (!strcasecmp(function_name->value, "INT_TO_SINT"))
- return function_int_to_sint;
-
-if (!strcasecmp(function_name->value, "INT_TO_DINT"))
- return function_int_to_dint;
-
-if (!strcasecmp(function_name->value, "INT_TO_LINT"))
- return function_int_to_lint;
-
-if (!strcasecmp(function_name->value, "INT_TO_USINT"))
- return function_int_to_usint;
-
-if (!strcasecmp(function_name->value, "INT_TO_UINT"))
- return function_int_to_uint;
-
-if (!strcasecmp(function_name->value, "INT_TO_UDINT"))
- return function_int_to_udint;
-
-if (!strcasecmp(function_name->value, "INT_TO_ULINT"))
- return function_int_to_ulint;
-
-if (!strcasecmp(function_name->value, "INT_TO_TIME"))
- return function_int_to_time;
-
-if (!strcasecmp(function_name->value, "INT_TO_BOOL"))
- return function_int_to_bool;
-
-if (!strcasecmp(function_name->value, "INT_TO_BYTE"))
- return function_int_to_byte;
-
-if (!strcasecmp(function_name->value, "INT_TO_WORD"))
- return function_int_to_word;
-
-if (!strcasecmp(function_name->value, "INT_TO_DWORD"))
- return function_int_to_dword;
-
-if (!strcasecmp(function_name->value, "INT_TO_LWORD"))
- return function_int_to_lword;
-
-if (!strcasecmp(function_name->value, "INT_TO_STRING"))
- return function_int_to_string;
-
-if (!strcasecmp(function_name->value, "INT_TO_DATE"))
- return function_int_to_date;
-
-if (!strcasecmp(function_name->value, "INT_TO_TOD"))
- return function_int_to_tod;
-
-if (!strcasecmp(function_name->value, "INT_TO_DT"))
- return function_int_to_dt;
-
-if (!strcasecmp(function_name->value, "DINT_TO_REAL"))
- return function_dint_to_real;
-
-if (!strcasecmp(function_name->value, "DINT_TO_LREAL"))
- return function_dint_to_lreal;
-
-if (!strcasecmp(function_name->value, "DINT_TO_SINT"))
- return function_dint_to_sint;
-
-if (!strcasecmp(function_name->value, "DINT_TO_INT"))
- return function_dint_to_int;
-
-if (!strcasecmp(function_name->value, "DINT_TO_LINT"))
- return function_dint_to_lint;
-
-if (!strcasecmp(function_name->value, "DINT_TO_USINT"))
- return function_dint_to_usint;
-
-if (!strcasecmp(function_name->value, "DINT_TO_UINT"))
- return function_dint_to_uint;
-
-if (!strcasecmp(function_name->value, "DINT_TO_UDINT"))
- return function_dint_to_udint;
-
-if (!strcasecmp(function_name->value, "DINT_TO_ULINT"))
- return function_dint_to_ulint;
-
-if (!strcasecmp(function_name->value, "DINT_TO_TIME"))
- return function_dint_to_time;
-
-if (!strcasecmp(function_name->value, "DINT_TO_BOOL"))
- return function_dint_to_bool;
-
-if (!strcasecmp(function_name->value, "DINT_TO_BYTE"))
- return function_dint_to_byte;
-
-if (!strcasecmp(function_name->value, "DINT_TO_WORD"))
- return function_dint_to_word;
-
-if (!strcasecmp(function_name->value, "DINT_TO_DWORD"))
- return function_dint_to_dword;
-
-if (!strcasecmp(function_name->value, "DINT_TO_LWORD"))
- return function_dint_to_lword;
-
-if (!strcasecmp(function_name->value, "DINT_TO_STRING"))
- return function_dint_to_string;
-
-if (!strcasecmp(function_name->value, "DINT_TO_DATE"))
- return function_dint_to_date;
-
-if (!strcasecmp(function_name->value, "DINT_TO_TOD"))
- return function_dint_to_tod;
-
-if (!strcasecmp(function_name->value, "DINT_TO_DT"))
- return function_dint_to_dt;
-
-if (!strcasecmp(function_name->value, "LINT_TO_REAL"))
- return function_lint_to_real;
-
-if (!strcasecmp(function_name->value, "LINT_TO_LREAL"))
- return function_lint_to_lreal;
-
-if (!strcasecmp(function_name->value, "LINT_TO_SINT"))
- return function_lint_to_sint;
-
-if (!strcasecmp(function_name->value, "LINT_TO_INT"))
- return function_lint_to_int;
-
-if (!strcasecmp(function_name->value, "LINT_TO_DINT"))
- return function_lint_to_dint;
-
-if (!strcasecmp(function_name->value, "LINT_TO_USINT"))
- return function_lint_to_usint;
-
-if (!strcasecmp(function_name->value, "LINT_TO_UINT"))
- return function_lint_to_uint;
-
-if (!strcasecmp(function_name->value, "LINT_TO_UDINT"))
- return function_lint_to_udint;
-
-if (!strcasecmp(function_name->value, "LINT_TO_ULINT"))
- return function_lint_to_ulint;
-
-if (!strcasecmp(function_name->value, "LINT_TO_TIME"))
- return function_lint_to_time;
-
-if (!strcasecmp(function_name->value, "LINT_TO_BOOL"))
- return function_lint_to_bool;
-
-if (!strcasecmp(function_name->value, "LINT_TO_BYTE"))
- return function_lint_to_byte;
-
-if (!strcasecmp(function_name->value, "LINT_TO_WORD"))
- return function_lint_to_word;
-
-if (!strcasecmp(function_name->value, "LINT_TO_DWORD"))
- return function_lint_to_dword;
-
-if (!strcasecmp(function_name->value, "LINT_TO_LWORD"))
- return function_lint_to_lword;
-
-if (!strcasecmp(function_name->value, "LINT_TO_STRING"))
- return function_lint_to_string;
-
-if (!strcasecmp(function_name->value, "LINT_TO_DATE"))
- return function_lint_to_date;
-
-if (!strcasecmp(function_name->value, "LINT_TO_TOD"))
- return function_lint_to_tod;
-
-if (!strcasecmp(function_name->value, "LINT_TO_DT"))
- return function_lint_to_dt;
-
-if (!strcasecmp(function_name->value, "USINT_TO_REAL"))
- return function_usint_to_real;
-
-if (!strcasecmp(function_name->value, "USINT_TO_LREAL"))
- return function_usint_to_lreal;
-
-if (!strcasecmp(function_name->value, "USINT_TO_SINT"))
- return function_usint_to_sint;
-
-if (!strcasecmp(function_name->value, "USINT_TO_INT"))
- return function_usint_to_int;
-
-if (!strcasecmp(function_name->value, "USINT_TO_DINT"))
- return function_usint_to_dint;
-
-if (!strcasecmp(function_name->value, "USINT_TO_LINT"))
- return function_usint_to_lint;
-
-if (!strcasecmp(function_name->value, "USINT_TO_UINT"))
- return function_usint_to_uint;
-
-if (!strcasecmp(function_name->value, "USINT_TO_UDINT"))
- return function_usint_to_udint;
-
-if (!strcasecmp(function_name->value, "USINT_TO_ULINT"))
- return function_usint_to_ulint;
-
-if (!strcasecmp(function_name->value, "USINT_TO_TIME"))
- return function_usint_to_time;
-
-if (!strcasecmp(function_name->value, "USINT_TO_BOOL"))
- return function_usint_to_bool;
-
-if (!strcasecmp(function_name->value, "USINT_TO_BYTE"))
- return function_usint_to_byte;
-
-if (!strcasecmp(function_name->value, "USINT_TO_WORD"))
- return function_usint_to_word;
-
-if (!strcasecmp(function_name->value, "USINT_TO_DWORD"))
- return function_usint_to_dword;
-
-if (!strcasecmp(function_name->value, "USINT_TO_LWORD"))
- return function_usint_to_lword;
-
-if (!strcasecmp(function_name->value, "USINT_TO_STRING"))
- return function_usint_to_string;
-
-if (!strcasecmp(function_name->value, "USINT_TO_DATE"))
- return function_usint_to_date;
-
-if (!strcasecmp(function_name->value, "USINT_TO_TOD"))
- return function_usint_to_tod;
-
-if (!strcasecmp(function_name->value, "USINT_TO_DT"))
- return function_usint_to_dt;
-
-if (!strcasecmp(function_name->value, "UINT_TO_REAL"))
- return function_uint_to_real;
-
-if (!strcasecmp(function_name->value, "UINT_TO_LREAL"))
- return function_uint_to_lreal;
-
-if (!strcasecmp(function_name->value, "UINT_TO_SINT"))
- return function_uint_to_sint;
-
-if (!strcasecmp(function_name->value, "UINT_TO_INT"))
- return function_uint_to_int;
-
-if (!strcasecmp(function_name->value, "UINT_TO_DINT"))
- return function_uint_to_dint;
-
-if (!strcasecmp(function_name->value, "UINT_TO_LINT"))
- return function_uint_to_lint;
-
-if (!strcasecmp(function_name->value, "UINT_TO_USINT"))
- return function_uint_to_usint;
-
-if (!strcasecmp(function_name->value, "UINT_TO_UDINT"))
- return function_uint_to_udint;
-
-if (!strcasecmp(function_name->value, "UINT_TO_ULINT"))
- return function_uint_to_ulint;
-
-if (!strcasecmp(function_name->value, "UINT_TO_TIME"))
- return function_uint_to_time;
-
-if (!strcasecmp(function_name->value, "UINT_TO_BOOL"))
- return function_uint_to_bool;
-
-if (!strcasecmp(function_name->value, "UINT_TO_BYTE"))
- return function_uint_to_byte;
-
-if (!strcasecmp(function_name->value, "UINT_TO_WORD"))
- return function_uint_to_word;
-
-if (!strcasecmp(function_name->value, "UINT_TO_DWORD"))
- return function_uint_to_dword;
-
-if (!strcasecmp(function_name->value, "UINT_TO_LWORD"))
- return function_uint_to_lword;
-
-if (!strcasecmp(function_name->value, "UINT_TO_STRING"))
- return function_uint_to_string;
-
-if (!strcasecmp(function_name->value, "UINT_TO_DATE"))
- return function_uint_to_date;
-
-if (!strcasecmp(function_name->value, "UINT_TO_TOD"))
- return function_uint_to_tod;
-
-if (!strcasecmp(function_name->value, "UINT_TO_DT"))
- return function_uint_to_dt;
-
-if (!strcasecmp(function_name->value, "UDINT_TO_REAL"))
- return function_udint_to_real;
-
-if (!strcasecmp(function_name->value, "UDINT_TO_LREAL"))
- return function_udint_to_lreal;
-
-if (!strcasecmp(function_name->value, "UDINT_TO_SINT"))
- return function_udint_to_sint;
-
-if (!strcasecmp(function_name->value, "UDINT_TO_INT"))
- return function_udint_to_int;
-
-if (!strcasecmp(function_name->value, "UDINT_TO_DINT"))
- return function_udint_to_dint;
-
-if (!strcasecmp(function_name->value, "UDINT_TO_LINT"))
- return function_udint_to_lint;
-
-if (!strcasecmp(function_name->value, "UDINT_TO_USINT"))
- return function_udint_to_usint;
-
-if (!strcasecmp(function_name->value, "UDINT_TO_UINT"))
- return function_udint_to_uint;
-
-if (!strcasecmp(function_name->value, "UDINT_TO_ULINT"))
- return function_udint_to_ulint;
-
-if (!strcasecmp(function_name->value, "UDINT_TO_TIME"))
- return function_udint_to_time;
-
-if (!strcasecmp(function_name->value, "UDINT_TO_BOOL"))
- return function_udint_to_bool;
-
-if (!strcasecmp(function_name->value, "UDINT_TO_BYTE"))
- return function_udint_to_byte;
-
-if (!strcasecmp(function_name->value, "UDINT_TO_WORD"))
- return function_udint_to_word;
-
-if (!strcasecmp(function_name->value, "UDINT_TO_DWORD"))
- return function_udint_to_dword;
-
-if (!strcasecmp(function_name->value, "UDINT_TO_LWORD"))
- return function_udint_to_lword;
-
-if (!strcasecmp(function_name->value, "UDINT_TO_STRING"))
- return function_udint_to_string;
-
-if (!strcasecmp(function_name->value, "UDINT_TO_DATE"))
- return function_udint_to_date;
-
-if (!strcasecmp(function_name->value, "UDINT_TO_TOD"))
- return function_udint_to_tod;
-
-if (!strcasecmp(function_name->value, "UDINT_TO_DT"))
- return function_udint_to_dt;
-
-if (!strcasecmp(function_name->value, "ULINT_TO_REAL"))
- return function_ulint_to_real;
-
-if (!strcasecmp(function_name->value, "ULINT_TO_LREAL"))
- return function_ulint_to_lreal;
-
-if (!strcasecmp(function_name->value, "ULINT_TO_SINT"))
- return function_ulint_to_sint;
-
-if (!strcasecmp(function_name->value, "ULINT_TO_INT"))
- return function_ulint_to_int;
-
-if (!strcasecmp(function_name->value, "ULINT_TO_DINT"))
- return function_ulint_to_dint;
-
-if (!strcasecmp(function_name->value, "ULINT_TO_LINT"))
- return function_ulint_to_lint;
-
-if (!strcasecmp(function_name->value, "ULINT_TO_USINT"))
- return function_ulint_to_usint;
-
-if (!strcasecmp(function_name->value, "ULINT_TO_UINT"))
- return function_ulint_to_uint;
-
-if (!strcasecmp(function_name->value, "ULINT_TO_UDINT"))
- return function_ulint_to_udint;
-
-if (!strcasecmp(function_name->value, "ULINT_TO_TIME"))
- return function_ulint_to_time;
-
-if (!strcasecmp(function_name->value, "ULINT_TO_BOOL"))
- return function_ulint_to_bool;
-
-if (!strcasecmp(function_name->value, "ULINT_TO_BYTE"))
- return function_ulint_to_byte;
-
-if (!strcasecmp(function_name->value, "ULINT_TO_WORD"))
- return function_ulint_to_word;
-
-if (!strcasecmp(function_name->value, "ULINT_TO_DWORD"))
- return function_ulint_to_dword;
-
-if (!strcasecmp(function_name->value, "ULINT_TO_LWORD"))
- return function_ulint_to_lword;
-
-if (!strcasecmp(function_name->value, "ULINT_TO_STRING"))
- return function_ulint_to_string;
-
-if (!strcasecmp(function_name->value, "ULINT_TO_DATE"))
- return function_ulint_to_date;
-
-if (!strcasecmp(function_name->value, "ULINT_TO_TOD"))
- return function_ulint_to_tod;
-
-if (!strcasecmp(function_name->value, "ULINT_TO_DT"))
- return function_ulint_to_dt;
+if (!strcasecmp(function_name->value, "TIME_TO_BOOL"))
+ return function_time_to_bool;
+
+if (!strcasecmp(function_name->value, "TIME_TO_SINT"))
+ return function_time_to_sint;
+
+if (!strcasecmp(function_name->value, "TIME_TO_INT"))
+ return function_time_to_int;
+
+if (!strcasecmp(function_name->value, "TIME_TO_DINT"))
+ return function_time_to_dint;
+
+if (!strcasecmp(function_name->value, "TIME_TO_LINT"))
+ return function_time_to_lint;
+
+if (!strcasecmp(function_name->value, "TIME_TO_USINT"))
+ return function_time_to_usint;
+
+if (!strcasecmp(function_name->value, "TIME_TO_UINT"))
+ return function_time_to_uint;
+
+if (!strcasecmp(function_name->value, "TIME_TO_UDINT"))
+ return function_time_to_udint;
+
+if (!strcasecmp(function_name->value, "TIME_TO_ULINT"))
+ return function_time_to_ulint;
if (!strcasecmp(function_name->value, "TIME_TO_REAL"))
return function_time_to_real;
@@ -581,32 +665,8 @@
if (!strcasecmp(function_name->value, "TIME_TO_LREAL"))
return function_time_to_lreal;
-if (!strcasecmp(function_name->value, "TIME_TO_SINT"))
- return function_time_to_sint;
-
-if (!strcasecmp(function_name->value, "TIME_TO_INT"))
- return function_time_to_int;
-
-if (!strcasecmp(function_name->value, "TIME_TO_DINT"))
- return function_time_to_dint;
-
-if (!strcasecmp(function_name->value, "TIME_TO_LINT"))
- return function_time_to_lint;
-
-if (!strcasecmp(function_name->value, "TIME_TO_USINT"))
- return function_time_to_usint;
-
-if (!strcasecmp(function_name->value, "TIME_TO_UINT"))
- return function_time_to_uint;
-
-if (!strcasecmp(function_name->value, "TIME_TO_UDINT"))
- return function_time_to_udint;
-
-if (!strcasecmp(function_name->value, "TIME_TO_ULINT"))
- return function_time_to_ulint;
-
-if (!strcasecmp(function_name->value, "TIME_TO_BOOL"))
- return function_time_to_bool;
+if (!strcasecmp(function_name->value, "TIME_TO_STRING"))
+ return function_time_to_string;
if (!strcasecmp(function_name->value, "TIME_TO_BYTE"))
return function_time_to_byte;
@@ -620,65 +680,233 @@
if (!strcasecmp(function_name->value, "TIME_TO_LWORD"))
return function_time_to_lword;
-if (!strcasecmp(function_name->value, "TIME_TO_STRING"))
- return function_time_to_string;
-
-if (!strcasecmp(function_name->value, "BOOL_TO_REAL"))
- return function_bool_to_real;
-
-if (!strcasecmp(function_name->value, "BOOL_TO_LREAL"))
- return function_bool_to_lreal;
-
-if (!strcasecmp(function_name->value, "BOOL_TO_SINT"))
- return function_bool_to_sint;
-
-if (!strcasecmp(function_name->value, "BOOL_TO_INT"))
- return function_bool_to_int;
-
-if (!strcasecmp(function_name->value, "BOOL_TO_DINT"))
- return function_bool_to_dint;
-
-if (!strcasecmp(function_name->value, "BOOL_TO_LINT"))
- return function_bool_to_lint;
-
-if (!strcasecmp(function_name->value, "BOOL_TO_USINT"))
- return function_bool_to_usint;
-
-if (!strcasecmp(function_name->value, "BOOL_TO_UINT"))
- return function_bool_to_uint;
-
-if (!strcasecmp(function_name->value, "BOOL_TO_UDINT"))
- return function_bool_to_udint;
-
-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_BYTE"))
- return function_bool_to_byte;
-
-if (!strcasecmp(function_name->value, "BOOL_TO_WORD"))
- return function_bool_to_word;
-
-if (!strcasecmp(function_name->value, "BOOL_TO_DWORD"))
- return function_bool_to_dword;
-
-if (!strcasecmp(function_name->value, "BOOL_TO_LWORD"))
- return function_bool_to_lword;
-
-if (!strcasecmp(function_name->value, "BOOL_TO_STRING"))
- return function_bool_to_string;
-
-if (!strcasecmp(function_name->value, "BOOL_TO_DATE"))
- return function_bool_to_date;
-
-if (!strcasecmp(function_name->value, "BOOL_TO_TOD"))
- return function_bool_to_tod;
-
-if (!strcasecmp(function_name->value, "BOOL_TO_DT"))
- return function_bool_to_dt;
+if (!strcasecmp(function_name->value, "DATE_TO_BOOL"))
+ return function_date_to_bool;
+
+if (!strcasecmp(function_name->value, "DATE_TO_SINT"))
+ return function_date_to_sint;
+
+if (!strcasecmp(function_name->value, "DATE_TO_INT"))
+ return function_date_to_int;
+
+if (!strcasecmp(function_name->value, "DATE_TO_DINT"))
+ return function_date_to_dint;
+
+if (!strcasecmp(function_name->value, "DATE_TO_LINT"))
+ return function_date_to_lint;
+
+if (!strcasecmp(function_name->value, "DATE_TO_USINT"))
+ return function_date_to_usint;
+
+if (!strcasecmp(function_name->value, "DATE_TO_UINT"))
+ return function_date_to_uint;
+
+if (!strcasecmp(function_name->value, "DATE_TO_UDINT"))
+ return function_date_to_udint;
+
+if (!strcasecmp(function_name->value, "DATE_TO_ULINT"))
+ return function_date_to_ulint;
+
+if (!strcasecmp(function_name->value, "DATE_TO_REAL"))
+ return function_date_to_real;
+
+if (!strcasecmp(function_name->value, "DATE_TO_LREAL"))
+ return function_date_to_lreal;
+
+if (!strcasecmp(function_name->value, "DATE_TO_STRING"))
+ return function_date_to_string;
+
+if (!strcasecmp(function_name->value, "DATE_TO_BYTE"))
+ return function_date_to_byte;
+
+if (!strcasecmp(function_name->value, "DATE_TO_WORD"))
+ return function_date_to_word;
+
+if (!strcasecmp(function_name->value, "DATE_TO_DWORD"))
+ return function_date_to_dword;
+
+if (!strcasecmp(function_name->value, "DATE_TO_LWORD"))
+ return function_date_to_lword;
+
+if (!strcasecmp(function_name->value, "TOD_TO_BOOL"))
+ return function_tod_to_bool;
+
+if (!strcasecmp(function_name->value, "TOD_TO_SINT"))
+ return function_tod_to_sint;
+
+if (!strcasecmp(function_name->value, "TOD_TO_INT"))
+ return function_tod_to_int;
+
+if (!strcasecmp(function_name->value, "TOD_TO_DINT"))
+ return function_tod_to_dint;
+
+if (!strcasecmp(function_name->value, "TOD_TO_LINT"))
+ return function_tod_to_lint;
+
+if (!strcasecmp(function_name->value, "TOD_TO_USINT"))
+ return function_tod_to_usint;
+
+if (!strcasecmp(function_name->value, "TOD_TO_UINT"))
+ return function_tod_to_uint;
+
+if (!strcasecmp(function_name->value, "TOD_TO_UDINT"))
+ return function_tod_to_udint;
+
+if (!strcasecmp(function_name->value, "TOD_TO_ULINT"))
+ return function_tod_to_ulint;
+
+if (!strcasecmp(function_name->value, "TOD_TO_REAL"))
+ return function_tod_to_real;
+
+if (!strcasecmp(function_name->value, "TOD_TO_LREAL"))
+ return function_tod_to_lreal;
+
+if (!strcasecmp(function_name->value, "TOD_TO_STRING"))
+ return function_tod_to_string;
+
+if (!strcasecmp(function_name->value, "TOD_TO_BYTE"))
+ return function_tod_to_byte;
+
+if (!strcasecmp(function_name->value, "TOD_TO_WORD"))
+ return function_tod_to_word;
+
+if (!strcasecmp(function_name->value, "TOD_TO_DWORD"))
+ return function_tod_to_dword;
+
+if (!strcasecmp(function_name->value, "TOD_TO_LWORD"))
+ return function_tod_to_lword;
+
+if (!strcasecmp(function_name->value, "DT_TO_BOOL"))
+ return function_dt_to_bool;
+
+if (!strcasecmp(function_name->value, "DT_TO_SINT"))
+ return function_dt_to_sint;
+
+if (!strcasecmp(function_name->value, "DT_TO_INT"))
+ return function_dt_to_int;
+
+if (!strcasecmp(function_name->value, "DT_TO_DINT"))
+ return function_dt_to_dint;
+
+if (!strcasecmp(function_name->value, "DT_TO_LINT"))
+ return function_dt_to_lint;
+
+if (!strcasecmp(function_name->value, "DT_TO_USINT"))
+ return function_dt_to_usint;
+
+if (!strcasecmp(function_name->value, "DT_TO_UINT"))
+ return function_dt_to_uint;
+
+if (!strcasecmp(function_name->value, "DT_TO_UDINT"))
+ return function_dt_to_udint;
+
+if (!strcasecmp(function_name->value, "DT_TO_ULINT"))
+ return function_dt_to_ulint;
+
+if (!strcasecmp(function_name->value, "DT_TO_REAL"))
+ return function_dt_to_real;
+
+if (!strcasecmp(function_name->value, "DT_TO_LREAL"))
+ return function_dt_to_lreal;
+
+if (!strcasecmp(function_name->value, "DT_TO_STRING"))
+ return function_dt_to_string;
+
+if (!strcasecmp(function_name->value, "DT_TO_BYTE"))
+ return function_dt_to_byte;
+
+if (!strcasecmp(function_name->value, "DT_TO_WORD"))
+ return function_dt_to_word;
+
+if (!strcasecmp(function_name->value, "DT_TO_DWORD"))
+ return function_dt_to_dword;
+
+if (!strcasecmp(function_name->value, "DT_TO_LWORD"))
+ return function_dt_to_lword;
+
+if (!strcasecmp(function_name->value, "STRING_TO_BOOL"))
+ return function_string_to_bool;
+
+if (!strcasecmp(function_name->value, "STRING_TO_SINT"))
+ return function_string_to_sint;
+
+if (!strcasecmp(function_name->value, "STRING_TO_INT"))
+ return function_string_to_int;
+
+if (!strcasecmp(function_name->value, "STRING_TO_DINT"))
+ return function_string_to_dint;
+
+if (!strcasecmp(function_name->value, "STRING_TO_LINT"))
+ return function_string_to_lint;
+
+if (!strcasecmp(function_name->value, "STRING_TO_USINT"))
+ return function_string_to_usint;
+
+if (!strcasecmp(function_name->value, "STRING_TO_UINT"))
+ return function_string_to_uint;
+
+if (!strcasecmp(function_name->value, "STRING_TO_UDINT"))
+ return function_string_to_udint;
+
+if (!strcasecmp(function_name->value, "STRING_TO_ULINT"))
+ return function_string_to_ulint;
+
+if (!strcasecmp(function_name->value, "STRING_TO_REAL"))
+ return function_string_to_real;
+
+if (!strcasecmp(function_name->value, "STRING_TO_LREAL"))
+ return function_string_to_lreal;
+
+if (!strcasecmp(function_name->value, "STRING_TO_TIME"))
+ return function_string_to_time;
+
+if (!strcasecmp(function_name->value, "STRING_TO_DATE"))
+ return function_string_to_date;
+
+if (!strcasecmp(function_name->value, "STRING_TO_TOD"))
+ return function_string_to_tod;
+
+if (!strcasecmp(function_name->value, "STRING_TO_DT"))
+ return function_string_to_dt;
+
+if (!strcasecmp(function_name->value, "STRING_TO_BYTE"))
+ return function_string_to_byte;
+
+if (!strcasecmp(function_name->value, "STRING_TO_WORD"))
+ return function_string_to_word;
+
+if (!strcasecmp(function_name->value, "STRING_TO_DWORD"))
+ return function_string_to_dword;
+
+if (!strcasecmp(function_name->value, "STRING_TO_LWORD"))
+ return function_string_to_lword;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_BOOL"))
+ return function_byte_to_bool;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_SINT"))
+ return function_byte_to_sint;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_INT"))
+ return function_byte_to_int;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_DINT"))
+ return function_byte_to_dint;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_LINT"))
+ return function_byte_to_lint;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_USINT"))
+ return function_byte_to_usint;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_UINT"))
+ return function_byte_to_uint;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_UDINT"))
+ return function_byte_to_udint;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_ULINT"))
+ return function_byte_to_ulint;
if (!strcasecmp(function_name->value, "BYTE_TO_REAL"))
return function_byte_to_real;
@@ -686,35 +914,20 @@
if (!strcasecmp(function_name->value, "BYTE_TO_LREAL"))
return function_byte_to_lreal;
-if (!strcasecmp(function_name->value, "BYTE_TO_SINT"))
- return function_byte_to_sint;
-
-if (!strcasecmp(function_name->value, "BYTE_TO_INT"))
- return function_byte_to_int;
-
-if (!strcasecmp(function_name->value, "BYTE_TO_DINT"))
- return function_byte_to_dint;
-
-if (!strcasecmp(function_name->value, "BYTE_TO_LINT"))
- return function_byte_to_lint;
-
-if (!strcasecmp(function_name->value, "BYTE_TO_USINT"))
- return function_byte_to_usint;
-
-if (!strcasecmp(function_name->value, "BYTE_TO_UINT"))
- return function_byte_to_uint;
-
-if (!strcasecmp(function_name->value, "BYTE_TO_UDINT"))
- return function_byte_to_udint;
-
-if (!strcasecmp(function_name->value, "BYTE_TO_ULINT"))
- return function_byte_to_ulint;
-
if (!strcasecmp(function_name->value, "BYTE_TO_TIME"))
return function_byte_to_time;
-if (!strcasecmp(function_name->value, "BYTE_TO_BOOL"))
- return function_byte_to_bool;
+if (!strcasecmp(function_name->value, "BYTE_TO_DATE"))
+ return function_byte_to_date;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_TOD"))
+ return function_byte_to_tod;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_DT"))
+ return function_byte_to_dt;
+
+if (!strcasecmp(function_name->value, "BYTE_TO_STRING"))
+ return function_byte_to_string;
if (!strcasecmp(function_name->value, "BYTE_TO_WORD"))
return function_byte_to_word;
@@ -725,17 +938,32 @@
if (!strcasecmp(function_name->value, "BYTE_TO_LWORD"))
return function_byte_to_lword;
-if (!strcasecmp(function_name->value, "BYTE_TO_STRING"))
- return function_byte_to_string;
-
-if (!strcasecmp(function_name->value, "BYTE_TO_DATE"))
- return function_byte_to_date;
-
-if (!strcasecmp(function_name->value, "BYTE_TO_TOD"))
- return function_byte_to_tod;
-
-if (!strcasecmp(function_name->value, "BYTE_TO_DT"))
- return function_byte_to_dt;
+if (!strcasecmp(function_name->value, "WORD_TO_BOOL"))
+ return function_word_to_bool;
+
+if (!strcasecmp(function_name->value, "WORD_TO_SINT"))
+ return function_word_to_sint;
+
+if (!strcasecmp(function_name->value, "WORD_TO_INT"))
+ return function_word_to_int;
+
+if (!strcasecmp(function_name->value, "WORD_TO_DINT"))
+ return function_word_to_dint;
+
+if (!strcasecmp(function_name->value, "WORD_TO_LINT"))
+ return function_word_to_lint;
+
+if (!strcasecmp(function_name->value, "WORD_TO_USINT"))
+ return function_word_to_usint;
+
+if (!strcasecmp(function_name->value, "WORD_TO_UINT"))
+ return function_word_to_uint;
+
+if (!strcasecmp(function_name->value, "WORD_TO_UDINT"))
+ return function_word_to_udint;
+
+if (!strcasecmp(function_name->value, "WORD_TO_ULINT"))
+ return function_word_to_ulint;
if (!strcasecmp(function_name->value, "WORD_TO_REAL"))
return function_word_to_real;
@@ -743,35 +971,20 @@
if (!strcasecmp(function_name->value, "WORD_TO_LREAL"))
return function_word_to_lreal;
-if (!strcasecmp(function_name->value, "WORD_TO_SINT"))
- return function_word_to_sint;
-
-if (!strcasecmp(function_name->value, "WORD_TO_INT"))
- return function_word_to_int;
-
-if (!strcasecmp(function_name->value, "WORD_TO_DINT"))
- return function_word_to_dint;
-
-if (!strcasecmp(function_name->value, "WORD_TO_LINT"))
- return function_word_to_lint;
-
-if (!strcasecmp(function_name->value, "WORD_TO_USINT"))
- return function_word_to_usint;
-
-if (!strcasecmp(function_name->value, "WORD_TO_UINT"))
- return function_word_to_uint;
-
-if (!strcasecmp(function_name->value, "WORD_TO_UDINT"))
- return function_word_to_udint;
-
-if (!strcasecmp(function_name->value, "WORD_TO_ULINT"))
- return function_word_to_ulint;
-
if (!strcasecmp(function_name->value, "WORD_TO_TIME"))
return function_word_to_time;
-if (!strcasecmp(function_name->value, "WORD_TO_BOOL"))
- return function_word_to_bool;
+if (!strcasecmp(function_name->value, "WORD_TO_DATE"))
+ return function_word_to_date;
+
+if (!strcasecmp(function_name->value, "WORD_TO_TOD"))
+ return function_word_to_tod;
+
+if (!strcasecmp(function_name->value, "WORD_TO_DT"))
+ return function_word_to_dt;
+
+if (!strcasecmp(function_name->value, "WORD_TO_STRING"))
+ return function_word_to_string;
if (!strcasecmp(function_name->value, "WORD_TO_BYTE"))
return function_word_to_byte;
@@ -782,17 +995,32 @@
if (!strcasecmp(function_name->value, "WORD_TO_LWORD"))
return function_word_to_lword;
-if (!strcasecmp(function_name->value, "WORD_TO_STRING"))
- return function_word_to_string;
-
-if (!strcasecmp(function_name->value, "WORD_TO_DATE"))
- return function_word_to_date;
-
-if (!strcasecmp(function_name->value, "WORD_TO_TOD"))
- return function_word_to_tod;
-
-if (!strcasecmp(function_name->value, "WORD_TO_DT"))
- return function_word_to_dt;
+if (!strcasecmp(function_name->value, "DWORD_TO_BOOL"))
+ return function_dword_to_bool;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_SINT"))
+ return function_dword_to_sint;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_INT"))
+ return function_dword_to_int;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_DINT"))
+ return function_dword_to_dint;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_LINT"))
+ return function_dword_to_lint;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_USINT"))
+ return function_dword_to_usint;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_UINT"))
+ return function_dword_to_uint;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_UDINT"))
+ return function_dword_to_udint;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_ULINT"))
+ return function_dword_to_ulint;
if (!strcasecmp(function_name->value, "DWORD_TO_REAL"))
return function_dword_to_real;
@@ -800,35 +1028,20 @@
if (!strcasecmp(function_name->value, "DWORD_TO_LREAL"))
return function_dword_to_lreal;
-if (!strcasecmp(function_name->value, "DWORD_TO_SINT"))
- return function_dword_to_sint;
-
-if (!strcasecmp(function_name->value, "DWORD_TO_INT"))
- return function_dword_to_int;
-
-if (!strcasecmp(function_name->value, "DWORD_TO_DINT"))
- return function_dword_to_dint;
-
-if (!strcasecmp(function_name->value, "DWORD_TO_LINT"))
- return function_dword_to_lint;
-
-if (!strcasecmp(function_name->value, "DWORD_TO_USINT"))
- return function_dword_to_usint;
-
-if (!strcasecmp(function_name->value, "DWORD_TO_UINT"))
- return function_dword_to_uint;
-
-if (!strcasecmp(function_name->value, "DWORD_TO_UDINT"))
- return function_dword_to_udint;
-
-if (!strcasecmp(function_name->value, "DWORD_TO_ULINT"))
- return function_dword_to_ulint;
-
if (!strcasecmp(function_name->value, "DWORD_TO_TIME"))
return function_dword_to_time;
-if (!strcasecmp(function_name->value, "DWORD_TO_BOOL"))
- return function_dword_to_bool;
+if (!strcasecmp(function_name->value, "DWORD_TO_DATE"))
+ return function_dword_to_date;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_TOD"))
+ return function_dword_to_tod;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_DT"))
+ return function_dword_to_dt;
+
+if (!strcasecmp(function_name->value, "DWORD_TO_STRING"))
+ return function_dword_to_string;
if (!strcasecmp(function_name->value, "DWORD_TO_BYTE"))
return function_dword_to_byte;
@@ -839,17 +1052,32 @@
if (!strcasecmp(function_name->value, "DWORD_TO_LWORD"))
return function_dword_to_lword;
-if (!strcasecmp(function_name->value, "DWORD_TO_STRING"))
- return function_dword_to_string;
-
-if (!strcasecmp(function_name->value, "DWORD_TO_DATE"))
- return function_dword_to_date;
-
-if (!strcasecmp(function_name->value, "DWORD_TO_TOD"))
- return function_dword_to_tod;
-
-if (!strcasecmp(function_name->value, "DWORD_TO_DT"))
- return function_dword_to_dt;
+if (!strcasecmp(function_name->value, "LWORD_TO_BOOL"))
+ return function_lword_to_bool;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_SINT"))
+ return function_lword_to_sint;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_INT"))
+ return function_lword_to_int;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_DINT"))
+ return function_lword_to_dint;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_LINT"))
+ return function_lword_to_lint;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_USINT"))
+ return function_lword_to_usint;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_UINT"))
+ return function_lword_to_uint;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_UDINT"))
+ return function_lword_to_udint;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_ULINT"))
+ return function_lword_to_ulint;
if (!strcasecmp(function_name->value, "LWORD_TO_REAL"))
return function_lword_to_real;
@@ -857,35 +1085,20 @@
if (!strcasecmp(function_name->value, "LWORD_TO_LREAL"))
return function_lword_to_lreal;
-if (!strcasecmp(function_name->value, "LWORD_TO_SINT"))
- return function_lword_to_sint;
-
-if (!strcasecmp(function_name->value, "LWORD_TO_INT"))
- return function_lword_to_int;
-
-if (!strcasecmp(function_name->value, "LWORD_TO_DINT"))
- return function_lword_to_dint;
-
-if (!strcasecmp(function_name->value, "LWORD_TO_LINT"))
- return function_lword_to_lint;
-
-if (!strcasecmp(function_name->value, "LWORD_TO_USINT"))
- return function_lword_to_usint;
-
-if (!strcasecmp(function_name->value, "LWORD_TO_UINT"))
- return function_lword_to_uint;
-
-if (!strcasecmp(function_name->value, "LWORD_TO_UDINT"))
- return function_lword_to_udint;
-
-if (!strcasecmp(function_name->value, "LWORD_TO_ULINT"))
- return function_lword_to_ulint;
-
if (!strcasecmp(function_name->value, "LWORD_TO_TIME"))
return function_lword_to_time;
-if (!strcasecmp(function_name->value, "LWORD_TO_BOOL"))
- return function_lword_to_bool;
+if (!strcasecmp(function_name->value, "LWORD_TO_DATE"))
+ return function_lword_to_date;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_TOD"))
+ return function_lword_to_tod;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_DT"))
+ return function_lword_to_dt;
+
+if (!strcasecmp(function_name->value, "LWORD_TO_STRING"))
+ return function_lword_to_string;
if (!strcasecmp(function_name->value, "LWORD_TO_BYTE"))
return function_lword_to_byte;
@@ -896,219 +1109,6 @@
if (!strcasecmp(function_name->value, "LWORD_TO_DWORD"))
return function_lword_to_dword;
-if (!strcasecmp(function_name->value, "LWORD_TO_STRING"))
- return function_lword_to_string;
-
-if (!strcasecmp(function_name->value, "LWORD_TO_DATE"))
- return function_lword_to_date;
-
-if (!strcasecmp(function_name->value, "LWORD_TO_TOD"))
- return function_lword_to_tod;
-
-if (!strcasecmp(function_name->value, "LWORD_TO_DT"))
- return function_lword_to_dt;
-
-if (!strcasecmp(function_name->value, "STRING_TO_REAL"))
- return function_string_to_real;
-
-if (!strcasecmp(function_name->value, "STRING_TO_LREAL"))
- return function_string_to_lreal;
-
-if (!strcasecmp(function_name->value, "STRING_TO_SINT"))
- return function_string_to_sint;
-
-if (!strcasecmp(function_name->value, "STRING_TO_INT"))
- return function_string_to_int;
-
-if (!strcasecmp(function_name->value, "STRING_TO_DINT"))
- return function_string_to_dint;
-
-if (!strcasecmp(function_name->value, "STRING_TO_LINT"))
- return function_string_to_lint;
-
-if (!strcasecmp(function_name->value, "STRING_TO_USINT"))
- return function_string_to_usint;
-
-if (!strcasecmp(function_name->value, "STRING_TO_UINT"))
- return function_string_to_uint;
-
-if (!strcasecmp(function_name->value, "STRING_TO_UDINT"))
- return function_string_to_udint;
-
-if (!strcasecmp(function_name->value, "STRING_TO_ULINT"))
- return function_string_to_ulint;
-
-if (!strcasecmp(function_name->value, "STRING_TO_TIME"))
- return function_string_to_time;
-
-if (!strcasecmp(function_name->value, "STRING_TO_BOOL"))
- return function_string_to_bool;
-
-if (!strcasecmp(function_name->value, "STRING_TO_BYTE"))
- return function_string_to_byte;
-
-if (!strcasecmp(function_name->value, "STRING_TO_WORD"))
- return function_string_to_word;
-
-if (!strcasecmp(function_name->value, "STRING_TO_DWORD"))
- return function_string_to_dword;
-
-if (!strcasecmp(function_name->value, "STRING_TO_LWORD"))
- return function_string_to_lword;
-
-if (!strcasecmp(function_name->value, "STRING_TO_DATE"))
- return function_string_to_date;
-
-if (!strcasecmp(function_name->value, "STRING_TO_TOD"))
- return function_string_to_tod;
-
-if (!strcasecmp(function_name->value, "STRING_TO_DT"))
- return function_string_to_dt;
-
-if (!strcasecmp(function_name->value, "DATE_TO_REAL"))
- return function_date_to_real;
-
-if (!strcasecmp(function_name->value, "DATE_TO_LREAL"))
- return function_date_to_lreal;
-
-if (!strcasecmp(function_name->value, "DATE_TO_SINT"))
- return function_date_to_sint;
-
-if (!strcasecmp(function_name->value, "DATE_TO_INT"))
- return function_date_to_int;
-
-if (!strcasecmp(function_name->value, "DATE_TO_DINT"))
- return function_date_to_dint;
-
-if (!strcasecmp(function_name->value, "DATE_TO_LINT"))
- return function_date_to_lint;
-
-if (!strcasecmp(function_name->value, "DATE_TO_USINT"))
- return function_date_to_usint;
-
-if (!strcasecmp(function_name->value, "DATE_TO_UINT"))
- return function_date_to_uint;
-
-if (!strcasecmp(function_name->value, "DATE_TO_UDINT"))
- return function_date_to_udint;
-
-if (!strcasecmp(function_name->value, "DATE_TO_ULINT"))
- return function_date_to_ulint;
-
-if (!strcasecmp(function_name->value, "DATE_TO_BOOL"))
- return function_date_to_bool;
-
-if (!strcasecmp(function_name->value, "DATE_TO_BYTE"))
- return function_date_to_byte;
-
-if (!strcasecmp(function_name->value, "DATE_TO_WORD"))
- return function_date_to_word;
-
-if (!strcasecmp(function_name->value, "DATE_TO_DWORD"))
- return function_date_to_dword;
-
-if (!strcasecmp(function_name->value, "DATE_TO_LWORD"))
- return function_date_to_lword;
-
-if (!strcasecmp(function_name->value, "DATE_TO_STRING"))
- return function_date_to_string;
-
-if (!strcasecmp(function_name->value, "TOD_TO_REAL"))
- return function_tod_to_real;
-
-if (!strcasecmp(function_name->value, "TOD_TO_LREAL"))
- return function_tod_to_lreal;
-
-if (!strcasecmp(function_name->value, "TOD_TO_SINT"))
- return function_tod_to_sint;
-
-if (!strcasecmp(function_name->value, "TOD_TO_INT"))
- return function_tod_to_int;
-
-if (!strcasecmp(function_name->value, "TOD_TO_DINT"))
- return function_tod_to_dint;
-
-if (!strcasecmp(function_name->value, "TOD_TO_LINT"))
- return function_tod_to_lint;
-
-if (!strcasecmp(function_name->value, "TOD_TO_USINT"))
- return function_tod_to_usint;
-
-if (!strcasecmp(function_name->value, "TOD_TO_UINT"))
- return function_tod_to_uint;
-
-if (!strcasecmp(function_name->value, "TOD_TO_UDINT"))
- return function_tod_to_udint;
-
-if (!strcasecmp(function_name->value, "TOD_TO_ULINT"))
- return function_tod_to_ulint;
-
-if (!strcasecmp(function_name->value, "TOD_TO_BOOL"))
- return function_tod_to_bool;
-
-if (!strcasecmp(function_name->value, "TOD_TO_BYTE"))
- return function_tod_to_byte;
-
-if (!strcasecmp(function_name->value, "TOD_TO_WORD"))
- return function_tod_to_word;
-
-if (!strcasecmp(function_name->value, "TOD_TO_DWORD"))
- return function_tod_to_dword;
-
-if (!strcasecmp(function_name->value, "TOD_TO_LWORD"))
- return function_tod_to_lword;
-
-if (!strcasecmp(function_name->value, "TOD_TO_STRING"))
- return function_tod_to_string;
-
-if (!strcasecmp(function_name->value, "DT_TO_REAL"))
- return function_dt_to_real;
-
-if (!strcasecmp(function_name->value, "DT_TO_LREAL"))
- return function_dt_to_lreal;
-
-if (!strcasecmp(function_name->value, "DT_TO_SINT"))
- return function_dt_to_sint;
-
-if (!strcasecmp(function_name->value, "DT_TO_INT"))
- return function_dt_to_int;
-
-if (!strcasecmp(function_name->value, "DT_TO_DINT"))
- return function_dt_to_dint;
-
-if (!strcasecmp(function_name->value, "DT_TO_LINT"))
- return function_dt_to_lint;
-
-if (!strcasecmp(function_name->value, "DT_TO_USINT"))
- return function_dt_to_usint;
-
-if (!strcasecmp(function_name->value, "DT_TO_UINT"))
- return function_dt_to_uint;
-
-if (!strcasecmp(function_name->value, "DT_TO_UDINT"))
- return function_dt_to_udint;
-
-if (!strcasecmp(function_name->value, "DT_TO_ULINT"))
- return function_dt_to_ulint;
-
-if (!strcasecmp(function_name->value, "DT_TO_BOOL"))
- return function_dt_to_bool;
-
-if (!strcasecmp(function_name->value, "DT_TO_BYTE"))
- return function_dt_to_byte;
-
-if (!strcasecmp(function_name->value, "DT_TO_WORD"))
- return function_dt_to_word;
-
-if (!strcasecmp(function_name->value, "DT_TO_DWORD"))
- return function_dt_to_dword;
-
-if (!strcasecmp(function_name->value, "DT_TO_LWORD"))
- return function_dt_to_lword;
-
-if (!strcasecmp(function_name->value, "DT_TO_STRING"))
- return function_dt_to_string;
-
if (!strcasecmp(function_name->value, "TRUNC"))
return function_trunc;
diff -r e08c65e27557 -r 873a5b60a7ea stage4/generate_cc/iec_std_lib.h
--- a/stage4/generate_cc/iec_std_lib.h Wed Jul 11 09:53:27 2007 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,920 +0,0 @@
-/****
- * IEC 61131-3 standard function lib
- */
-
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-
-
-/* Macro that expand to subtypes */
-#define ANY(DO) ANY_DERIVED(DO) ANY_ELEMENTARY(DO)
-#define ANY_DERIVED(DO)
-#define ANY_ELEMENTARY(DO) ANY_MAGNITUDE(DO) ANY_BIT(DO) ANY_STRING(DO) ANY_DATE(DO)
-#define ANY_MAGNITUDE(DO) ANY_NUM(DO) DO(TIME)
-#define ANY_BIT(DO) ANY_NBIT(DO) DO(BOOL)
-#define ANY_NBIT(DO) DO(BYTE) DO(WORD) DO(DWORD) DO(LWORD)
-#define ANY_STRING(DO) DO(STRING) /*DO(WSTRING) TODO */
-#define ANY_DATE(DO) DO(DATE) DO(TOD) DO(DT)
-#define ANY_NUM(DO) ANY_REAL(DO) ANY_INT(DO)
-#define ANY_REAL(DO) DO(REAL) DO(LREAL)
-#define ANY_INT(DO) ANY_SINT(DO) ANY_UINT(DO)
-#define ANY_SINT(DO) DO(SINT) DO(INT) DO(DINT) DO(LINT)
-#define ANY_UINT(DO) DO(USINT) DO(UINT) DO(UDINT) DO(ULINT)
-
-/*****************/
-/* Types defs */
-/*****************/
-
-typedef u_int8_t BOOL;
-
-#define TRUE 1
-#define FALSE 0
-
-typedef int8_t SINT;
-typedef int16_t INT;
-typedef int32_t DINT;
-typedef int64_t LINT;
-
-typedef u_int8_t USINT;
-typedef u_int16_t UINT;
-typedef u_int32_t UDINT;
-typedef u_int64_t ULINT;
-
-typedef u_int8_t BYTE;
-typedef u_int16_t WORD;
-typedef u_int32_t DWORD;
-typedef u_int64_t LWORD;
-
-typedef float REAL;
-typedef double LREAL;
-
-typedef struct timespec TIME;
-typedef struct timespec DATE;
-typedef struct timespec DT;
-typedef struct timespec TOD;
-
-#define __TIME_CMP(t1, t2) (t2.tv_sec == t1.tv_sec ? t2.tv_nsec - t1.tv_nsec : t1.tv_sec - t2.tv_sec)
-
-#define STR_MAX_LEN 40
-typedef int8_t __strlen_t;
-typedef struct {
- __strlen_t len;
- u_int8_t body[STR_MAX_LEN];
-} STRING;
-
-#define __STR_CMP(str1, str2) memcmp((char*)&str1.body,(char*)&str2.body, str1.len < str2.len ? str1.len : str2.len)
-
-
-/* TODO
-typedef struct {
- __strlen_t len;
- u_int16_t body[STR_MAX_LEN];
-} WSTRING;
-*/
-
-typedef union __IL_DEFVAR_T {
- BOOL BOOLvar;
-
- SINT SINTvar;
- INT INTvar;
- DINT DINTvar;
- LINT LINTvar;
-
- USINT USINTvar;
- UINT UINTvar;
- UDINT UDINTvar;
- ULINT ULINTvar;
-
- BYTE BYTEvar;
- WORD WORDvar;
- DWORD DWORDvar;
- LWORD LWORDvar;
-
- REAL REALvar;
- LREAL LREALvar;
-
- TIME TIMEvar;
- TOD TODvar;
- DT DTvar;
- DATE DATEvar;
-} __IL_DEFVAR_T;
-
-
-
-
-/*****************/
-/* Misc internal */
-/*****************/
-
-/* function that generates an IEC runtime error */
-void IEC_error(void) {
- /* TODO... */
- fprintf(stderr, "IEC 61131-3 runtime error.\n");
- /*exit(1);*/
-}
-
-
-static inline void __normalize_timespec (struct timespec *ts) {
- if( ts->tv_nsec < -1000000000 || (( ts->tv_sec > 0 ) && ( ts->tv_nsec < 0 ))){
- ts->tv_sec--;
- ts->tv_nsec += 1000000000;
- }
- if( ts->tv_nsec > 1000000000 || (( ts->tv_sec < 0 ) && ( ts->tv_nsec > 0 ))){
- ts->tv_sec++;
- ts->tv_nsec -= 1000000000;
- }
-}
-
-static inline struct timespec __time_to_timespec(int sign, double mseconds, double seconds, double minutes, double hours, double days) {
- struct timespec ts;
-
- /* sign is 1 for positive values, -1 for negative time... */
- long double total_sec = ((days*24 + hours)*60 + minutes)*60 + seconds + mseconds/1e3;
- if (sign >= 0) sign = 1; else sign = -1;
- ts.tv_sec = sign * (long int)total_sec;
- ts.tv_nsec = sign * (long int)((total_sec - ts.tv_sec)*1e9);
-
- return ts;
-}
-
-
-static inline struct timespec __tod_to_timespec(double seconds, double minutes, double hours) {
- struct timespec ts;
-
- long double total_sec = (hours*60 + minutes)*60 + seconds;
- ts.tv_sec = (long int)total_sec;
- ts.tv_nsec = (long int)((total_sec - ts.tv_sec)*1e9);
-
- return ts;
-}
-
-static inline struct timespec __date_to_timespec(int day, int month, int year) {
- struct timespec ts;
- struct tm broken_down_time;
-
- broken_down_time.tm_sec = 0;
- broken_down_time.tm_min = 0;
- broken_down_time.tm_hour = 0;
- broken_down_time.tm_mday = day; /* day of month, from 1 to 31 */
- broken_down_time.tm_mon = month - 1; /* month since January, in the range 0 to 11 */
- broken_down_time.tm_year = year - 1900; /* number of years since 1900 */
-
- time_t epoch_seconds = mktime(&broken_down_time); /* determine number of seconds since the epoch, i.e. Jan 1st 1970 */
-
- if ((time_t)(-1) == epoch_seconds)
- IEC_error();
-
- ts.tv_sec = epoch_seconds;
- ts.tv_nsec = 0;
-
- return ts;
-}
-
-static inline struct timespec __dt_to_timespec(double seconds, double minutes, double hours, int day, int month, int year) {
- struct timespec ts;
-
- long double total_sec = (hours*60 + minutes)*60 + seconds;
- ts.tv_sec = (long int)total_sec;
- ts.tv_nsec = (long int)((total_sec - ts.tv_sec)*1e9);
-
- struct tm broken_down_time;
- broken_down_time.tm_sec = 0;
- broken_down_time.tm_min = 0;
- broken_down_time.tm_hour = 0;
- broken_down_time.tm_mday = day; /* day of month, from 1 to 31 */
- broken_down_time.tm_mon = month - 1; /* month since January, in the range 0 to 11 */
- broken_down_time.tm_year = year - 1900; /* number of years since 1900 */
-
- time_t epoch_seconds = mktime(&broken_down_time); /* determine number of seconds since the epoch, i.e. Jan 1st 1970 */
- if ((time_t)(-1) == epoch_seconds)
- IEC_error();
-
- ts.tv_sec += epoch_seconds;
- if (ts.tv_sec < epoch_seconds)
- /* since the TOD is always positive, if the above happens then we had an overflow */
- IEC_error();
-
- return ts;
-}
-
-/***************/
-/* Time ops */
-/***************/
-inline TIME __date_and_time_to_time_of_day(TIME IN){
- return (TIME){IN.tv_sec % 86400, IN.tv_nsec};
-}
-inline TIME __date_and_time_to_date(TIME IN){
- return (TIME){IN.tv_sec - (IN.tv_sec % (24*60*60)), 0};
-}
-inline TIME __time_add(TIME IN1, TIME IN2){
- TIME res ={IN1.tv_sec + IN2.tv_sec,
- IN1.tv_nsec + IN2.tv_nsec };
- __normalize_timespec(&res);
- return res;
-}
-inline TIME __time_sub(TIME IN1, TIME IN2){
- TIME res ={IN1.tv_sec - IN2.tv_sec,
- IN1.tv_nsec - IN2.tv_nsec };
- __normalize_timespec(&res);
- return res;
-}
-inline TIME __time_mul(TIME IN1, LREAL IN2){
- LREAL s_f = IN1.tv_sec * IN2;
- time_t s = s_f;
- div_t ns = div((LREAL)IN1.tv_nsec * IN2, 1000000000);
- TIME res = {s + ns.quot,
- ns.rem + (s_f - s) * 1000000000 };
- __normalize_timespec(&res);
- return res;
-}
-inline TIME __time_div(TIME IN1, LREAL IN2){
- LREAL s_f = IN1.tv_sec / IN2;
- time_t s = s_f;
- TIME res = {s,
- IN1.tv_nsec / IN2 + (s_f - s) * 1000000000 };
- __normalize_timespec(&res);
- return res;
-}
-
-/***************/
-/* String ops */
-/***************/
-inline UINT __len(STRING IN){
- return IN.len;
-}
-inline STRING __left(STRING IN, SINT L){
- STRING res = {0,};
- memcpy(&res.body, &IN.body, L < res.len ? L : res.len);
- return res;
-}
-inline STRING __right(STRING IN, SINT L){
- STRING res = {0,};
- L = L < IN.len ? L : IN.len;
- memcpy(&res, &IN.body[IN.len - L], L);
- res.len = L;
- return res;
-}
-inline STRING __mid(STRING IN, SINT L, SINT P){
- STRING res = {0,};
- if(P <= IN.len){
- P -= 1; /* now can be used as [index]*/
- L = L + P <= IN.len ? L : IN.len - P;
- memcpy(&res, &IN.body[P] , L);
- res.len = L;
- }
- return res;
-}
-inline STRING __concat(SINT param_count, ...){
- va_list ap;
- UINT i;
- __strlen_t charcount = 0;
- STRING res = {0,};
-
- va_start (ap, param_count); /* Initialize the argument list. */
-
- for (i = 0; i < param_count && charcount < STR_MAX_LEN; i++)
- {
- STRING tmp = va_arg(ap, STRING);
- __strlen_t charrem = STR_MAX_LEN - charcount;
- __strlen_t to_write = tmp.len > charrem ? charrem : tmp.len;
- memcpy(&res.body[charcount], &tmp.body , to_write);
- charcount += to_write;
- }
-
- res.len = charcount;
-
- va_end (ap); /* Clean up. */
- return res;
-}
-inline STRING __insert(STRING IN1, STRING IN2, SINT P){
- STRING res = {0,};
- __strlen_t to_copy;
-
- to_copy = P > IN1.len ? IN1.len : P;
- memcpy(&res.body, &IN1.body , to_copy);
- P = res.len = to_copy;
-
- to_copy = IN2.len + res.len > STR_MAX_LEN ? STR_MAX_LEN - res.len : IN2.len;
- memcpy(&res.body[res.len], &IN2.body , to_copy);
- res.len += to_copy;
-
- to_copy = IN1.len - P < STR_MAX_LEN - res.len ? IN1.len - P : STR_MAX_LEN - res.len ;
- memcpy(&res.body[res.len], &IN1.body[P] , to_copy);
- res.len += to_copy;
-
- return res;
-}
-inline STRING __delete(STRING IN, SINT L_value, SINT P){
- STRING res = {0,};
- __strlen_t to_copy;
-
- to_copy = P > IN.len ? IN.len : P;
- memcpy(&res.body, &IN.body , to_copy);
- P = res.len = to_copy;
-
- to_copy = IN.len - P;
- memcpy(&res.body[res.len], &IN.body[P] , to_copy);
- res.len += to_copy;
-
- return res;
-}
-inline STRING __replace(STRING IN1, STRING IN2, SINT L, SINT P){
- STRING res = {0,};
- __strlen_t to_copy;
-
- to_copy = P > IN1.len ? IN1.len : P;
- memcpy(&res.body, &IN1.body , to_copy);
- P = res.len = to_copy;
-
- to_copy = IN2.len + res.len > STR_MAX_LEN ? STR_MAX_LEN - res.len : IN2.len;
- memcpy(&res.body[res.len], &IN2.body , to_copy);
- res.len += to_copy;
-
- to_copy = res.len < IN1.len ? IN1.len - res.len : 0;
- memcpy(&res.body[res.len], &IN1.body[res.len] , to_copy);
- res.len += to_copy;
-
- return res;
-}
-
-
-
-inline UINT __pfind(STRING* IN1, STRING* IN2){
- UINT count1 = 0;
- UINT count2 = 0;
- while(count1 + count2 < IN1->len && count2 < IN2->len)
- {
- if(IN1->body[count1 + count2] != IN2->body[count2++]){
- count1 += count2;
- count2 = 0;
- }
- }
- return count2 == IN2->len ? 0 : count1;
-}
-inline UINT __find(STRING IN1, STRING IN2){
- return __pfind(&IN1, &IN2);
-}
-
-/***************/
-/* Convertions */
-/***************/
- /***************/
- /* TO_STRING */
- /***************/
-inline STRING __bool_to_string(BOOL IN)
-{
- if(IN)
- return (STRING){4, "TRUE"};
- return (STRING){5,"FALSE"};
-}
-inline STRING __bit_to_string(LWORD IN){
- STRING res = {0,};
- res.len = snprintf(res.body, STR_MAX_LEN, "16#%llx", IN);
- if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN;
- return res;
-}
-inline STRING __real_to_string(LREAL IN){
- STRING res = {0,};
- res.len = snprintf(res.body, STR_MAX_LEN, "%g", IN);
- if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN;
- return res;
-}
-inline STRING __sint_to_string(LINT IN){
- STRING res = {0,};
- res.len = snprintf(res.body, STR_MAX_LEN, "%lld", IN);
- if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN;
- return res;
-}
-inline STRING __uint_to_string(ULINT IN){
- STRING res = {0,};
- res.len = snprintf(res.body, STR_MAX_LEN, "16#%llu", IN);
- if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN;
- return res;
-}
- /***************/
- /* FROM_STRING */
- /***************/
-inline BOOL __string_to_bool(STRING IN){
- return IN.len == 5 ? !memcmp(&IN.body,"TRUE", IN.len) : 0;
-}
-
-inline LINT __pstring_to_sint(STRING* IN){
- LINT res = 0;
- char tmp[STR_MAX_LEN];
- char tmp2[STR_MAX_LEN];
- __strlen_t l;
- unsigned int shift = 0;
-
- if(IN->body[0]=='2' && IN->body[1]=='#'){
- /* 2#0101_1010_1011_1111 */
- for(l = IN->len - 1; l >= 2 && shift < 64; l--)
- {
- char c = IN->body[l];
- if( c >= '0' && c <= '1'){
- res |= ( c - '0') << shift;
- shift += 1;
- }
- }
- }else if(IN->body[0]=='8' && IN->body[1]=='#'){
- /* 8#1234_5665_4321 */
- for(l = IN->len - 1; l >= 2 && shift < 64; l--)
- {
- char c = IN->body[l];
- if( c >= '0' && c <= '7'){
- res |= ( c - '0') << shift;
- shift += 3;
- }
- }
- }else if(IN->body[0]=='1' && IN->body[1]=='6' && IN->body[1]=='#'){
- /* 16#1234_5678_9abc_DEFG */
- for(l = IN->len - 1; l >= 3 && shift < 64; l--)
- {
- char c = IN->body[l];
- if( c >= '0' && c <= '9'){
- res |= ( c - '0') << shift;
- shift += 4;
- }else if( c >= 'a' && c <= 'f'){
- res |= ( c - 'a' + 10 ) << shift;
- shift += 4;
- }else if( c >= 'A' && c <= 'F'){
- res |= ( c - 'A' + 10 ) << shift;
- shift += 4;
- }
- }
- }else{
- /* -123456789 */
- LINT fac = IN->body[0] == '-' ? -1 : 1;
- for(l = IN->len - 1; l >= 0 && shift < 20; l--)
- {
- char c = IN->body[l];
- if( c >= '0' && c <= '9'){
- res += ( c - '0') * fac;
- fac *= 10;
- shift += 1;
- }
- }
- }
- return res;
-}
-
-inline LINT __string_to_sint(STRING IN){
- return (LWORD)__pstring_to_sint(&IN);
-}
-inline LWORD __string_to_bit(STRING IN){
- return (LWORD)__pstring_to_sint(&IN);
-}
-inline ULINT __string_to_uint(STRING IN){
- return (ULINT)__pstring_to_sint(&IN);
-}
-inline LREAL __string_to_real(STRING IN){
- /* search the dot */
- __strlen_t l = IN.len;
- while(--l > 0 && IN.body[l] != '.');
- if(l != 0){
- return atof((const char *)&IN.body);
- }else{
- return (LREAL)__pstring_to_sint(&IN);
- }
-}
-
- /***************/
- /* TO_TIME */
- /***************/
-inline TIME __int_to_time(LINT IN){
- return (TIME){IN, 0};
-}
-
-inline TIME __real_to_time(LREAL IN){
- return (TIME){IN, (IN - (LINT)IN) * 1000000000};
-}
-inline TIME __string_to_time(STRING IN){
- /* TODO :
- *
- * Duration literals without underlines: T#14ms T#-14ms T#14.7s T#14.7m
- * short prefix T#14.7h t#14.7d t#25h15m
- * t#5d14h12m18s3.5ms
- * long prefix TIME#14ms TIME#-14ms time#14.7s
- * Duration literals with underlines:
- * short prefix t#25h_15m t#5d_14h_12m_18s_3.5ms
- * long prefix TIME#25h_15m
- * time#5d_14h_12m_18s_3.5ms
- *
- * Long prefix notation Short prefix notation
- * DATE#1984-06-25 D#1984-06-25
- * date#1984-06-25 d#1984-06-25
- * TIME_OF_DAY#15:36:55.36 TOD#15:36:55.36
- * time_of_day#15:36:55.36 tod#15:36:55.36
- * DATE_AND_TIME#1984-06-25-15:36:55.36 DT#1984-06-25-15:36:55.36
- * date_and_time#1984-06-25-15:36:55.36 dt#1984-06-25-15:36:55.36
- *
- */
- /* Quick hack : only transform seconds */
- /* search the dot */
- __strlen_t l = IN.len;
- while(--l > 0 && IN.body[l] != '.');
- if(l != 0){
- LREAL IN_val = atof((const char *)&IN.body);
- return (TIME){IN_val, (IN_val - (LINT)IN_val)*1000000000};
- }else{
- return (TIME){__pstring_to_sint(&IN), 0};
- }
-}
-
- /***************/
- /* FROM_TIME */
- /***************/
-inline LREAL __time_to_real(TIME IN){
- return (LREAL)IN.tv_sec + ((LREAL)IN.tv_nsec/1000000000);
-}
-inline LINT __time_to_int(TIME IN){
- return IN.tv_sec;
-}
-inline STRING __time_to_string(TIME IN){
- /*t#5d14h12m18s3.5ms*/
- STRING res = {0,};
- div_t days = div(IN.tv_sec ,86400);
- if(!days.rem && IN.tv_nsec == 0){
- res.len = snprintf((char*)&res.body, STR_MAX_LEN, "T#%dd", days.quot);
- }else{
- div_t hours = div(days.rem, 3600);
- if(!hours.rem && IN.tv_nsec == 0){
- res.len = snprintf((char*)&res.body, STR_MAX_LEN, "T#%dd%dh", days.quot, hours.quot);
- }else{
- div_t minuts = div(hours.rem, 60);
- if(!minuts.rem && IN.tv_nsec == 0){
- res.len = snprintf((char*)&res.body, STR_MAX_LEN, "T#%dd%dh%dm", days.quot, hours.quot, minuts.quot);
- }else{
- if(IN.tv_nsec == 0){
- res.len = snprintf((char*)&res.body, STR_MAX_LEN, "T#%dd%dh%dm%ds", days.quot, hours.quot, minuts.quot, minuts.rem);
- }else{
- res.len = snprintf((char*)&res.body, STR_MAX_LEN, "T#%dd%dh%dm%ds%gms", days.quot, hours.quot, minuts.quot, minuts.rem, IN.tv_nsec / 1000000);
- }
- }
- }
- }
- if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN;
- return res;
-}
-inline STRING __date_to_string(DATE IN){
- /* D#1984-06-25 */
- STRING res = {0,};
- struct tm broken_down_time;
- time_t seconds = IN.tv_sec;
- if (NULL == gmtime_r(&seconds, &broken_down_time)){ /* get the UTC (GMT) broken down time */
- IEC_error();
- return (STRING){7,"D#ERROR"};
- }
- res.len = snprintf((char*)&res.body, STR_MAX_LEN, "D#%d-%2.2d-%2.2d", broken_down_time.tm_year, broken_down_time.tm_mon, broken_down_time.tm_mday);
- if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN;
- return res;
-}
-inline STRING __tod_to_string(TOD IN){
- /* TOD#15:36:55.36 */
- STRING res = {0,};
- struct tm broken_down_time;
- time_t seconds = IN.tv_sec;
- if (NULL == gmtime_r(&seconds, &broken_down_time)){ /* get the UTC (GMT) broken down time */
- IEC_error();
- return (STRING){9,"TOD#ERROR"};
- }
- if(IN.tv_nsec == 0){
- res.len = snprintf((char*)&res.body, STR_MAX_LEN, "TOD#%2.2d:%2.2d:%d", broken_down_time.tm_hour, broken_down_time.tm_min, broken_down_time.tm_sec);
- }else{
- res.len = snprintf((char*)&res.body, STR_MAX_LEN, "TOD#%2.2d:%2.2d:%g", broken_down_time.tm_hour, broken_down_time.tm_min, (LREAL)broken_down_time.tm_sec + (LREAL)IN.tv_nsec / 1000000);
- }
- if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN;
- return res;
-}
-inline STRING __dt_to_string(DT IN){
- /* DT#1984-06-25-15:36:55.36 */
- STRING res;
- struct tm broken_down_time;
- time_t seconds = IN.tv_sec;
- if (NULL == gmtime_r(&seconds, &broken_down_time)){ /* get the UTC (GMT) broken down time */
- IEC_error();
- return (STRING){8,"DT#ERROR"};
- }
- if(IN.tv_nsec == 0){
- res.len = snprintf((char*)&res.body, STR_MAX_LEN, "DT#%d-%2.2d-%2.2d-%2.2d:%2.2d:%d",
- broken_down_time.tm_year,
- broken_down_time.tm_mon,
- broken_down_time.tm_mday,
- broken_down_time.tm_hour,
- broken_down_time.tm_min,
- broken_down_time.tm_sec);
- }else{
- res.len = snprintf((char*)&res.body, STR_MAX_LEN, "DT#%d-%2.2d-%2.2d-%2.2d:%2.2d:%d",
- broken_down_time.tm_year,
- broken_down_time.tm_mon,
- broken_down_time.tm_mday,
- broken_down_time.tm_hour,
- broken_down_time.tm_min,
- (LREAL)broken_down_time.tm_sec + ((LREAL)IN.tv_nsec / 1000000));
- }
- if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN;
- return res;
-}
- /* BCD */
-inline ULINT __bcd_to_uint(LWORD IN){
- return IN & 0xf +
- ((IN >>= 4) & 0xf) * 10 +
- ((IN >>= 4) & 0xf) * 100 +
- ((IN >>= 4) & 0xf) * 1000 +
- ((IN >>= 4) & 0xf) * 10000 +
- ((IN >>= 4) & 0xf) * 100000 +
- ((IN >>= 4) & 0xf) * 1000000 +
- ((IN >>= 4) & 0xf) * 10000000 +
- ((IN >>= 4) & 0xf) * 100000000 +
- ((IN >>= 4) & 0xf) * 1000000000 +
- ((IN >>= 4) & 0xf) * 10000000000 +
- ((IN >>= 4) & 0xf) * 100000000000 +
- ((IN >>= 4) & 0xf) * 1000000000000 +
- ((IN >>= 4) & 0xf) * 10000000000000 +
- ((IN >>= 4) & 0xf) * 100000000000000 +
- ((IN >>= 4) & 0xf) * 1000000000000000;
-}
-inline LWORD __uint_to_bcd(ULINT IN){
- return (IN - (IN /= 10))|
- (IN - (IN /= 10)) << 4 |
- (IN - (IN /= 10)) << 8 |
- (IN - (IN /= 10)) << 12 |
- (IN - (IN /= 10)) << 16 |
- (IN - (IN /= 10)) << 20 |
- (IN - (IN /= 10)) << 24 |
- (IN - (IN /= 10)) << 28 |
- (IN - (IN /= 10)) << 32 |
- (IN - (IN /= 10)) << 36 |
- (IN - (IN /= 10)) << 40 |
- (IN - (IN /= 10)) << 44 |
- (IN - (IN /= 10)) << 48 |
- (IN - (IN /= 10)) << 52 |
- (IN - (IN /= 10)) << 56 |
- (IN - (IN /= 10)) << 60;
-}
-
-/**************/
-/* Binary ops */
-/**************/
-#define __ror_(TYPENAME)\
-inline TYPENAME __ror_##TYPENAME( TYPENAME IN, USINT N){\
- N %= 8*sizeof(TYPENAME);\
- return (IN >> N) | (IN << 8*sizeof(TYPENAME)-N);\
-}
-/* Call previously defined macro for each ANY_NBIT */
-ANY_NBIT(__ror_)
-
-#define __rol_(TYPENAME)\
-inline TYPENAME __rol_##TYPENAME( TYPENAME IN, USINT N){\
- N %= 8*sizeof(TYPENAME);\
- return (IN << N) | (IN >> 8*sizeof(TYPENAME)-N);\
-}
-/* Call previously defined macro for each ANY_NBIT */
-ANY_NBIT(__rol_)
-
-/**************/
-/* Selection */
-/**************/
- /**************/
- /* limit */
- /**************/
-
-#define __limit_(TYPENAME)\
-inline TYPENAME __limit_##TYPENAME( TYPENAME MN, TYPENAME IN, TYPENAME MX){\
- return IN > MN ? IN < MX ? IN : MX : MN;\
-}
-
-/* Call previously defined macro for each concerned type */
-ANY_NBIT(__limit_)
-ANY_NUM(__limit_)
-
-#define __limit_time(TYPENAME)\
-inline TIME __limit_##TYPENAME( TYPENAME MN, TYPENAME IN, TYPENAME MX){\
- return __TIME_CMP(IN, MN) > 0 ? /* IN>MN ?*/\
- __TIME_CMP(IN, MX) < 0 ? /* IN 0 ? __STR_CMP(IN, MX) < 0 ? IN : MX : MN;
-}
-
- /**************/
- /* MAX */
- /**************/
-
-/* workaround for va-atgs limitation on shorter that int params */
-#define VA_ARGS_REAL LREAL
-#define VA_ARGS_LREAL LREAL
-#define VA_ARGS_SINT DINT
-#define VA_ARGS_INT DINT
-#define VA_ARGS_DINT DINT
-#define VA_ARGS_LINT LINT
-#define VA_ARGS_USINT UDINT
-#define VA_ARGS_UINT UDINT
-#define VA_ARGS_UDINT UDINT
-#define VA_ARGS_ULINT ULINT
-#define VA_ARGS_TIME TIME
-#define VA_ARGS_BOOL DWORD
-#define VA_ARGS_BYTE DWORD
-#define VA_ARGS_WORD DWORD
-#define VA_ARGS_DWORD DWORD
-#define VA_ARGS_LWORD LWORD
-#define VA_ARGS_STRING STRING
-#define VA_ARGS_WSTRING WSTRING
-#define VA_ARGS_DATE DATE
-#define VA_ARGS_TOD TOD
-#define VA_ARGS_DT DT
-
-#define __extrem_(fname,TYPENAME, COND) \
-inline TYPENAME fname##TYPENAME( UINT param_count, TYPENAME op1, ...){\
- va_list ap;\
- UINT i;\
- \
- va_start (ap, op1); /* Initialize the argument list. */\
- \
- for (i = 0; i < param_count; i++){\
- TYPENAME tmp = va_arg (ap, VA_ARGS_##TYPENAME);\
- op1 = COND ? tmp : op1;\
- }\
- \
- va_end (ap); /* Clean up. */\
- return op1;\
-}
-
-#define __max_num(TYPENAME) __extrem_(__max_,TYPENAME, op1 < tmp)
-ANY_NBIT(__max_num)
-ANY_NUM(__max_num)
-
-__extrem_(__max_, STRING, __STR_CMP(op1,tmp) < 0)
-#define __max_time(TYPENAME) __extrem_(__max_, TYPENAME, __TIME_CMP(op1, tmp) < 0)
-
-/* Call previously defined macro for each concerned type */
-ANY_DATE(__max_time)
-__max_time(TIME)
-
- /**************/
- /* MIN */
- /**************/
-#define __min_num(TYPENAME) __extrem_(__min, TYPENAME, op1 > tmp)
-ANY_NBIT(__min_num)
-ANY_NUM(__min_num)
-
-__extrem_(__min, STRING, __STR_CMP(op1,tmp) > 0)
-
-#define __min_time(TYPENAME) __extrem_(__min_, TYPENAME, __TIME_CMP(op1, tmp) > 0)
-
-/* Call previously defined macro for each concerned type */
-ANY_DATE(__min_time)
-__min_time(TIME)
-
- /**************/
- /* MUX */
- /**************/
-#define __mux_(TYPENAME) \
-inline TYPENAME __mux_##TYPENAME( UINT param_count, UINT K, TYPENAME op1, ...){\
- va_list ap;\
- UINT i;\
- \
- va_start (ap, op1); /* Initialize the argument list. */\
- \
- for (i = 0; i < param_count; i++){\
- if(K == i){\
- TYPENAME tmp = va_arg (ap, VA_ARGS_##TYPENAME);\
- va_end (ap); /* Clean up. */\
- return tmp;\
- }else{\
- va_arg (ap, VA_ARGS_##TYPENAME);\
- }\
- }\
- \
- va_end (ap); /* Clean up. */\
- return op1;\
-}
-
-ANY(__mux_)
-
-/**************/
-/* Comparison */
-/**************/
-
-#define __compare_(fname,TYPENAME, COND) \
-inline BOOL fname##TYPENAME( UINT param_count, TYPENAME op1, ...){\
- va_list ap;\
- UINT i;\
- \
- va_start (ap, op1); /* Initialize the argument list. */\
- \
- for (i = 0; i < param_count; i++){\
- TYPENAME tmp = va_arg (ap, VA_ARGS_##TYPENAME);\
- if(COND){\
- op1 = tmp;\
- }else{\
- va_end (ap); /* Clean up. */\
- return 0;\
- }\
- }\
- \
- va_end (ap); /* Clean up. */\
- return 1;\
-}
-
-#define __compare_num(fname, TYPENAME, TEST) __compare_(fname, TYPENAME, op1 TEST tmp )
-#define __compare_time(fname, TYPENAME, TEST) __compare_(fname, TYPENAME, __TIME_CMP(op1, tmp) TEST 0)
-#define __compare_string(fname, TEST) __compare_(fname, STRING, __STR_CMP(op1, tmp) TEST 0 )
-
- /**************/
- /* GT */
- /**************/
-
-#define __gt_num(TYPENAME) __compare_num(__gt_, TYPENAME, > )
-ANY_NBIT(__gt_num)
-ANY_NUM(__gt_num)
-
-#define __gt_time(TYPENAME) __compare_time(__gt_, TYPENAME, > )
-ANY_DATE(__gt_time)
-__gt_time(TIME)
-
-__compare_string(__gt_, > )
-
- /**************/
- /* GE */
- /**************/
-
-#define __ge_num(TYPENAME) __compare_num(__ge_, TYPENAME, >= )
-ANY_NBIT(__ge_num)
-ANY_NUM(__ge_num)
-
-#define __ge_time(TYPENAME) __compare_time(__ge_, TYPENAME, >= )
-ANY_DATE(__ge_time)
-__ge_time(TIME)
-
-__compare_string(__ge_, >=)
-
- /**************/
- /* EQ */
- /**************/
-
-#define __eq_num(TYPENAME) __compare_num(__eq_, TYPENAME, == )
-ANY_NBIT(__eq_num)
-ANY_NUM(__eq_num)
-
-#define __eq_time(TYPENAME) __compare_time(__eq_, TYPENAME, == )
-ANY_DATE(__eq_time)
-__eq_time(TIME)
-
-__compare_string(__eq_, == )
-
- /**************/
- /* LT */
- /**************/
-
-#define __lt_num(TYPENAME) __compare_num(__lt_, TYPENAME, < )
-ANY_NBIT(__lt_num)
-ANY_NUM(__lt_num)
-
-#define __lt_time(TYPENAME) __compare_time(__lt_, TYPENAME, < )
-ANY_DATE(__lt_time)
-__lt_time(TIME)
-
-__compare_string(__lt_, < )
-
- /**************/
- /* LE */
- /**************/
-
-#define __le_num(TYPENAME) __compare_num(__le_, TYPENAME, <= )
-ANY_NBIT(__le_num)
-ANY_NUM(__le_num)
-
-#define __le_time(TYPENAME) __compare_time(__le_, TYPENAME, <= )
-ANY_DATE(__le_time)
-__le_time(TIME)
-
-__compare_string(__le_, <= )
-
- /**************/
- /* NE */
- /**************/
-
-#define __ne_num(TYPENAME) __compare_num(__ne_, TYPENAME, != )
-ANY_NBIT(__ne_num)
-ANY_NUM(__ne_num)
-
-#define __ne_time(TYPENAME) __compare_time(__ne_, TYPENAME, != )
-ANY_DATE(__ne_time)
-__ne_time(TIME)
-
-__compare_string(__ne_, != )
-
-
diff -r e08c65e27557 -r 873a5b60a7ea stage4/generate_cc/il_code_gen.c
--- a/stage4/generate_cc/il_code_gen.c Wed Jul 11 09:53:27 2007 +0200
+++ b/stage4/generate_cc/il_code_gen.c Thu Jul 12 11:24:32 2007 +0200
@@ -6,6 +6,5811 @@
switch(current_function_type){
/****
+ *BOOL_TO_SINT
+ */
+ case function_bool_to_sint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_bool_to_sint*/
+ break;
+
+/****
+ *BOOL_TO_INT
+ */
+ case function_bool_to_int :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_bool_to_int*/
+ break;
+
+/****
+ *BOOL_TO_DINT
+ */
+ case function_bool_to_dint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_bool_to_dint*/
+ break;
+
+/****
+ *BOOL_TO_LINT
+ */
+ case function_bool_to_lint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_bool_to_lint*/
+ break;
+
+/****
+ *BOOL_TO_USINT
+ */
+ case function_bool_to_usint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_bool_to_usint*/
+ break;
+
+/****
+ *BOOL_TO_UINT
+ */
+ case function_bool_to_uint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_bool_to_uint*/
+ break;
+
+/****
+ *BOOL_TO_UDINT
+ */
+ case function_bool_to_udint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_bool_to_udint*/
+ break;
+
+/****
+ *BOOL_TO_ULINT
+ */
+ case function_bool_to_ulint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_bool_to_ulint*/
+ break;
+
+/****
+ *BOOL_TO_REAL
+ */
+ case function_bool_to_real :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_bool_to_real*/
+ break;
+
+/****
+ *BOOL_TO_LREAL
+ */
+ case function_bool_to_lreal :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_bool_to_lreal*/
+ break;
+
+/****
+ *BOOL_TO_TIME
+ */
+ case function_bool_to_time :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__int_to_time(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_bool_to_time*/
+ break;
+
+/****
+ *BOOL_TO_DATE
+ */
+ case function_bool_to_date :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__int_to_time(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_bool_to_date*/
+ break;
+
+/****
+ *BOOL_TO_TOD
+ */
+ case function_bool_to_tod :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__int_to_time(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_bool_to_tod*/
+ break;
+
+/****
+ *BOOL_TO_DT
+ */
+ case function_bool_to_dt :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__int_to_time(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_bool_to_dt*/
+ break;
+
+/****
+ *BOOL_TO_STRING
+ */
+ case function_bool_to_string :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__bool_to_string(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_bool_to_string*/
+ break;
+
+/****
+ *BOOL_TO_BYTE
+ */
+ case function_bool_to_byte :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_bool_to_byte*/
+ break;
+
+/****
+ *BOOL_TO_WORD
+ */
+ case function_bool_to_word :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_bool_to_word*/
+ break;
+
+/****
+ *BOOL_TO_DWORD
+ */
+ case function_bool_to_dword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_bool_to_dword*/
+ break;
+
+/****
+ *BOOL_TO_LWORD
+ */
+ case function_bool_to_lword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_bool_to_lword*/
+ break;
+
+/****
+ *SINT_TO_BOOL
+ */
+ case function_sint_to_bool :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_sint_to_bool*/
+ break;
+
+/****
+ *SINT_TO_INT
+ */
+ case function_sint_to_int :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_sint_to_int*/
+ break;
+
+/****
+ *SINT_TO_DINT
+ */
+ case function_sint_to_dint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_sint_to_dint*/
+ break;
+
+/****
+ *SINT_TO_LINT
+ */
+ case function_sint_to_lint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_sint_to_lint*/
+ break;
+
+/****
+ *SINT_TO_USINT
+ */
+ case function_sint_to_usint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_sint_to_usint*/
+ break;
+
+/****
+ *SINT_TO_UINT
+ */
+ case function_sint_to_uint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_sint_to_uint*/
+ break;
+
+/****
+ *SINT_TO_UDINT
+ */
+ case function_sint_to_udint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_sint_to_udint*/
+ break;
+
+/****
+ *SINT_TO_ULINT
+ */
+ case function_sint_to_ulint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_sint_to_ulint*/
+ break;
+
+/****
+ *SINT_TO_REAL
+ */
+ case function_sint_to_real :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_sint_to_real*/
+ break;
+
+/****
+ *SINT_TO_LREAL
+ */
+ case function_sint_to_lreal :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_sint_to_lreal*/
+ break;
+
+/****
+ *SINT_TO_TIME
+ */
+ case function_sint_to_time :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__int_to_time(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_sint_to_time*/
+ break;
+
+/****
+ *SINT_TO_DATE
+ */
+ case function_sint_to_date :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__int_to_time(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_sint_to_date*/
+ break;
+
+/****
+ *SINT_TO_TOD
+ */
+ case function_sint_to_tod :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__int_to_time(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_sint_to_tod*/
+ break;
+
+/****
+ *SINT_TO_DT
+ */
+ case function_sint_to_dt :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__int_to_time(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_sint_to_dt*/
+ break;
+
+/****
+ *SINT_TO_STRING
+ */
+ case function_sint_to_string :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__sint_to_string(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_sint_to_string*/
+ break;
+
+/****
+ *SINT_TO_BYTE
+ */
+ case function_sint_to_byte :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_sint_to_byte*/
+ break;
+
+/****
+ *SINT_TO_WORD
+ */
+ case function_sint_to_word :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_sint_to_word*/
+ break;
+
+/****
+ *SINT_TO_DWORD
+ */
+ case function_sint_to_dword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_sint_to_dword*/
+ break;
+
+/****
+ *SINT_TO_LWORD
+ */
+ case function_sint_to_lword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_sint_to_lword*/
+ break;
+
+/****
+ *INT_TO_BOOL
+ */
+ case function_int_to_bool :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(int_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_int_to_bool*/
+ break;
+
+/****
+ *INT_TO_SINT
+ */
+ case function_int_to_sint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(int_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_int_to_sint*/
+ break;
+
+/****
+ *INT_TO_DINT
+ */
+ case function_int_to_dint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(int_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_int_to_dint*/
+ break;
+
+/****
+ *INT_TO_LINT
+ */
+ case function_int_to_lint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(int_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_int_to_lint*/
+ break;
+
+/****
+ *INT_TO_USINT
+ */
+ case function_int_to_usint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(int_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_int_to_usint*/
+ break;
+
+/****
+ *INT_TO_UINT
+ */
+ case function_int_to_uint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(int_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_int_to_uint*/
+ break;
+
+/****
+ *INT_TO_UDINT
+ */
+ case function_int_to_udint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(int_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_int_to_udint*/
+ break;
+
+/****
+ *INT_TO_ULINT
+ */
+ case function_int_to_ulint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(int_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_int_to_ulint*/
+ break;
+
+/****
+ *INT_TO_REAL
+ */
+ case function_int_to_real :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(int_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_int_to_real*/
+ break;
+
+/****
+ *INT_TO_LREAL
+ */
+ case function_int_to_lreal :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(int_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_int_to_lreal*/
+ break;
+
+/****
+ *INT_TO_TIME
+ */
+ case function_int_to_time :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(int_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__int_to_time(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_int_to_time*/
+ break;
+
+/****
+ *INT_TO_DATE
+ */
+ case function_int_to_date :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(int_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__int_to_time(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_int_to_date*/
+ break;
+
+/****
+ *INT_TO_TOD
+ */
+ case function_int_to_tod :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(int_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__int_to_time(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_int_to_tod*/
+ break;
+
+/****
+ *INT_TO_DT
+ */
+ case function_int_to_dt :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(int_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__int_to_time(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_int_to_dt*/
+ break;
+
+/****
+ *INT_TO_STRING
+ */
+ case function_int_to_string :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(int_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__sint_to_string(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_int_to_string*/
+ break;
+
+/****
+ *INT_TO_BYTE
+ */
+ case function_int_to_byte :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(int_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_int_to_byte*/
+ break;
+
+/****
+ *INT_TO_WORD
+ */
+ case function_int_to_word :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(int_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_int_to_word*/
+ break;
+
+/****
+ *INT_TO_DWORD
+ */
+ case function_int_to_dword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(int_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_int_to_dword*/
+ break;
+
+/****
+ *INT_TO_LWORD
+ */
+ case function_int_to_lword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(int_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_int_to_lword*/
+ break;
+
+/****
+ *DINT_TO_BOOL
+ */
+ case function_dint_to_bool :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_dint_to_bool*/
+ break;
+
+/****
+ *DINT_TO_SINT
+ */
+ case function_dint_to_sint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_dint_to_sint*/
+ break;
+
+/****
+ *DINT_TO_INT
+ */
+ case function_dint_to_int :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_dint_to_int*/
+ break;
+
+/****
+ *DINT_TO_LINT
+ */
+ case function_dint_to_lint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_dint_to_lint*/
+ break;
+
+/****
+ *DINT_TO_USINT
+ */
+ case function_dint_to_usint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_dint_to_usint*/
+ break;
+
+/****
+ *DINT_TO_UINT
+ */
+ case function_dint_to_uint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_dint_to_uint*/
+ break;
+
+/****
+ *DINT_TO_UDINT
+ */
+ case function_dint_to_udint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_dint_to_udint*/
+ break;
+
+/****
+ *DINT_TO_ULINT
+ */
+ case function_dint_to_ulint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_dint_to_ulint*/
+ break;
+
+/****
+ *DINT_TO_REAL
+ */
+ case function_dint_to_real :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_dint_to_real*/
+ break;
+
+/****
+ *DINT_TO_LREAL
+ */
+ case function_dint_to_lreal :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_dint_to_lreal*/
+ break;
+
+/****
+ *DINT_TO_TIME
+ */
+ case function_dint_to_time :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__int_to_time(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_dint_to_time*/
+ break;
+
+/****
+ *DINT_TO_DATE
+ */
+ case function_dint_to_date :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__int_to_time(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_dint_to_date*/
+ break;
+
+/****
+ *DINT_TO_TOD
+ */
+ case function_dint_to_tod :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__int_to_time(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_dint_to_tod*/
+ break;
+
+/****
+ *DINT_TO_DT
+ */
+ case function_dint_to_dt :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__int_to_time(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_dint_to_dt*/
+ break;
+
+/****
+ *DINT_TO_STRING
+ */
+ case function_dint_to_string :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__sint_to_string(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_dint_to_string*/
+ break;
+
+/****
+ *DINT_TO_BYTE
+ */
+ case function_dint_to_byte :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_dint_to_byte*/
+ break;
+
+/****
+ *DINT_TO_WORD
+ */
+ case function_dint_to_word :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_dint_to_word*/
+ break;
+
+/****
+ *DINT_TO_DWORD
+ */
+ case function_dint_to_dword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_dint_to_dword*/
+ break;
+
+/****
+ *DINT_TO_LWORD
+ */
+ case function_dint_to_lword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_dint_to_lword*/
+ break;
+
+/****
+ *LINT_TO_BOOL
+ */
+ case function_lint_to_bool :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_lint_to_bool*/
+ break;
+
+/****
+ *LINT_TO_SINT
+ */
+ case function_lint_to_sint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_lint_to_sint*/
+ break;
+
+/****
+ *LINT_TO_INT
+ */
+ case function_lint_to_int :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_lint_to_int*/
+ break;
+
+/****
+ *LINT_TO_DINT
+ */
+ case function_lint_to_dint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_lint_to_dint*/
+ break;
+
+/****
+ *LINT_TO_USINT
+ */
+ case function_lint_to_usint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_lint_to_usint*/
+ break;
+
+/****
+ *LINT_TO_UINT
+ */
+ case function_lint_to_uint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_lint_to_uint*/
+ break;
+
+/****
+ *LINT_TO_UDINT
+ */
+ case function_lint_to_udint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_lint_to_udint*/
+ break;
+
+/****
+ *LINT_TO_ULINT
+ */
+ case function_lint_to_ulint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_lint_to_ulint*/
+ break;
+
+/****
+ *LINT_TO_REAL
+ */
+ case function_lint_to_real :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_lint_to_real*/
+ break;
+
+/****
+ *LINT_TO_LREAL
+ */
+ case function_lint_to_lreal :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_lint_to_lreal*/
+ break;
+
+/****
+ *LINT_TO_TIME
+ */
+ case function_lint_to_time :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__int_to_time(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_lint_to_time*/
+ break;
+
+/****
+ *LINT_TO_DATE
+ */
+ case function_lint_to_date :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__int_to_time(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_lint_to_date*/
+ break;
+
+/****
+ *LINT_TO_TOD
+ */
+ case function_lint_to_tod :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__int_to_time(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_lint_to_tod*/
+ break;
+
+/****
+ *LINT_TO_DT
+ */
+ case function_lint_to_dt :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__int_to_time(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_lint_to_dt*/
+ break;
+
+/****
+ *LINT_TO_STRING
+ */
+ case function_lint_to_string :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__sint_to_string(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_lint_to_string*/
+ break;
+
+/****
+ *LINT_TO_BYTE
+ */
+ case function_lint_to_byte :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_lint_to_byte*/
+ break;
+
+/****
+ *LINT_TO_WORD
+ */
+ case function_lint_to_word :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_lint_to_word*/
+ break;
+
+/****
+ *LINT_TO_DWORD
+ */
+ case function_lint_to_dword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_lint_to_dword*/
+ break;
+
+/****
+ *LINT_TO_LWORD
+ */
+ case function_lint_to_lword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_lint_to_lword*/
+ break;
+
+/****
+ *USINT_TO_BOOL
+ */
+ case function_usint_to_bool :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_usint_to_bool*/
+ break;
+
+/****
+ *USINT_TO_SINT
+ */
+ case function_usint_to_sint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_usint_to_sint*/
+ break;
+
+/****
+ *USINT_TO_INT
+ */
+ case function_usint_to_int :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_usint_to_int*/
+ break;
+
+/****
+ *USINT_TO_DINT
+ */
+ case function_usint_to_dint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_usint_to_dint*/
+ break;
+
+/****
+ *USINT_TO_LINT
+ */
+ case function_usint_to_lint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_usint_to_lint*/
+ break;
+
+/****
+ *USINT_TO_UINT
+ */
+ case function_usint_to_uint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_usint_to_uint*/
+ break;
+
+/****
+ *USINT_TO_UDINT
+ */
+ case function_usint_to_udint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_usint_to_udint*/
+ break;
+
+/****
+ *USINT_TO_ULINT
+ */
+ case function_usint_to_ulint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_usint_to_ulint*/
+ break;
+
+/****
+ *USINT_TO_REAL
+ */
+ case function_usint_to_real :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_usint_to_real*/
+ break;
+
+/****
+ *USINT_TO_LREAL
+ */
+ case function_usint_to_lreal :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_usint_to_lreal*/
+ break;
+
+/****
+ *USINT_TO_TIME
+ */
+ case function_usint_to_time :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__int_to_time(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_usint_to_time*/
+ break;
+
+/****
+ *USINT_TO_DATE
+ */
+ case function_usint_to_date :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__int_to_time(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_usint_to_date*/
+ break;
+
+/****
+ *USINT_TO_TOD
+ */
+ case function_usint_to_tod :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__int_to_time(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_usint_to_tod*/
+ break;
+
+/****
+ *USINT_TO_DT
+ */
+ case function_usint_to_dt :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__int_to_time(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_usint_to_dt*/
+ break;
+
+/****
+ *USINT_TO_STRING
+ */
+ case function_usint_to_string :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")__uint_to_string(");
+ IN_param_value->accept(*this);
+ s4o.print(")");
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_usint_to_string*/
+ break;
+
+/****
+ *USINT_TO_BYTE
+ */
+ case function_usint_to_byte :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_usint_to_byte*/
+ break;
+
+/****
+ *USINT_TO_WORD
+ */
+ case function_usint_to_word :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_usint_to_word*/
+ break;
+
+/****
+ *USINT_TO_DWORD
+ */
+ case function_usint_to_dword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_usint_to_dword*/
+ break;
+
+/****
+ *USINT_TO_LWORD
+ */
+ case function_usint_to_lword :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_usint_to_lword*/
+ break;
+
+/****
+ *UINT_TO_BOOL
+ */
+ case function_uint_to_bool :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_uint_to_bool*/
+ break;
+
+/****
+ *UINT_TO_SINT
+ */
+ case function_uint_to_sint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_uint_to_sint*/
+ break;
+
+/****
+ *UINT_TO_INT
+ */
+ case function_uint_to_int :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_uint_to_int*/
+ break;
+
+/****
+ *UINT_TO_DINT
+ */
+ case function_uint_to_dint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo( = ) style call */
+ symbol_c *IN_param_value = &this->default_variable_name;
+
+ symbol_c *IN_type_symbol = param_data_type;
+ last_type_symbol = param_data_type;
+
+ if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
+ {
+
+ symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
+ s4o.print("(");
+ return_type_symbol->accept(*this);
+ s4o.print(")");
+ IN_param_value->accept(*this);
+ return NULL;
+
+ }
+
+ ERROR;
+ }
+
+ }/*function_uint_to_dint*/
+ break;
+
+/****
+ *UINT_TO_LINT
+ */
+ case function_uint_to_lint :
+ {
+ symbol_c *last_type_symbol = NULL;
+
+ {
+ /* Get the value from a foo(