Cleanup in generated C code for STD lib
authoretisserant
Tue, 17 Jul 2007 12:25:19 +0200
changeset 40 49c8ebc1ee25
parent 39 5b04b4670697
child 41 0688db995ddf
Cleanup in generated C code for STD lib
generate_IEC_std.py
plcopen/iec_std.csv
plcopen/structures.py
--- a/generate_IEC_std.py	Fri Jul 13 19:21:17 2007 +0200
+++ b/generate_IEC_std.py	Tue Jul 17 12:25:19 2007 +0200
@@ -32,7 +32,8 @@
     "ANY_REAL" : "if(search_expression_type->is_real_type(%(paramname)s_type_symbol))",
     "ANY_INT" : "if(search_expression_type->is_integer_type(%(paramname)s_type_symbol))"
     }.get(typename,
-        "if (typeid(*last_type_symbol) == typeid(%(typename)s_type_name_c))")%{
+        #"if (typeid(*last_type_symbol) == typeid(%(typename)s_type_name_c))")%{
+        "if(search_expression_type->is_same_type(&search_constant_type_c::%(typename)s_type_name, last_type_symbol))")%{
                 "paramname" : paramname, "typename": typename.lower()}
 
 def recurse_and_indent(fdecls, indent, do_type_search_only = False, do_il = False):
@@ -116,13 +117,14 @@
             code_gen_dic_decl["end_bool_filter"] = '");\nif (search_expression_type->is_bool_type(last_type_symbol)) {\n  s4o.print("&1");\n  s4o.print(")");\n}\ns4o.print("'
             
             if type(code_gen) == type(tuple()):
-                res += 's4o.print("%s");\n'%(code_gen[0]%code_gen_dic_decl)
+                res += 's4o.indent_right();\n'
+                res += 's4o.print("%s\\n" + s4o.indent_spaces);\n'%(code_gen[0]%code_gen_dic_decl)
                 static_param_accept_list = []
                 for paramname,paramtype,unused in fdecl["inputs"]:
                     static_param_accept_list.append("%s_param_value->accept(*this);\n"%(paramname))
-                res += ('s4o.print("%s");\n'%(code_gen[1])).join(static_param_accept_list)
-                code = 's4o.print("%s");\nparam_value->accept(*this);\n'%(code_gen[1])
-                end_code = 's4o.print("%s");\nreturn NULL;\n'%(code_gen[2]%code_gen_dic_decl)
+                res += ('s4o.print("%s\\n" + s4o.indent_spaces);\n'%(code_gen[1])).join(static_param_accept_list)
+                code = 's4o.print("%s\\n" + s4o.indent_spaces);\nparam_value->accept(*this);\n'%(code_gen[1])
+                end_code = 's4o.print("%s");\ns4o.indent_left();\nreturn NULL;\n'%(code_gen[2]%code_gen_dic_decl)
             else:
                 code = ''
                 end_code = ('s4o.print("' + code_gen%code_gen_dic_decl + '");\nreturn NULL;\n').replace('s4o.print("");\n','')
--- a/plcopen/iec_std.csv	Fri Jul 13 19:21:17 2007 +0200
+++ b/plcopen/iec_std.csv	Tue Jul 17 12:25:19 2007 +0200
@@ -1,79 +1,79 @@
-Standard_functions_variables_types;name;type;comment;;;;;;
-;N;ANY_INT;Number of bits to be shifted;;;;;;
-;L;ANY_INT;Left position within character string;;;;;;
-;P;ANY_INT;Position within character string;;;;;;
-;G;BOOL;Selection out of 2 inputs (gate);;;;;;
-;K;ANY_INT;Selection out of n inputs;;;;;;
-;MN;ANY;Minimum value for limitation;;;;;;
-;MX;ANY;Maximum value for limitation;;;;;;
-;;;;;;;;;
-;;;;;;;;;
-;;;;;;;;;
-;;;;;;;;;
-;;;;;;;;;
-;;;;;;;;;
-Standard_functions_type;name;baseinputnumber;inputs;outputs;comment;extensible;python_eval_c_code_format;return_type_rule;lib_typed_decl
-Type conversion;*_TO_**;1;(ANY);ANY;Data type conversion;no;ANY_TO_ANY_FORMAT_GEN(ANY_TO_ANY_LIST,fdecl);defined;
-;TRUNC;1;(ANY_REAL);ANY_INT;Rounding up/down;no;"(int)%(IN_value)s";&search_constant_type_c::constant_int_type_name;
-;BCD_TO_**;1;(ANY_BIT);ANY_INT;Conversion from BCD;no;ANY_TO_ANY_FORMAT_GEN(BCD_TO_ANY_LIST,fdecl);defined;
-;*_TO_BCD;1;(ANY_INT);ANY_BIT;Conversion to BCD;no;ANY_TO_ANY_FORMAT_GEN(ANY_TO_BCD_LIST,fdecl);&search_constant_type_c::constant_int_type_name;
-;DATE_AND_TIME_TO_TIME_OF_DAY;1;(DT);TOD;Conversion to time-of-day;no;"__date_and_time_to_time_of_day(%(IN_value)s)";defined;
-;DATE_AND_TIME_TO_DATE;1;(DT);DATE;Conversion to date;no;"__date_and_time_to_date(%(IN_value)s)";defined;
-Numerical;ABS;1;(ANY_NUM);ANY_NUM;Absolute number;no;"__abs_%(IN_type)s(%(IN_value)s)";IN_type_symbol;"__abs_%(return_type)s(%(return_type)s IN){ return IN > 0 ? IN : -IN {sc}}"
-;SQRT;1;(ANY_REAL);ANY_REAL;Square root (base 2);no;"sqrt(%(IN_value)s)";IN_type_symbol;
-;LN;1;(ANY_REAL);ANY_REAL;Natural logarithm;no;"ln(%(IN_value)s)";IN_type_symbol;
-;LOG;1;(ANY_REAL);ANY_REAL;Logarithm to base 10;no;"log(%(IN_value)s)";IN_type_symbol;
-;EXP;1;(ANY_REAL);ANY_REAL;Exponentiation;no;"exp(%(IN_value)s)";IN_type_symbol;
-;SIN;1;(ANY_REAL);ANY_REAL;Sine;no;"sin(%(IN_value)s)";IN_type_symbol;
-;COS;1;(ANY_REAL);ANY_REAL;Cosine;no;"cos(%(IN_value)s)";IN_type_symbol;
-;TAN;1;(ANY_REAL);ANY_REAL;Tangent;no;"tan(%(IN_value)s)";IN_type_symbol;
-;ASIN;1;(ANY_REAL);ANY_REAL;Arc sine;no;"asin(%(IN_value)s)";IN_type_symbol;
-;ACOS;1;(ANY_REAL);ANY_REAL;Arc cosine;no;"acos(%(IN_value)s)";IN_type_symbol;
-;ATAN;1;(ANY_REAL);ANY_REAL;Arc tangent;no;"atan(%(IN_value)s)";IN_type_symbol;
-Arithmetic;ADD;1;(ANY_NUM, ANY_NUM);ANY_NUM;Addition;yes;("(","+",")");copy_input;
-;ADD;1;(TIME, TIME);TIME;Time addition;no;"__time_add(%(IN1_value)s, %(IN2_value)s)";defined;
-;ADD;1;(TOD, TIME);TOD;Time-of-day addition;no;"__time_add(%(IN1_value)s, %(IN2_value)s)";defined;
-;ADD;1;(DT, TIME);DT;Date addition;no;"__time_add(%(IN1_value)s, %(IN2_value)s)";defined;
-;MUL;1;(ANY_NUM, ANY_NUM);ANY_NUM;Multiplication;yes;("(","*",")");copy_input;
-;MUL;1;(TIME, ANY_NUM);TIME;Time multiplication;no;"__time_mul(%(IN1_value)s, %(IN2_value)s)";defined;
-;SUB;1;(ANY_NUM, ANY_NUM);ANY_NUM;Subtraction;no;("(","-",")");copy_input;
-;SUB;1;(TIME, TIME);TIME;Time subtraction;no;"__time_sub(%(IN1_value)s, %(IN2_value)s)";defined;
-;SUB;1;(DATE, DATE);TIME;Date subtraction;no;"__time_sub(%(IN1_value)s, %(IN2_value)s)";defined;
-;SUB;1;(TOD, TIME);TOD;Time-of-day subtraction;no;"__time_sub(%(IN1_value)s, %(IN2_value)s)";defined;
-;SUB;1;(TOD, TOD);TIME;Time-of-day subtraction;no;"__time_sub(%(IN1_value)s, %(IN2_value)s)";defined;
-;SUB;1;(DT, TIME);DT;Date and time subtraction;no;"__time_sub(%(IN1_value)s, %(IN2_value)s)";defined;
-;SUB;1;(DT, DT);TIME;Date and time subtraction;no;"__time_sub(%(IN1_value)s, %(IN2_value)s)";defined;
-;DIV;1;(ANY_NUM, ANY_NUM);ANY_NUM;Division;no;("(","/",")");copy_input;
-;DIV;1;(TIME, ANY_NUM);TIME;Time division;no;"__time_div(%(IN1_value)s, %(IN2_value)s)";defined;
-;MOD;1;(ANY_NUM, ANY_NUM);ANY_NUM;Remainder (modulo);no;("(","%",")");copy_input;
-;EXPT;1;(ANY_NUM, ANY_NUM);ANY_NUM;Exponent;no;"pow(%(IN1_value)s, %(IN2_value)s)";copy_input;
-;MOVE;1;(ANY_NUM);ANY_NUM;Assignment;no;"%(IN_value)s";copy_input;
-Bit-shift;SHL;1;(ANY_BIT, N);ANY_BIT;Shift left;no;"%(IN_value)s<<%(N_value)s";IN_type_symbol;
-;SHR;1;(ANY_BIT, N);ANY_BIT;Shift right;no;"%(IN_value)s>>%(N_value)s";IN_type_symbol;
-;ROR;1;(ANY_NBIT, N);ANY_NBIT;Rotate right;no;"__ror_%(IN_type)s(%(IN_value)s, %(N_value)s)";IN_type_symbol;"__max_%(return_type)s(%(return_type)s IN1, %(return_type)s IN2){ return IN1 > IN2 ? IN1 : IN2 {sc}}"
-;ROL;1;(ANY_NBIT, N);ANY_NBIT;Rotate left;no;"__rol_%(IN_type)s(%(IN_value)s, %(N_value)s)";IN_type_symbol;"__max_%(return_type)s(%(return_type)s IN1, %(return_type)s IN2){ return IN1 > IN2 ? IN1 : IN2 {sc}}"
-Bitwise;AND;1;(ANY_BIT, ANY_BIT);ANY_BIT;Bitwise AND;yes;("(%(start_bool_filter)s","&",")%(end_bool_filter)s");copy_input;
-;OR;1;(ANY_BIT, ANY_BIT);ANY_BIT;Bitwise OR;yes;("(%(start_bool_filter)s","|",")%(end_bool_filter)s");copy_input;
-;XOR;1;(ANY_BIT, ANY_BIT);ANY_BIT;Bitwise EXOR;yes;("(%(start_bool_filter)s","^",")%(end_bool_filter)s");copy_input;
-;NOT;1;(ANY_BIT);ANY_BIT;Bitwise inverting;no;"~%(IN_value)s";IN_type_symbol;
-Selection;SEL;0;(G, ANY, ANY);ANY;Binary selection (1 of 2);no;"%(G_value)s ? %(IN1_value)s :  %(IN0_value)s";copy_input;
-;MAX;1;(ANY, ANY);ANY;Maximum;yes;("__max_%(return_type)s(%(param_count)s,",",",")");copy_input;"__max_%(return_type)s(%(return_type)s IN1, %(return_type)s IN2){ return IN1 > IN2 ? IN1 : IN2 {sc}}"
-;MIN;1;(ANY, ANY);ANY;Minimum;yes;("__min_%(return_type)s(%(param_count)s,",",",")");copy_input;"__min_%(return_type)s(%(return_type)s IN1, %(return_type)s IN2){ return IN1 < IN2 ? IN1 : IN2 {sc}}"
-;LIMIT;1;(MN, ANY, MX);ANY;Limitation;no;"__limit_%(IN_type)s(%(MN_value)s, %(IN_value)s, %(MX_value)s)";IN_type_symbol;
-;MUX;0;(K, ANY, ANY);ANY;Multiplexer (select 1 of N);yes;("__mux_%(return_type)s(%(param_count)s,",",",")");copy_input;
-Comparison;GT;1;(ANY, ANY);BOOL;Greater than;yes;("__gt_%(return_type)s(%(param_count)s,",",",")");defined;"__gt_%(return_type)s(%(return_type)s IN1, %(return_type)s IN2){ return IN1  0 ? IN : -IN {sc}}"
-;GE;1;(ANY, ANY);BOOL;Greater than or equal to;yes;("__ge_%(return_type)s(%(param_count)s,",",",")");defined;
-;EQ;1;(ANY, ANY);BOOL;Equal to;yes;("__eq_%(return_type)s(%(param_count)s,",",",")");defined;
-;LT;1;(ANY, ANY);BOOL;Less than;yes;("__lt_%(return_type)s(%(param_count)s,",",",")");defined;
-;LE;1;(ANY, ANY);BOOL;Less than or equal to;yes;("__le_%(return_type)s(%(param_count)s,",",",")");defined;
-;NE;1;(ANY, ANY);BOOL;Not equal to;yes;("__ne_%(return_type)s(%(param_count)s,",",",")");defined;
-Character string;LEN;1;(STRING);INT;Length of string;no;"__len(%(IN_value)s)";defined;
-;LEFT;1;(STRING, L);STRING;string left of;no;"__left(%(IN_value)s, %(L_value)s)";defined;
-;RIGHT;1;(STRING, L);STRING;string right of;no;"__right(%(IN_value)s, %(L_value)s)";defined;
-;MID;1;(STRING, L, P);STRING;string from the middle;no;"__mid(%(IN_value)s, %(L_value)s, %(P_value)s)";defined;
-;CONCAT;1;(STRING, STRING);STRING;Concatenation;yes;("__concat(%(param_count)s,",",",")");defined;
-;CONCAT;1;(DATE, TOD);DT;Time concatenation;no;"__time_add(%(IN1_value)s, %(IN2_value)s)";defined;
-;INSERT;1;(STRING, STRING, P);STRING;Insertion (into);no;"__insert(%(IN1_value)s, %(IN2_value)s, %(P_value)s)";defined;
-;DELETE;1;(STRING, L, P);STRING;Deletion (within);no;"__delete(%(IN_value)s, %(L_value)s, %(P_value)s)";defined;
-;REPLACE;1;(STRING, STRING, L, P);STRING;Replacement (within);no;"__replace(%(IN1_value)s, %(IN2_value)s, %(L_value)s, %(P_value)s)";defined;
-;FIND;1;(STRING, STRING);INT;Find position;no;"__find(%(IN1_value)s, %(IN2_value)s)";defined;
+Standard_functions_variables_types;name;type;comment;;;;;
+;N;ANY_INT;Number of bits to be shifted;;;;;
+;L;ANY_INT;Left position within character string;;;;;
+;P;ANY_INT;Position within character string;;;;;
+;G;BOOL;Selection out of 2 inputs (gate);;;;;
+;K;ANY_INT;Selection out of n inputs;;;;;
+;MN;ANY;Minimum value for limitation;;;;;
+;MX;ANY;Maximum value for limitation;;;;;
+;;;;;;;;
+;;;;;;;;
+;;;;;;;;
+;;;;;;;;
+;;;;;;;;
+;;;;;;;;
+Standard_functions_type;name;baseinputnumber;inputs;outputs;comment;extensible;python_eval_c_code_format;return_type_rule
+Type conversion;*_TO_**;1;(ANY);ANY;Data type conversion;no;ANY_TO_ANY_FORMAT_GEN(ANY_TO_ANY_LIST,fdecl);defined
+;TRUNC;1;(ANY_REAL);ANY_INT;Rounding up/down;no;"(int)%(IN_value)s";&search_constant_type_c::constant_int_type_name
+;BCD_TO_**;1;(ANY_BIT);ANY_INT;Conversion from BCD;no;ANY_TO_ANY_FORMAT_GEN(BCD_TO_ANY_LIST,fdecl);defined
+;*_TO_BCD;1;(ANY_INT);ANY_BIT;Conversion to BCD;no;ANY_TO_ANY_FORMAT_GEN(ANY_TO_BCD_LIST,fdecl);&search_constant_type_c::constant_int_type_name
+;DATE_AND_TIME_TO_TIME_OF_DAY;1;(DT);TOD;Conversion to time-of-day;no;"__date_and_time_to_time_of_day(%(IN_value)s)";defined
+;DATE_AND_TIME_TO_DATE;1;(DT);DATE;Conversion to date;no;"__date_and_time_to_date(%(IN_value)s)";defined
+Numerical;ABS;1;(ANY_NUM);ANY_NUM;Absolute number;no;"__abs_%(IN_type)s(%(IN_value)s)";IN_type_symbol
+;SQRT;1;(ANY_REAL);ANY_REAL;Square root (base 2);no;"sqrt(%(IN_value)s)";IN_type_symbol
+;LN;1;(ANY_REAL);ANY_REAL;Natural logarithm;no;"ln(%(IN_value)s)";IN_type_symbol
+;LOG;1;(ANY_REAL);ANY_REAL;Logarithm to base 10;no;"log(%(IN_value)s)";IN_type_symbol
+;EXP;1;(ANY_REAL);ANY_REAL;Exponentiation;no;"exp(%(IN_value)s)";IN_type_symbol
+;SIN;1;(ANY_REAL);ANY_REAL;Sine;no;"sin(%(IN_value)s)";IN_type_symbol
+;COS;1;(ANY_REAL);ANY_REAL;Cosine;no;"cos(%(IN_value)s)";IN_type_symbol
+;TAN;1;(ANY_REAL);ANY_REAL;Tangent;no;"tan(%(IN_value)s)";IN_type_symbol
+;ASIN;1;(ANY_REAL);ANY_REAL;Arc sine;no;"asin(%(IN_value)s)";IN_type_symbol
+;ACOS;1;(ANY_REAL);ANY_REAL;Arc cosine;no;"acos(%(IN_value)s)";IN_type_symbol
+;ATAN;1;(ANY_REAL);ANY_REAL;Arc tangent;no;"atan(%(IN_value)s)";IN_type_symbol
+Arithmetic;ADD;1;(ANY_NUM, ANY_NUM);ANY_NUM;Addition;yes;("(","+",")");copy_input
+;ADD;1;(TIME, TIME);TIME;Time addition;no;"__time_add(%(IN1_value)s, %(IN2_value)s)";defined
+;ADD;1;(TOD, TIME);TOD;Time-of-day addition;no;"__time_add(%(IN1_value)s, %(IN2_value)s)";defined
+;ADD;1;(DT, TIME);DT;Date addition;no;"__time_add(%(IN1_value)s, %(IN2_value)s)";defined
+;MUL;1;(ANY_NUM, ANY_NUM);ANY_NUM;Multiplication;yes;("(","*",")");copy_input
+;MUL;1;(TIME, ANY_NUM);TIME;Time multiplication;no;"__time_mul(%(IN1_value)s, %(IN2_value)s)";defined
+;SUB;1;(ANY_NUM, ANY_NUM);ANY_NUM;Subtraction;no;("(","-",")");copy_input
+;SUB;1;(TIME, TIME);TIME;Time subtraction;no;"__time_sub(%(IN1_value)s, %(IN2_value)s)";defined
+;SUB;1;(DATE, DATE);TIME;Date subtraction;no;"__time_sub(%(IN1_value)s, %(IN2_value)s)";defined
+;SUB;1;(TOD, TIME);TOD;Time-of-day subtraction;no;"__time_sub(%(IN1_value)s, %(IN2_value)s)";defined
+;SUB;1;(TOD, TOD);TIME;Time-of-day subtraction;no;"__time_sub(%(IN1_value)s, %(IN2_value)s)";defined
+;SUB;1;(DT, TIME);DT;Date and time subtraction;no;"__time_sub(%(IN1_value)s, %(IN2_value)s)";defined
+;SUB;1;(DT, DT);TIME;Date and time subtraction;no;"__time_sub(%(IN1_value)s, %(IN2_value)s)";defined
+;DIV;1;(ANY_NUM, ANY_NUM);ANY_NUM;Division;no;("(","/",")");copy_input
+;DIV;1;(TIME, ANY_NUM);TIME;Time division;no;"__time_div(%(IN1_value)s, %(IN2_value)s)";defined
+;MOD;1;(ANY_NUM, ANY_NUM);ANY_NUM;Remainder (modulo);no;("(","%",")");copy_input
+;EXPT;1;(ANY_NUM, ANY_NUM);ANY_NUM;Exponent;no;"pow(%(IN1_value)s, %(IN2_value)s)";copy_input
+;MOVE;1;(ANY_NUM);ANY_NUM;Assignment;no;"%(IN_value)s";copy_input
+Bit-shift;SHL;1;(ANY_BIT, N);ANY_BIT;Shift left;no;"%(IN_value)s<<%(N_value)s";IN_type_symbol
+;SHR;1;(ANY_BIT, N);ANY_BIT;Shift right;no;"%(IN_value)s>>%(N_value)s";IN_type_symbol
+;ROR;1;(ANY_NBIT, N);ANY_NBIT;Rotate right;no;"__ror_%(IN_type)s(%(IN_value)s, %(N_value)s)";IN_type_symbol
+;ROL;1;(ANY_NBIT, N);ANY_NBIT;Rotate left;no;"__rol_%(IN_type)s(%(IN_value)s, %(N_value)s)";IN_type_symbol
+Bitwise;AND;1;(ANY_BIT, ANY_BIT);ANY_BIT;Bitwise AND;yes;("(%(start_bool_filter)s","&",")%(end_bool_filter)s");copy_input
+;OR;1;(ANY_BIT, ANY_BIT);ANY_BIT;Bitwise OR;yes;("(%(start_bool_filter)s","|",")%(end_bool_filter)s");copy_input
+;XOR;1;(ANY_BIT, ANY_BIT);ANY_BIT;Bitwise EXOR;yes;("(%(start_bool_filter)s","^",")%(end_bool_filter)s");copy_input
+;NOT;1;(ANY_BIT);ANY_BIT;Bitwise inverting;no;"~%(IN_value)s";IN_type_symbol
+Selection;SEL;0;(G, ANY, ANY);ANY;Binary selection (1 of 2);no;"%(G_value)s ? %(IN1_value)s :  %(IN0_value)s";copy_input
+;MAX;1;(ANY, ANY);ANY;Maximum;yes;("__max_%(return_type)s(%(param_count)s,",",",")");copy_input
+;MIN;1;(ANY, ANY);ANY;Minimum;yes;("__min_%(return_type)s(%(param_count)s,",",",")");copy_input
+;LIMIT;1;(MN, ANY, MX);ANY;Limitation;no;"__limit_%(IN_type)s(%(MN_value)s, %(IN_value)s, %(MX_value)s)";IN_type_symbol
+;MUX;0;(K, ANY, ANY);ANY;Multiplexer (select 1 of N);yes;("__mux_%(return_type)s(%(param_count)s,",",",")");copy_input
+Comparison;GT;1;(ANY, ANY);BOOL;Greater than;yes;("__gt_%(return_type)s(%(param_count)s,",",",")");defined
+;GE;1;(ANY, ANY);BOOL;Greater than or equal to;yes;("__ge_%(return_type)s(%(param_count)s,",",",")");defined
+;EQ;1;(ANY, ANY);BOOL;Equal to;yes;("__eq_%(return_type)s(%(param_count)s,",",",")");defined
+;LT;1;(ANY, ANY);BOOL;Less than;yes;("__lt_%(return_type)s(%(param_count)s,",",",")");defined
+;LE;1;(ANY, ANY);BOOL;Less than or equal to;yes;("__le_%(return_type)s(%(param_count)s,",",",")");defined
+;NE;1;(ANY, ANY);BOOL;Not equal to;yes;("__ne_%(return_type)s(%(param_count)s,",",",")");defined
+Character string;LEN;1;(STRING);INT;Length of string;no;"__len(%(IN_value)s)";defined
+;LEFT;1;(STRING, L);STRING;string left of;no;"__left(%(IN_value)s, %(L_value)s)";defined
+;RIGHT;1;(STRING, L);STRING;string right of;no;"__right(%(IN_value)s, %(L_value)s)";defined
+;MID;1;(STRING, L, P);STRING;string from the middle;no;"__mid(%(IN_value)s, %(L_value)s, %(P_value)s)";defined
+;CONCAT;1;(STRING, STRING);STRING;Concatenation;yes;("__concat(%(param_count)s,",",",")");defined
+;CONCAT;1;(DATE, TOD);DT;Time concatenation;no;"__time_add(%(IN1_value)s, %(IN2_value)s)";defined
+;INSERT;1;(STRING, STRING, P);STRING;Insertion (into);no;"__insert(%(IN1_value)s, %(IN2_value)s, %(P_value)s)";defined
+;DELETE;1;(STRING, L, P);STRING;Deletion (within);no;"__delete(%(IN_value)s, %(L_value)s, %(P_value)s)";defined
+;REPLACE;1;(STRING, STRING, L, P);STRING;Replacement (within);no;"__replace(%(IN1_value)s, %(IN2_value)s, %(L_value)s, %(P_value)s)";defined
+;FIND;1;(STRING, STRING);INT;Find position;no;"__find(%(IN1_value)s, %(IN2_value)s)";defined
--- a/plcopen/structures.py	Fri Jul 13 19:21:17 2007 +0200
+++ b/plcopen/structures.py	Tue Jul 17 12:25:19 2007 +0200
@@ -349,7 +349,7 @@
         (("ANY_STRING",), ("ANY_DATE","TIME"), "(%(return_type)s)__string_to_time(%(IN_value)s)"),
         # FROM_TIME
         (("ANY_DATE","TIME"), ("ANY_REAL",), "(%(return_type)s)__time_to_real(%(IN_value)s)"),
-        (("ANY_DATE","TIME"), ("ANY_INT","ANY_BIT"), "(%(return_type)s)__time_to_int(%(IN_value)s)"),
+        (("ANY_DATE","TIME"), ("ANY_INT","ANY_NBIT"), "(%(return_type)s)__time_to_int(%(IN_value)s)"),
         (("TIME",), ("ANY_STRING",), "(%(return_type)s)__time_to_string(%(IN_value)s)"),
         (("DATE",), ("ANY_STRING",), "(%(return_type)s)__date_to_string(%(IN_value)s)"),
         (("TOD",), ("ANY_STRING",), "(%(return_type)s)__tod_to_string(%(IN_value)s)"),