private static List<ident> GetTemplateParametersTypeDependsOn(type_node type)
        {
            if (type.generic_function_container != null)
            {
                return new List<ident>
                    {
                        new ident(type.name)
                    };
            }

            var typeRef = type as ref_type_node;
            if (typeRef != null)
            {
                return GetTemplateParametersTypeDependsOn(typeRef.pointed_type);
            }

            var typeIi = type.get_internal_interface(internal_interface_kind.unsized_array_interface) as array_internal_interface;
            if (typeIi != null)
            {
                return GetTemplateParametersTypeDependsOn(typeIi.element_type);
            }

            if (type.type_special_kind == PascalABCCompiler.SemanticTree.type_special_kind.set_type)
            {
                return GetTemplateParametersTypeDependsOn(type.element_type);
            }

            if (type.IsDelegate)
            {
                var dii = type.get_internal_interface(internal_interface_kind.delegate_interface) as delegate_internal_interface;
                var res = new List<ident>();
                if (dii != null)
                {
                    var paramCount = dii.parameters.Count;
                    for (var i = 0; i < paramCount; i++)
                    {
                        res.AddRange(GetTemplateParametersTypeDependsOn(dii.parameters[i].type));
                    }
                }
                return res;
            }

            if (type.is_generic_type_instance)
            {
                var pcount = type.instance_params.Count;
                var res = new List<ident>();

                for (var i = 0; i < pcount; i++)
                {
                    res.AddRange(GetTemplateParametersTypeDependsOn(type.instance_params[i]));
                }
                return res;
            }

            return new List<ident>();
        }
 private array_initializer ConvertArrayInitializer(type_node tn, array_initializer constant)
 {
 	type_node element_type = null;
     if (IsBoundedArray(tn))
     {
         bounded_array_interface bai = tn.get_internal_interface(internal_interface_kind.bounded_array_interface) as bounded_array_interface;
         element_type = bai.element_type;
         ordinal_type_interface oti_indexer = bai.ordinal_type_interface;
         int arr_length = oti_indexer.ordinal_type_to_int(oti_indexer.upper_value) - oti_indexer.ordinal_type_to_int(oti_indexer.lower_value) + 1;
         if (arr_length != constant.element_values.Count)
             AddError(constant.location, "ARRAY_CONST_{0}_ELEMENTS_EXPECTED", arr_length);
     }
     else
         if (IsUnsizedArray(tn))
         {
             array_internal_interface aii = tn.get_internal_interface(internal_interface_kind.unsized_array_interface) as array_internal_interface;
             element_type = aii.element_type;
             if (aii.rank > 1)
             {
             	array_initializer cnst = ConvertNDimArrayInitializer(tn,1,element_type,constant);
             	cnst.type = tn;
             	return cnst;
             }
         }
         else
         	AddError(new CanNotConvertTypes(constant,constant.type,tn,constant.location));//CompilerInternalError("Unexpected array type");
     for (int i = 0; i < constant.element_values.Count; i++)
     if (constant.element_values[i] is array_initializer)
     	constant.element_values[i] = ConvertArrayInitializer(element_type, constant.element_values[i] as array_initializer);
     else if (constant.element_values[i] is record_initializer)
     {
     	if (element_type is common_type_node)
     		constant.element_values[i] = ConvertRecordInitializer(element_type as common_type_node, constant.element_values[i] as record_initializer);
     	else throw new NotSupportedError(constant.element_values[i].location);
     }
     else
     {
     	constant.element_values[i] = convertion_data_and_alghoritms.convert_type(constant.element_values[i], element_type);
     }
     constant.type = tn;
     return constant;
 }
 private array_initializer ConvertNDimArrayInitializer(type_node tn, int cur_rank, type_node element_type, array_initializer constant)
 {
 	array_internal_interface aii = tn.get_internal_interface(internal_interface_kind.unsized_array_interface) as array_internal_interface;
 	int rank = aii.rank;
 	for (int i=0; i<constant.element_values.Count; i++)
 	{
 		expression_node e = constant.element_values[i];
 		if (e is array_initializer)
 		{
 			if (cur_rank>=rank)
 				constant.element_values[i] = ConvertArrayInitializer(tn.element_type,e as array_initializer);
 				//AddError(new CanNotConvertTypes(e,e.type,tn.element_type,e.location));
 			else
 			constant.element_values[i] = ConvertNDimArrayInitializer(tn,cur_rank+1,element_type,e as array_initializer);
 		}
 		else if (e is record_initializer)
     	{
     		if (element_type is common_type_node)
     			constant.element_values[i] = ConvertRecordInitializer(element_type as common_type_node, e as record_initializer);
     		else throw new NotSupportedError(constant.element_values[i].location);
     	}
 		else
     	{
 			if (cur_rank != rank)
                 AddError(constant.location, "RANK_MISMATCH_IN_INITILIALIZER");
 			constant.element_values[i] = convertion_data_and_alghoritms.convert_type(constant.element_values[i], element_type);
     	}
 	}
 	constant.type = tn;
 	return constant;
 }
 internal bool is_range_checkable(type_node tn)
 {
 	ordinal_type_interface oti = tn.get_internal_interface(internal_interface_kind.ordinal_interface) as ordinal_type_interface;
 	if (oti != null && !tn.IsEnum && tn != SystemLibrary.SystemLibrary.bool_type)
 		return true;
 	return false;
 }
        private constant_node convert_strong_to_constant_node(expression_node expr, type_node tn)
        {
            location loc = expr.location;
            constant_node constant = null;
            try_convert_typed_expression_to_function_call(ref expr);
            if (expr is null_const_node) 
            {
            	if (!(tn is null_type_node) && !type_table.is_with_nil_allowed(tn))
                    AddError(loc, "NIL_WITH_VALUE_TYPES_NOT_ALLOWED");
            	return null_const_node.get_const_node_with_type(tn, expr as null_const_node);
            }
            if (expr is compiled_static_method_call)
            {
                compiled_static_method_call csmc = expr as compiled_static_method_call;

                if (/*csmc.parameters.Count == 0 &&*/ csmc.type != null && csmc.type != SystemLibrary.SystemLibrary.void_type)
                    constant = new compiled_static_method_call_as_constant(csmc, expr.location);
            }
            else if (expr is common_namespace_function_call && (expr as common_namespace_function_call).function_node == SystemLibrary.SystemLibInitializer.CreateSetProcedure.sym_info as common_namespace_function_node)
            {
                common_namespace_function_call cnfc = expr as common_namespace_function_call;
                expressions_list exprs = get_set_initializer(cnfc);
                check_set_for_constant(cnfc);
                foreach (expression_node en in exprs)
                {
                    if (en is common_namespace_function_call)
                    {
                        common_namespace_function_call cnfc2 = en as common_namespace_function_call;
                        check_set_for_constant(cnfc2);
                    }
                    else
                        if (!(en is constant_node)) AddError(loc, "CONSTANT_EXPRESSION_EXPECTED");
                }
                constant = new common_namespace_function_call_as_constant(cnfc, loc);
            }
            else if (expr is common_namespace_function_call)
            {
                common_namespace_function_call cnfc=expr as common_namespace_function_call;
                //if (cnfc.function_node.namespace_node == context.converted_namespace)
                  //  throw new ConstantExpressionExpected(loc);
                constant = new common_namespace_function_call_as_constant(expr as common_namespace_function_call, loc);
            }
            else if (expr is basic_function_call)
            {
            	basic_function_call cnfc=expr as basic_function_call;
                //if (cnfc.function_node.namespace_node == context.converted_namespace)
                  //  throw new ConstantExpressionExpected(loc);
                constant = new basic_function_call_as_constant(expr as basic_function_call, loc);
            }
            else if (expr is typed_expression)
            {
            	expr = convertion_data_and_alghoritms.convert_type(expr, tn);
            	if (expr is common_constructor_call)
            	{
            		constant = new common_constructor_call_as_constant(expr as common_constructor_call, null);
            	}
            	else
            	if (expr is typed_expression)
            	{
            		if (const_def_type != null)
            		{
            			expr = convertion_data_and_alghoritms.convert_type(expr, const_def_type);
            			tn = const_def_type;
            			constant = new common_constructor_call_as_constant(expr as common_constructor_call, null);
            		}
            		else
            		{
            			base_function_call bfc = ((expr as typed_expression).type as delegated_methods).proper_methods[0];
            			common_type_node del =
            				convertion_data_and_alghoritms.type_constructor.create_delegate(context.get_delegate_type_name(), bfc.simple_function_node.return_value_type, bfc.simple_function_node.parameters, context.converted_namespace, null);
            			context.converted_namespace.types.AddElement(del);
            			tn = del;
            			expr = convertion_data_and_alghoritms.explicit_convert_type(expr, del);
            			expr.type = tn;
            			constant = new common_constructor_call_as_constant(expr as common_constructor_call, null);
            		}
            	}
            }
            
            else if (expr is namespace_constant_reference)
            {
            	constant = (expr as namespace_constant_reference).constant.const_value;
            	convertion_data_and_alghoritms.check_convert_type(constant,tn,expr.location);
            	if ((tn.type_special_kind == SemanticTree.type_special_kind.set_type || tn.type_special_kind == SemanticTree.type_special_kind.base_set_type) && tn.element_type != null)
                {
                    ordinal_type_interface oti = tn.element_type.get_internal_interface(internal_interface_kind.ordinal_interface) as ordinal_type_interface;
                    if (oti != null)
                    {
                    	common_namespace_function_call cmc = new common_namespace_function_call(SystemLibrary.SystemLibInitializer.ClipFunction.sym_info as common_namespace_function_node,null);
        				cmc.parameters.AddElement(expr);
        				cmc.parameters.AddElement(oti.lower_value.get_constant_copy(null));
        				cmc.parameters.AddElement(oti.upper_value.get_constant_copy(null));
        				cmc.ret_type = tn;
        				constant = new common_namespace_function_call_as_constant(cmc,null);
                    }
                    else if (tn.element_type.type_special_kind == SemanticTree.type_special_kind.short_string)
                    {
                    	common_namespace_function_call cmc = new common_namespace_function_call(SystemLibrary.SystemLibInitializer.ClipShortStringInSetFunction.sym_info as common_namespace_function_node,null);
        				cmc.parameters.AddElement(expr);
        				cmc.parameters.AddElement(new int_const_node((tn.element_type as short_string_type_node).Length,null));
        				cmc.ret_type = tn;
        				constant = new common_namespace_function_call_as_constant(cmc,null);
                    }
                 }
            	else
            	if (tn.type_special_kind == SemanticTree.type_special_kind.short_string)
            	{
            		/*common_namespace_function_call cmc = new common_namespace_function_call(SystemLibrary.SystemLibInitializer.ClipShortStringProcedure.sym_info as common_namespace_function_node,null);
        			cmc.parameters.AddElement(expr);
        			cmc.parameters.AddElement(new int_const_node((tn as short_string_type_node).Length,null));*/
            		expression_node cmc = convertion_data_and_alghoritms.create_simple_function_call(SystemLibrary.SystemLibInitializer.ClipShortStringProcedure.sym_info as function_node,null,convertion_data_and_alghoritms.convert_type(expr,SystemLibrary.SystemLibrary.string_type),new int_const_node((tn as short_string_type_node).Length,null));
        			constant = new common_namespace_function_call_as_constant(cmc as common_namespace_function_call,null);
            	}
            	/*expression_node e = convertion_data_and_alghoritms.convert_type(constant.get_constant_copy(expr.location), tn);
            	switch (e.semantic_node_type)
                {
                   case semantic_node_type.compiled_constructor_call:
                      constant = new compiled_constructor_call_as_constant(e as compiled_constructor_call, loc);
                      break;
                   default: 
                      constant = e as constant_node;
                      break;
               }*/
            	/*if (constant.get_object_value() != null)
            	{
            		//if (const_def_type != null)
            		{
            			expression_node e = convertion_data_and_alghoritms.convert_type(constant.get_constant_copy(expr.location), tn);
            			switch (e.semantic_node_type)
                    	{
                        	case semantic_node_type.compiled_constructor_call:
                            	constant = new compiled_constructor_call_as_constant(e as compiled_constructor_call, loc);
                            	break;
                        	default: 
                            	constant = e as constant_node;
                           	 	break;
                    	}
            		}
            	}
            	else
            	{
            		//if (const_def_type != null)
            		{
            			expression_node e = convertion_data_and_alghoritms.convert_type(expr, tn);
            			switch (e.semantic_node_type)
                    	{
                        	case semantic_node_type.compiled_constructor_call:
                            	constant = new compiled_constructor_call_as_constant(e as compiled_constructor_call, loc);
                            	break;
                        	default: 
                            	constant = e as constant_node;
                           	 	break;
                    	}
            		}
            	}*/
            	return constant;
            }
            else if (expr is function_constant_reference)
            {
            	constant = (expr as function_constant_reference).constant.const_value;
            	convertion_data_and_alghoritms.check_convert_type(constant,tn,expr.location);
            	if ((tn.type_special_kind == SemanticTree.type_special_kind.set_type || tn.type_special_kind == SemanticTree.type_special_kind.base_set_type) && tn.element_type != null)
                {
                    ordinal_type_interface oti = tn.element_type.get_internal_interface(internal_interface_kind.ordinal_interface) as ordinal_type_interface;
                    if (oti != null)
                    {
                    	common_namespace_function_call cmc = new common_namespace_function_call(SystemLibrary.SystemLibInitializer.ClipFunction.sym_info as common_namespace_function_node,null);
        				cmc.parameters.AddElement(expr);
        				cmc.parameters.AddElement(oti.lower_value.get_constant_copy(null));
        				cmc.parameters.AddElement(oti.upper_value.get_constant_copy(null));
        				cmc.ret_type = tn;
        				constant = new common_namespace_function_call_as_constant(cmc,null);
                    }
                    else if (tn.element_type.type_special_kind == SemanticTree.type_special_kind.short_string)
                    {
                    	common_namespace_function_call cmc = new common_namespace_function_call(SystemLibrary.SystemLibInitializer.ClipShortStringInSetFunction.sym_info as common_namespace_function_node,null);
        				cmc.parameters.AddElement(expr);
        				cmc.parameters.AddElement(new int_const_node((tn.element_type as short_string_type_node).Length,null));
        				cmc.ret_type = tn;
        				constant = new common_namespace_function_call_as_constant(cmc,null);
                    }
                 }
            	else
            	if (tn.type_special_kind == SemanticTree.type_special_kind.short_string)
            	{
            		/*common_namespace_function_call cmc = new common_namespace_function_call(SystemLibrary.SystemLibInitializer.ClipShortStringProcedure.sym_info as common_namespace_function_node,null);
        			cmc.parameters.AddElement(expr);
        			cmc.parameters.AddElement(new int_const_node((tn as short_string_type_node).Length,null));*/
            		expression_node cmc = convertion_data_and_alghoritms.create_simple_function_call(SystemLibrary.SystemLibInitializer.ClipShortStringProcedure.sym_info as function_node,null,convertion_data_and_alghoritms.convert_type(expr,SystemLibrary.SystemLibrary.string_type),new int_const_node((tn as short_string_type_node).Length,null));
        			constant = new common_namespace_function_call_as_constant(cmc as common_namespace_function_call,null);
            	}
            	/*expression_node e = convertion_data_and_alghoritms.convert_type(constant.get_constant_copy(expr.location), tn);
            	switch (e.semantic_node_type)
                {
                        	case semantic_node_type.compiled_constructor_call:
                            	constant = new compiled_constructor_call_as_constant(e as compiled_constructor_call, loc);
                            	break;
                        	default: 
                            	constant = e as constant_node;
                           	 	break;
                }*/
            	/*if (constant.get_object_value() != null)
            	{
            		//if (const_def_type != null)
            		{
            			expression_node e = convertion_data_and_alghoritms.convert_type(constant.get_constant_copy(expr.location), tn);
            			switch (e.semantic_node_type)
                    	{
                        	case semantic_node_type.compiled_constructor_call:
                            	constant = new compiled_constructor_call_as_constant(e as compiled_constructor_call, loc);
                            	break;
                        	default: 
                            	constant = e as constant_node;
                           	 	break;
                    	}
            		}
            	}
            	else
            	{
            		//if (const_def_type != null)
            		{
            			expression_node e = convertion_data_and_alghoritms.convert_type(expr, tn);
            			switch (e.semantic_node_type)
                    	{
                        	case semantic_node_type.compiled_constructor_call:
                            	constant = new compiled_constructor_call_as_constant(e as compiled_constructor_call, loc);
                            	break;
                        	default: 
                            	constant = e as constant_node;
                           	 	break;
                    	}
            		}
            	}*/
            	return constant;
            }
            else if (expr is static_compiled_variable_reference && !(expr as static_compiled_variable_reference).var.IsLiteral)
            {
                constant = new compiled_static_field_reference_as_constant(expr as static_compiled_variable_reference, null);
                return constant;
            }
            else
            {
                constant = expr as constant_node;
                if (tn.type_special_kind == SemanticTree.type_special_kind.short_string)
                {
                    /*common_namespace_function_call cmc = new common_namespace_function_call(SystemLibrary.SystemLibInitializer.ClipShortStringProcedure.sym_info as common_namespace_function_node,null);
                    cmc.parameters.AddElement(expr);
                    cmc.parameters.AddElement(new int_const_node((tn as short_string_type_node).Length,null));*/
                    expression_node cmc = convertion_data_and_alghoritms.create_simple_function_call(SystemLibrary.SystemLibInitializer.ClipShortStringProcedure.sym_info as function_node, null, convertion_data_and_alghoritms.convert_type(expr, SystemLibrary.SystemLibrary.string_type), new int_const_node((tn as short_string_type_node).Length, null));
                    if (cmc is common_namespace_function_call)
                        constant = new common_namespace_function_call_as_constant(cmc as common_namespace_function_call, null);
                    else
                        constant = new compiled_static_method_call_as_constant(cmc as compiled_static_method_call, null);
                }
                //else
                //constant = convertion_data_and_alghoritms.convert_type(constant, tn) as constant_node;
                if (expr is static_compiled_variable_reference)
                {
                    compiled_class_constant_definition cccd = NetHelper.NetHelper.ConvertToConstant(((static_compiled_variable_reference)expr).var);
                    if (cccd != null)
                        constant = cccd.const_value;
                    else
                        constant = new compiled_static_field_reference_as_constant(expr as static_compiled_variable_reference, null);
                }

            }
            if (constant == null)
                AddError(loc, "CONSTANT_EXPRESSION_EXPECTED");
            if (IsBoundedArray(tn) || IsUnsizedArray(tn))
            {
                if (!(constant is array_const))
                    AddError(loc, "ARRAY_CONST_EXPECTED");
                constant = ConvertArrayConst(tn, constant as array_const);
            }
            else
                if (tn is common_type_node)
                {
                    if (tn.type_special_kind != SemanticTree.type_special_kind.set_type && tn.type_special_kind != SemanticTree.type_special_kind.base_set_type && tn.type_special_kind != SemanticTree.type_special_kind.diap_type)
                    {
                        if (!tn.is_value)
                        {
                        	if (expr is common_constructor_call)
                        		return constant;
                        	if (expr is common_constructor_call_as_constant)
                        		return expr as common_constructor_call_as_constant;
                        	convertion_data_and_alghoritms.check_convert_type(expr,tn,expr.location);
                        	//AddError(new CanNotConvertTypes(expr,expr.type,tn,expr.location));
                        	//throw new NotSupportedError(loc);
                        }
                        if ((tn as common_type_node).IsEnum)
                        {
                            convertion_data_and_alghoritms.check_convert_type(expr,tn,expr.location);
                        	enum_const_node ecn = expr as enum_const_node;
                            if (ecn == null) AddError(expr.location, "CONSTANT_EXPRESSION_EXPECTED");
                            return ecn;
                        }
                        if (!(constant is record_constant))
                            AddError(loc, "RECORD_CONST_EXPECTED");
                        constant = ConvertRecordConst(tn as common_type_node, constant as record_constant);
                    }
                    else if (tn.type_special_kind == SemanticTree.type_special_kind.diap_type)
                    {
                    	constant = expr as constant_node;
                    	if (constant == null)
                            AddError(expr.location, "CONSTANT_EXPRESSION_EXPECTED");
                    	//constant = (expr as namespace_constant_reference).constant.const_value;
            			convertion_data_and_alghoritms.check_convert_type(constant,tn,expr.location);
                        ordinal_type_interface oti = tn.get_internal_interface(internal_interface_kind.ordinal_interface) as ordinal_type_interface;
                        bool success = false;
                        int val = convertion_data_and_alghoritms.convert_type_to_int_constant(constant, out success);
                        if (success)
                        {
                            int left = convertion_data_and_alghoritms.convert_type_to_int_constant(oti.lower_value, out success);
                            if (success)
                            {
                                int right = convertion_data_and_alghoritms.convert_type_to_int_constant(oti.upper_value, out success);
                                if (success)
                                if (val < left || val > right)
                                    AddError(loc, "OUT_OF_RANGE");
                            }
                        }
                    }
                    else
                    {
                    	//obrezka konstantnogo mnozhestva
                    	if (!(tn == expr.type) && !type_table.is_derived(tn,expr.type))
                    	{
                    		AddError(new CanNotConvertTypes(expr,expr.type,tn,expr.location));
                    	}
                    	if (tn.element_type != null)
                    	{
                    		ordinal_type_interface oti = tn.element_type.get_internal_interface(internal_interface_kind.ordinal_interface) as ordinal_type_interface;
                    		if (oti != null)
                    		{
                                base_function_call cmc = null;
                                if (SystemLibrary.SystemLibInitializer.ClipFunction.sym_info is common_namespace_function_node)
                                    cmc = new common_namespace_function_call(SystemLibrary.SystemLibInitializer.ClipFunction.sym_info as common_namespace_function_node, null);
        						else
                                    cmc = new compiled_static_method_call(SystemLibrary.SystemLibInitializer.ClipFunction.sym_info as compiled_function_node, null);
                                cmc.parameters.AddElement(expr);
        						cmc.parameters.AddElement(oti.lower_value.get_constant_copy(null));
        						cmc.parameters.AddElement(oti.upper_value.get_constant_copy(null));
        						cmc.ret_type = tn;
                                if (cmc is common_namespace_function_call)
                                    constant = new common_namespace_function_call_as_constant(cmc as common_namespace_function_call, null);
                                else
                                    constant = new compiled_static_method_call_as_constant(cmc as compiled_static_method_call, null);
                    		}
                    		else if (tn.element_type.type_special_kind == SemanticTree.type_special_kind.short_string)
                    		{
                                base_function_call cmc = null;
                                if (SystemLibrary.SystemLibInitializer.ClipShortStringInSetFunction.sym_info is common_namespace_function_node)
                                    cmc = new common_namespace_function_call(SystemLibrary.SystemLibInitializer.ClipShortStringInSetFunction.sym_info as common_namespace_function_node, null);
        						else
                                    cmc = new compiled_static_method_call(SystemLibrary.SystemLibInitializer.ClipShortStringInSetFunction.sym_info as compiled_function_node, null);
                                cmc.parameters.AddElement(expr);
        						cmc.parameters.AddElement(new int_const_node((tn.element_type as short_string_type_node).Length,null));
        						cmc.ret_type = tn;
                                if (cmc is common_namespace_function_call)
                                    constant = new common_namespace_function_call_as_constant(cmc as common_namespace_function_call, null);
                                else
                                    constant = new compiled_static_method_call_as_constant(cmc as compiled_static_method_call, null);
                    		}
                    	}
                    }
                }
                else
                {
                    expression_node exprc = convertion_data_and_alghoritms.convert_type(constant, tn);
                    switch (exprc.semantic_node_type)
                    {
                        case semantic_node_type.compiled_constructor_call:
                            constant = new compiled_constructor_call_as_constant(exprc as compiled_constructor_call, loc);
                            break;
                        case semantic_node_type.compiled_static_method_call:
                            constant = new compiled_static_method_call_as_constant(exprc as compiled_static_method_call, loc);
                            break;
                        case semantic_node_type.basic_function_call:
                            constant = new basic_function_call_as_constant(exprc as basic_function_call, loc);
                            break;
                        default: 
                            constant = exprc as constant_node;
                            break;
                    }
                }
            return constant;
        }
        //TODO: Возможно стоит если пересечение типов найдено в откомпилированных типах, добавлять к нашим структурам и не искать повторно.
		public static possible_type_convertions get_convertions(type_node from,type_node to, bool is_implicit)
		{
            possible_type_convertions ret = new possible_type_convertions();
            ret.first = null;
            ret.second = null;

            if ((from == null) || (to == null))
            {
                return ret;
            }

			type_intersection_node tin_from=from.get_type_intersection(to);
			type_intersection_node tin_to=to.get_type_intersection(from);

            if (tin_from != null)
            {
                if (tin_from.this_to_another != null)
                {
                    if ((!is_implicit) || (!(tin_from.this_to_another.is_explicit)))
                    {
                        add_conversion(ret, tin_from.this_to_another.convertion_method, from, to);
                    }
                }
            }
            if (tin_to != null)
            {
                if (tin_to.another_to_this != null)
                {
                    if ((!is_implicit) || (!(tin_to.another_to_this.is_explicit)))
                    {
                        add_conversion(ret, tin_to.another_to_this.convertion_method, from, to);
                    }
                }
            }
            if (ret.second != null)
            {
                return ret;
            }

            if (is_derived(to, from) || (from.IsInterface && to == SystemLibrary.SystemLibrary.object_type))
            {
                add_conversion(ret, TreeConverter.convertion_data_and_alghoritms.get_empty_conversion(from, to, true), from, to);
                //add_conversion(ret, SystemLibrary.SystemLibrary.empty_method, from, to);
            }

            if (ret.second != null)
            {
                return ret;
            }

			wrapped_type ctn_to=to as wrapped_type;
			wrapped_type ctn_from=from as wrapped_type;

            if (ctn_to != null)
            {
                function_node fnode1 = null;
                fnode1 = ctn_to.get_implicit_conversion_from(from);
                add_conversion(ret, fnode1, from, to);
                if (ret.second != null)
                {
                    return ret;
                }
                fnode1 = null;
                if (!is_implicit)
                {
                    fnode1 = ctn_to.get_explicit_conversion_from(from);
                }
                add_conversion(ret, fnode1, from, to);
                if (ret.second != null)
                {
                    return ret;
                }
            }
            if (ctn_from != null)
            {
                function_node fnode2 = null;
                fnode2 = ctn_from.get_implicit_conversion_to(to);
                add_conversion(ret, fnode2, from, to);
                if (ret.second != null)
                {
                    return ret;
                }
                fnode2 = null;
                if (!is_implicit)
                {
                    fnode2 = ctn_from.get_explicit_conversion_to(to);
                }
                add_conversion(ret, fnode2, from, to);
                if (ret.second != null)
                {
                    return ret;
                }
            }

            //TODO: Вот это должно быть в каком нибудь другом месте.
            internal_interface ii = from.get_internal_interface(internal_interface_kind.delegate_interface);
            if (ii != null)
            {
                delegate_internal_interface dii = (delegate_internal_interface)ii;
                
                internal_interface to_ii = to.get_internal_interface(internal_interface_kind.delegate_interface);
                if (to_ii != null)
                {
                    delegate_internal_interface to_dii = (delegate_internal_interface)to_ii;
                    if (dii.parameters.Count == to_dii.parameters.Count)
                    {
                        //ms100 error fixed (DS)
                        bool eq = TreeConverter.convertion_data_and_alghoritms.function_eq_params_and_result(dii.invoke_method, to_dii.invoke_method);
                        if (eq)
                        {
                            delegate_to_delegate_type_converter dtdtc = new delegate_to_delegate_type_converter(to);
                            add_conversion(ret, new convert_types_function_node(dtdtc.convert_delegates_to_delegates, false), from, to);
                        }
                    }
                }
                
                if (dii.parameters.Count == 0)
                {
                    if (dii.return_value_type == to)
                    {
                        add_conversion(ret, new convert_types_function_node(convert_delegate_to_return_value_type, true), from, to);
                    }
                    else
                    {
                        possible_type_convertions ptcc = get_convertions(dii.return_value_type, to);
                        if ((ptcc.first != null) && (ptcc.first.convertion_method != null))
                        {
                            delegate_type_converter dtc = new delegate_type_converter(ptcc.first.convertion_method);
                            add_conversion(ret, new convert_types_function_node(dtc.convert_delegate_to_return_value_type_with_convertion, false), from, to);
                        }
                        if ((ptcc.second != null) && (ptcc.second.convertion_method != null))
                        {
                            delegate_type_converter dtc = new delegate_type_converter(ptcc.second.convertion_method);
                            add_conversion(ret, new convert_types_function_node(dtc.convert_delegate_to_return_value_type_with_convertion, false), from, to);
                        }
                    }
                }
            }

			return ret;
		}
 private bool IsUnsizedArray(type_node tn)
 {
     return tn.get_internal_interface(internal_interface_kind.unsized_array_interface) != null;
 }
        private SyntaxTree.expression get_possible_array_const(SyntaxTree.expression expr, type_node tn)
        {
            try
            {
                if (tn == null)
                    return expr;
                if (expr is SyntaxTree.bracket_expr && (tn.type_special_kind == SemanticTree.type_special_kind.array_kind || tn.type_special_kind == SemanticTree.type_special_kind.array_wrapper))
                {
                    array_internal_interface aii = tn.get_internal_interface(internal_interface_kind.unsized_array_interface) as array_internal_interface;
                    if (aii != null && aii.rank > 1)
                        return get_possible_array_const(expr, tn, aii.rank);
                    SyntaxTree.array_const arr = new SyntaxTree.array_const();
                    arr.source_context = expr.source_context;
                    arr.elements = new SyntaxTree.expression_list();
                    arr.elements.expressions.Add(get_possible_array_const((expr as SyntaxTree.bracket_expr).expr, tn.element_type));
                    return arr;
                }
                else if (expr is SyntaxTree.array_const && (tn.type_special_kind == SemanticTree.type_special_kind.array_kind || tn.type_special_kind == SemanticTree.type_special_kind.array_wrapper))
                {
                    array_internal_interface aii = tn.get_internal_interface(internal_interface_kind.unsized_array_interface) as array_internal_interface;
                    if (aii != null && aii.rank > 1)
                        return get_possible_array_const(expr, tn, aii.rank);
                    SyntaxTree.array_const arr = expr as SyntaxTree.array_const;
                    if (arr.elements != null)
                        for (int i = 0; i < arr.elements.expressions.Count; i++)
                            arr.elements.expressions[i] = get_possible_array_const(arr.elements.expressions[i], tn.element_type);
                    return arr;
                }
                else if (expr is SyntaxTree.record_const && tn is common_type_node)
                {
                    common_type_node ctn = tn as common_type_node;
                    SyntaxTree.record_const rec = expr as SyntaxTree.record_const;
                    for (int i = 0; i < rec.rec_consts.Count; i++)
                    {
                        if (i < ctn.fields.Count)
                            rec.rec_consts[i].val = get_possible_array_const(rec.rec_consts[i].val, ctn.fields[i].type);
                    }
                    return rec;
                }
            }
            catch
            {

            }
            return expr;
        }
Exemplo n.º 9
0
        private static bool CheckIfTypeDependsOnUndeducedGenericParameters(type_node formalType, type_node[] deduced) //lroman
        {
            if (formalType.generic_function_container != null)
            {
                var par_num = formalType.generic_param_index;
                return deduced[par_num] == null;
            }

            var formalRef = formalType as ref_type_node;
            if (formalRef != null)
            {
                return CheckIfTypeDependsOnUndeducedGenericParameters(formalRef.pointed_type, deduced);
            }

            var formalIi = formalType.get_internal_interface(internal_interface_kind.unsized_array_interface) as array_internal_interface;
            if (formalIi != null)
            {
                return CheckIfTypeDependsOnUndeducedGenericParameters(formalIi.element_type, deduced);
            }

            if (formalType.type_special_kind == PascalABCCompiler.SemanticTree.type_special_kind.set_type)
            {
                return CheckIfTypeDependsOnUndeducedGenericParameters(formalType.element_type, deduced);
            }

            if (formalType.IsDelegate)
            {
                var dii = formalType.get_internal_interface(internal_interface_kind.delegate_interface) as delegate_internal_interface;
                var paramCount = dii.parameters.Count;
                for (var i = 0; i < paramCount; i++)
                {
                    if (!CheckIfTypeDependsOnUndeducedGenericParameters(dii.parameters[i].type, deduced))
                    {
                        return false;
                    }
                }
                return CheckIfTypeDependsOnUndeducedGenericParameters(dii.return_value_type, deduced);
            }

            if (formalType.is_generic_type_instance)
            {
                var pcount = formalType.instance_params.Count;
                for (var k = 0; k < pcount; ++k)
                {
                    if (!CheckIfTypeDependsOnUndeducedGenericParameters(formalType.instance_params[k], deduced))
                    {
                        return false;
                    }
                }
                return true;
            }
            return false;
        }
Exemplo n.º 10
0
 public static type_node determine_type(type_node tn, List<type_node> param_types, bool method_param_types)
 {
     if (tn == null) return null;
     ref_type_node rtn = tn as ref_type_node;
     if (rtn != null)
     {
         type_node ptype = generic_convertions.determine_type(rtn.pointed_type, param_types, method_param_types);
         if (ptype == rtn.pointed_type) return tn;
         ref_type_node rez_ref = ptype.ref_type;
         rez_ref.loc = rtn.loc;
         return rez_ref;
     }
     array_internal_interface ii = tn.get_internal_interface(internal_interface_kind.unsized_array_interface) as array_internal_interface;
     if (ii != null)
     {
         type_node elem_tp = determine_type(ii.element_type, param_types, method_param_types);
         if (elem_tp != ii.element_type)
         {
             return SystemLibrary.SystemLibrary.syn_visitor.convertion_data_and_alghoritms.type_constructor.create_unsized_array(elem_tp, null, ii.rank, null);
         }
         return tn;
     }
     common_type_node comm_type = tn as common_type_node;
     if (comm_type != null)
     {
         if (comm_type.is_generic_parameter)
         {
             if (method_param_types && comm_type.generic_function_container != null)
             {
                 return param_types[comm_type.generic_param_index];
             }
             else if (!method_param_types && comm_type.generic_type_container != null)
             {
                 return param_types[comm_type.generic_param_index];
             }
             return tn;
         }
         generic_instance_type_node gitn = tn as generic_instance_type_node;
         if (gitn != null)
         {
             List<type_node> semantic_args = new List<type_node>();
             List<type_node> gitn_inst_parameters = gitn.instance_params;
             foreach (type_node arg in gitn_inst_parameters)
             {
                 semantic_args.Add(determine_type(arg, param_types, method_param_types));
             }
             return gitn.original_generic.get_instance(semantic_args);
         }
         if (comm_type.is_generic_type_definition)
         {
             return comm_type.get_instance(param_types);
         }
         if (comm_type.type_special_kind == SemanticTree.type_special_kind.array_kind)
         {
             type_node elem_tp = determine_type(comm_type.element_type, param_types, method_param_types);
             if (elem_tp != comm_type.element_type)
             {
                 return SystemLibrary.SystemLibrary.syn_visitor.convertion_data_and_alghoritms.type_constructor.create_unsized_array(elem_tp, null, 1, comm_type.loc);
             }
             return tn;
         }
         if (comm_type.type_special_kind == SemanticTree.type_special_kind.set_type)
         {
             type_node elem_tp = determine_type(comm_type.element_type, param_types, method_param_types);
             if (elem_tp != comm_type.element_type)
             {
                 return SystemLibrary.SystemLibrary.syn_visitor.context.create_set_type(elem_tp, comm_type.loc);
             }
             return tn;
         }
         if (comm_type.type_special_kind == PascalABCCompiler.SemanticTree.type_special_kind.typed_file)
         {
             type_node elem_tp = determine_type(comm_type.element_type, param_types, method_param_types);
             if (elem_tp != comm_type.element_type)
             {
                 return SystemLibrary.SystemLibrary.syn_visitor.context.create_typed_file_type(elem_tp, comm_type.loc);
             }
             return tn;
         }
         return tn;
     }
     compiled_type_node ctn = tn as compiled_type_node;
     if (ctn == null || (!ctn.compiled_type.IsGenericType && !ctn.compiled_type.IsGenericParameter))
     {
         return tn;
     }
     return determine_type(ctn.compiled_type, param_types, method_param_types);
 }
Exemplo n.º 11
0
        public static void init_generic_instance(type_node original, generic_instance_type_node instance, /*SymbolTable.ClassScope instance_scope,*/ List<type_node> param_types)
        {
            instance.IsInterface = original.IsInterface;
            instance.is_class = original.is_class;
            instance.internal_is_value = original.is_value;
            instance.SetIsSealed(original.IsSealed);
            instance.IsDelegate = original.IsDelegate;
            instance.type_special_kind = original.type_special_kind;

            //Определяем базовый тип
            type_node btype = determine_type(
                original.base_type, param_types, false);
            instance.SetBaseTypeIgnoringScope(btype);
            
            //instance._scope = new SymbolTable.GenericTypeInstanceScope(instance, instance.original_generic.Scope, btype.Scope);

            foreach (type_node interf in original.ImplementingInterfaces)
            {
                instance.ImplementingInterfaces.Add(
                    determine_type(interf, param_types, false)
                    );
            }

            SystemLibrary.SystemLibrary.init_reference_type(instance);
            instance.conform_basic_functions();
            //(ssyy) Нужно, чтобы добавились конструкторы
            //ctnode.find_in_type(compiler_string_consts.default_constructor_name);
            instance.instance_params = param_types;

            property_node orig_pn = original.default_property_node;
            if (orig_pn != null)
            {
                if (orig_pn.comprehensive_type == original)
                {
                    //Свойство по умолчанию описано в оригинальном коде generic-a;
                    //конвертируем его
                    instance.default_property = instance.ConvertMember(orig_pn) as common_property_node;
                }
                else
                {
                    //Свойство по умолчанию описано в каком-то предке оригинального generic-a
                    if (orig_pn.comprehensive_type.is_generic_type_definition)
                    {
                        instance.default_property = instance.find_instance_type_from(orig_pn.comprehensive_type).default_property;
                    }
                }
            }

            var shouldAddToAllTypeInstances = true;
            if (LambdaHelper.processingLambdaParametersForTypeInference != 0)
            {
                foreach (var par in instance.generic_parameters)
                {
                    if (par is lambda_any_type_node)
                    {
                        shouldAddToAllTypeInstances = false;
                        break;
                    }
                }
            }

            if (shouldAddToAllTypeInstances) //lroman// Если зашли сюда при выведении типов параметров лямбды, то тип инстанцироваться может с типом lambda_any_type_node. Поэтому, если выводим типы. То данную инстанцию не добавляем
                generic_convertions.all_type_instances.Add(instance);

            internal_interface ii = original.get_internal_interface(internal_interface_kind.delegate_interface);
            if (ii != null)
            {
                delegate_internal_interface dii = ii as delegate_internal_interface;
                common_method_node inv = instance.ConvertMember(dii.invoke_method) as common_method_node;
                common_method_node constr = instance.ConvertMember(dii.constructor) as common_method_node;
                constr.function_code = new runtime_statement(SemanticTree.runtime_statement_type.ctor_delegate, null);
                delegate_internal_interface converted_dii = new delegate_internal_interface(inv.return_value_type,
                    inv, constr);
                converted_dii.parameters.AddRange(inv.parameters);
                instance.add_internal_interface(converted_dii);
            }
        }
Exemplo n.º 12
0
 public static CompilationErrorWithLocation check_type_generic_useful(type_node tn, location loc)
 {
     if (tn == null)
     {
         return new SimpleSemanticError(loc, "TYPE_NAME_EXPECTED");
     }
     if (tn.IsPointer)
     {
         return new SimpleSemanticError(loc, "CANNOT_USE_POINTER_AS_GENERIC_ARGUMENT");
     }
     switch (tn.type_special_kind)
     {
         case PascalABCCompiler.SemanticTree.type_special_kind.diap_type:
             return new SimpleSemanticError(loc, "CANNOT_USE_DIAPASON_AS_GENERIC_ARGUMENT");
         case PascalABCCompiler.SemanticTree.type_special_kind.typed_file:
             return new SimpleSemanticError(loc, "CANNOT_USE_TYPED_FILE_AS_GENERIC_ARGUMENT");
         case PascalABCCompiler.SemanticTree.type_special_kind.short_string:
             return new SimpleSemanticError(loc, "CANNOT_USE_SHORT_STRING_AS_GENERIC_ARGUMENT");
     }
     /*if (tn == SystemLibrary.SystemLibrary.void_type)
     {
         return new VoidNotValid(loc);
     }*/
     SystemLibrary.SystemLibrary.syn_visitor.check_for_type_allowed(tn,loc);
     internal_interface ii = tn.get_internal_interface(internal_interface_kind.bounded_array_interface);
     if (ii != null)
     {
         return new SimpleSemanticError(loc, "CANNOT_USE_BOUNDED_ARRAY_AS_GENERIC_ARGUMENT");
     }
     return null;
 }
Exemplo n.º 13
0
 /// <summary>
 /// Вывод типа параметров лямбд и типа возвращаемого значения при присваивании лямбды переменной 
 /// </summary>
 public static void InferTypesFromVarStmt(type_node leftType, function_lambda_definition lambdaDef, syntax_tree_visitor visitor)
 {
     if (lambdaDef == null)
         return;
     if (leftType != null)
     {
         delegate_internal_interface dii_left =
             (delegate_internal_interface)leftType.get_internal_interface(internal_interface_kind.delegate_interface);
         if (dii_left == null)
             visitor.AddError(visitor.get_location(lambdaDef), "ILLEGAL_LAMBDA_VARIABLE_TYPE");
         int leftTypeParamsNumber = dii_left.parameters.Count;
         int lambdaDefParamsCount = 0;
         if (lambdaDef.formal_parameters != null && lambdaDef.formal_parameters.params_list.Count != 0)
         {
             for (int i = 0; i < lambdaDef.formal_parameters.params_list.Count; i++)
                 lambdaDefParamsCount += lambdaDef.formal_parameters.params_list[i].idents.idents.Count;
             if (lambdaDefParamsCount != leftTypeParamsNumber)
                 visitor.AddError(visitor.get_location(lambdaDef), "ILLEGAL_LAMBDA_PARAMETERS_NUMBER");
             bool flag = true;
             SyntaxTree.formal_parameters lambdaDefParamsTypes = new formal_parameters();
             for (int i = 0; i < lambdaDef.formal_parameters.params_list.Count; i++)
                 for (int j = 0; j < lambdaDef.formal_parameters.params_list[i].idents.idents.Count; j++)
                 {
                     var param = new SyntaxTree.typed_parameters();
                     param.idents = new ident_list();
                     param.idents.Add(lambdaDef.formal_parameters.params_list[i].idents.idents[j]);
                     param.vars_type = lambdaDef.formal_parameters.params_list[i].vars_type;
                     lambdaDefParamsTypes.Add(param);
                 }
             for (int i = 0; i < leftTypeParamsNumber && flag; i++)
             {
                 if (lambdaDefParamsTypes.params_list[i].vars_type is SyntaxTree.lambda_inferred_type)
                 {
                     if ((lambdaDefParamsTypes.params_list[i].vars_type as SyntaxTree.lambda_inferred_type).real_type is lambda_any_type_node)
                     {
                         var curLeftParType = dii_left.parameters[i].type;
                         lambdaDefParamsTypes.params_list[i].vars_type = new SyntaxTree.lambda_inferred_type();
                         (lambdaDefParamsTypes.params_list[i].vars_type as SyntaxTree.lambda_inferred_type).real_type = curLeftParType;
                         continue;
                     }
                 }
                 var lambdaPar = visitor.convert_strong(lambdaDefParamsTypes.params_list[i].vars_type);
                 if (!convertion_data_and_alghoritms.eq_type_nodes(dii_left.parameters[i].type, lambdaPar))
                 {
                     visitor.AddError(visitor.get_location(lambdaDef), "ILLEGAL_LAMBDA_VARIABLE_TYPE");
                 }
             }
             lambdaDef.formal_parameters = lambdaDefParamsTypes;
         }
         if (lambdaDef.return_type != null && lambdaDef.return_type is lambda_inferred_type)
         {
             if (dii_left.return_value_type != null)
                 (lambdaDef.return_type as lambda_inferred_type).real_type = dii_left.return_value_type;
             else // SSM 23/07/16 - попытка бороться с var p: Shape->() := a->a.Print()
             {
                 var b = TryConvertFuncLambdaBodyWithMethodCallToProcLambdaBody(lambdaDef);
                 if (!b)
                     throw new SimpleSemanticError(visitor.get_location(lambdaDef), "UNABLE_TO_CONVERT_FUNCTIONAL_TYPE_TO_PROCEDURAL_TYPE");
             }
         }
     }
     else
     {
         if (lambdaDef.formal_parameters != null)
             for (int i = 0; i < lambdaDef.formal_parameters.params_list.Count; i++)
                 if (lambdaDef.formal_parameters.params_list[i].vars_type is lambda_inferred_type)
                     visitor.AddError(visitor.get_location(lambdaDef), "IMPOSSIBLE_TO_INFER_TYPES_IN_LAMBDA");
     }
 }
 private array_const ConvertNDimArrayConst(type_node tn,  int cur_rank, type_node element_type, array_const constant)
 {
 	array_internal_interface aii = tn.get_internal_interface(internal_interface_kind.unsized_array_interface) as array_internal_interface;
 	int rank = aii.rank;
 	for (int i=0; i<constant.element_values.Count; i++)
 	{
 		expression_node e = constant.element_values[i];
 		if (e is array_const)
 		{
 			if (cur_rank>=rank)
 				constant.element_values[i] = ConvertArrayConst(tn.element_type,e as array_const);
 				//AddError(new CanNotConvertTypes(e,e.type,tn.element_type,e.location));
 			else
 			constant.element_values[i] = ConvertNDimArrayConst(tn,cur_rank+1,element_type,e as array_const);
 		}
 		else if (e is record_constant)
     	{
     		if (element_type is common_type_node)
     			constant.element_values[i] = ConvertRecordConst(element_type as common_type_node, e as record_constant);
     		else AddError(new NotSupportedError(constant.element_values[i].location));
     	}
 		else
     	{
 			if (cur_rank != rank)
                 AddError(constant.location, "RANK_MISMATCH_IN_INITILIALIZER");
 			constant.element_values[i] = convert_strong_to_constant_node(constant.element_values[i], element_type);
     	}
 	}
 	constant.SetType(tn);
 	return constant;
 }
Exemplo n.º 15
0
        //Выведение типов
        public static bool DeduceInstanceTypes(type_node formal_type, type_node fact_type, type_node[] deduced, List<int> nils)
        {
            if (formal_type.generic_function_container == null && fact_type.generic_function_container != null)
            {
                //swap
                type_node tmp = formal_type;
                formal_type = fact_type;
                fact_type = tmp;
            }
            //Формальный тип - generic-параметр функции. Выводим.
            if (formal_type.generic_function_container != null)
            {
                int par_num = formal_type.generic_param_index;
                if (fact_type.semantic_node_type == semantic_node_type.null_type_node)
                {
                    nils.Add(par_num);
                    return true;
                }
                if (deduced[par_num] == null)
                {
                    //Этот тип-параметр ещё не был выведен.
                    deduced[par_num] = fact_type;
                    return true;
                }
                //Этот тип-параметр уже был выведен. Сравниваем с выведенным.
                if (!convertion_data_and_alghoritms.eq_type_nodes(fact_type, deduced[par_num], true))
                {
                    return false;
                }
                return true;
            }
            //Указатели
            ref_type_node formal_ref = formal_type as ref_type_node;
            if (formal_ref != null)
            {
                ref_type_node fact_ref = fact_type as ref_type_node;
                if (fact_ref == null)
                {
                    goto eq_cmp;
                }
                return DeduceInstanceTypes(formal_ref.pointed_type, fact_ref.pointed_type, deduced, nils);
            }
            //безразмерные массивы
            array_internal_interface formal_ii = formal_type.get_internal_interface(internal_interface_kind.unsized_array_interface) as array_internal_interface;
            if (formal_ii != null)
            {
                array_internal_interface fact_ii = fact_type.get_internal_interface(internal_interface_kind.unsized_array_interface) as array_internal_interface;
                if (fact_ii == null)
                {
                    goto eq_cmp;
                }
                return DeduceInstanceTypes(formal_ii.element_type, fact_ii.element_type, deduced, nils);
            }
            //множества
            if (formal_type.type_special_kind == PascalABCCompiler.SemanticTree.type_special_kind.set_type)
            {
                if (fact_type.type_special_kind != PascalABCCompiler.SemanticTree.type_special_kind.set_type)
                {
                    goto eq_cmp;
                }
                return DeduceInstanceTypes(formal_type.element_type, fact_type.element_type, deduced, nils);
            }
            //множества
            if (formal_type.type_special_kind == PascalABCCompiler.SemanticTree.type_special_kind.typed_file)
            {
                if (fact_type.type_special_kind != PascalABCCompiler.SemanticTree.type_special_kind.typed_file)
                {
                    goto eq_cmp;
                }
                return DeduceInstanceTypes(formal_type.element_type, fact_type.element_type, deduced, nils);
            }
            //Делегаты
            if (formal_type.IsDelegate)
            {
                //Если текущий параметр - лямбда, то просто выводим дженерик-параметры из типов, которые уже известны. Не трогаем lambda_any_type_node. Остальное выведется в цикле выше 
                var lambda_func = fact_type as delegated_methods;
                if (lambda_func != null 
                    && lambda_func.proper_methods.Count == 1 
                    && LambdaHelper.IsLambdaName(lambda_func.proper_methods[0].simple_function_node.name))
                {
                    var dii = formal_type.get_internal_interface(internal_interface_kind.delegate_interface) as delegate_internal_interface;
                    var fact_func = lambda_func.proper_methods[0].simple_function_node;

                    if (fact_func.parameters.Count != dii.parameters.Count)
                    {
                        goto eq_cmp;
                    }

                    var param_count = fact_func.parameters.Count;

                    for (var i = 0; i < param_count; i++)
                    {
                        if (fact_func.parameters[i].parameter_type != dii.parameters[i].parameter_type ||
                            fact_func.parameters[i].is_params != dii.parameters[i].is_params)
                            goto eq_cmp;
                    }
                    for (var i = 0; i < param_count; i++)
                    {
                        if (fact_func.parameters[i].type is lambda_any_type_node)
                        {
                            continue;
                        }
                        // 07.04.15 - SSM поменял местами первые 2 параметра - видимо, была ошибка
                        if (!DeduceInstanceTypes(dii.parameters[i].type, fact_func.parameters[i].type, deduced, nils))
                        //if (!DeduceInstanceTypes(fact_func.parameters[i].type, dii.parameters[i].type, deduced, nils))
                        {
                            goto eq_cmp;
                        }
                    }
                    if (fact_func.return_value_type == null && dii.return_value_type == null)
                    {
                        //ok
                    }
                    else if (fact_func.return_value_type is lambda_any_type_node) //lroman//
                    {
                        if (dii.return_value_type == null)
                        {
                            goto eq_cmp;
                        }
                        return true;
                    }
                    // 07.04.15 - SSM поменял местами первые 2 параметра - видимо, была ошибка
                    else if (fact_func.return_value_type == null || !DeduceInstanceTypes(dii.return_value_type, fact_func.return_value_type, deduced, nils)) // SSM 29.05.14 - не выводится если IEnumerable<TResult>
//                    else if (fact_func.return_value_type == null || !DeduceInstanceTypes(fact_func.return_value_type, dii.return_value_type, deduced, nils)) // SSM 29.05.14 - не выводится если IEnumerable<TResult>
                    {
                        goto eq_cmp;
                    }
                    return true;
                }

                if (!convertion_data_and_alghoritms.eq_type_nodes(formal_type, fact_type, true))
                {
                    delegate_internal_interface dii = formal_type.get_internal_interface(internal_interface_kind.delegate_interface) as delegate_internal_interface;
                    delegated_methods dm = fact_type as delegated_methods;
                    if (dm != null && dm.proper_methods.Count == 1)
                    {
                        function_node fact_func = dm.proper_methods[0].simple_function_node;
                        if (fact_func.parameters.Count != dii.parameters.Count)
                        {
                            goto eq_cmp;
                        }
                        int param_count = fact_func.parameters.Count;
                        for (int i = 0; i < param_count; i++)
                        {
                            if (fact_func.parameters[i].parameter_type != dii.parameters[i].parameter_type ||
                                fact_func.parameters[i].is_params != dii.parameters[i].is_params)
                                goto eq_cmp;
                        }
                        for (int i = 0; i < param_count; i++)
                        {
                            if (!DeduceInstanceTypes(dii.parameters[i].type, fact_func.parameters[i].type, deduced, nils))      // 07.04.15 - SSM поменял местами первые 2 параметра - видимо, была ошибка
                            //if (!DeduceInstanceTypes(fact_func.parameters[i].type, dii.parameters[i].type, deduced, nils))
                            {
                                goto eq_cmp;
                            }
                        }
                        if (fact_func.return_value_type == null && dii.return_value_type == null)
                        {
                            //ok
                        }
                        else if (fact_func.return_value_type is lambda_any_type_node && dii.return_value_type == null) //lroman//
                        {
                            goto eq_cmp;
                        }
                        // 07.04.15 - SSM поменял местами первые 2 параметра - видимо, была ошибка
                        else if (fact_func.return_value_type == null || !DeduceInstanceTypes(dii.return_value_type, fact_func.return_value_type, deduced, nils)) // SSM 29.05.14 - не выводится если IEnumerable<TResult>
//                        else if (fact_func.return_value_type == null || !DeduceInstanceTypes(fact_func.return_value_type, dii.return_value_type, deduced, nils)) // SSM 29.05.14 - не выводится если IEnumerable<TResult>
                        {
                            goto eq_cmp;
                        }
                        return true;
                    }
                }
                if (fact_type.IsDelegate && fact_type.semantic_node_type == semantic_node_type.delegated_method)
                    return true;
                //goto eq_cmp;
            }
            //Инстанции дженериков
            if (formal_type.is_generic_type_instance)
            {
                //if () goto eq_cmp;
                type_node fact_type_converted; //Сюда будет записан фактический тип или интерфейс, к которому он приводится
                if (!fact_type.is_generic_type_instance || formal_type.original_generic != fact_type.original_generic)
                {
                    if (!formal_type.IsInterface) goto eq_cmp;
                    fact_type_converted = null;
                    if (fact_type.ImplementingInterfaces != null)
                    foreach (type_node ti in fact_type.ImplementingInterfaces)
                    {
                        if (ti.original_generic == formal_type.original_generic)
                        {
                            fact_type_converted = ti;
                            break;
                        }
                    }
                    if (fact_type_converted == null) goto eq_cmp;
                }
                else
                {
                    fact_type_converted = fact_type;
                }
                int pcount = formal_type.instance_params.Count;
                for (int k = 0; k < pcount; ++k)
                {
                    if (!DeduceInstanceTypes(formal_type.instance_params[k], fact_type_converted.instance_params[k], deduced, nils))
                    {
                        goto eq_cmp;
                    }
                }
                return true;
            }
            //Если совпадают - всё хорошо.
            eq_cmp:
            if (convertion_data_and_alghoritms.eq_type_nodes(formal_type, fact_type, true))
            {
                return true;
            }
            possible_type_convertions ptc = type_table.get_convertions(fact_type, formal_type);
            if (ptc.first != null)
            {
                return true;
            }
            return false;
        }
 private array_const ConvertArrayConst(type_node tn, array_const constant)
 {
     type_node element_type = null;
     if (IsBoundedArray(tn))
     {
         bounded_array_interface bai = tn.get_internal_interface(internal_interface_kind.bounded_array_interface) as bounded_array_interface;
         element_type = bai.element_type;
         ordinal_type_interface oti_indexer = bai.ordinal_type_interface;
         int arr_length = oti_indexer.ordinal_type_to_int(oti_indexer.upper_value) - oti_indexer.ordinal_type_to_int(oti_indexer.lower_value) + 1;
         if (arr_length != constant.element_values.Count)
             AddError(constant.location, "ARRAY_CONST_{0}_ELEMENTS_EXPECTED", arr_length);
     }
     else
         if (IsUnsizedArray(tn))
         {
             array_internal_interface aii = tn.get_internal_interface(internal_interface_kind.unsized_array_interface) as array_internal_interface;
             element_type = aii.element_type;
             if (aii.rank > 1)
             {
             	array_const cnst = ConvertNDimArrayConst(tn,1,element_type,constant);
             	cnst.SetType(tn);
             	return cnst;
             }
         }
         else
             throw new CompilerInternalError("Unexpected array type");
     for (int i = 0; i < constant.element_values.Count; i++)
         constant.element_values[i] = convert_strong_to_constant_node(constant.element_values[i], element_type);
     constant.SetType(tn);
     return constant;
 }
        //DS добавил этот метод
        //А так ли это надо делать?
        //Сергей, может ты знаеш?
        internal static bool eq_type_nodes(type_node tn1, type_node tn2, bool strong)
        {
            if (tn1 == tn2)
                return true;
            if (tn1 == null || tn2 == null)
            {
                return false;
            }
			if (tn1 is lambda_any_type_node || tn2 is lambda_any_type_node) //lroman// Считаем, что тип lambda_any_type_node равен всем типам. Это используется при выводе параметров лямбды
                return true;
            if (tn1.generic_function_container != null && tn2.generic_function_container != null)
            {
                if (strong && tn1.generic_function_container != tn2.generic_function_container)
                {
                    return false;
                }
                return (tn1.generic_param_index == tn2.generic_param_index);
            }
            if (tn1.type_special_kind != tn2.type_special_kind)
            {
                return false;
            }
            switch (tn1.type_special_kind)
            {
                case type_special_kind.array_kind:
                case type_special_kind.set_type:
                case type_special_kind.typed_file:
                    if (tn1.type_special_kind == type_special_kind.array_kind)
                    {
                        if (tn1 is compiled_type_node && tn2 is compiled_type_node && (tn1 as compiled_type_node).rank != (tn2 as compiled_type_node).rank)
                            return false;
                        if (tn1 is common_type_node && tn2 is common_type_node && (tn1 as common_type_node).rank != (tn2 as common_type_node).rank)
                            return false;
                    }
                    return eq_type_nodes(tn1.element_type, tn2.element_type, strong);
            }
            ref_type_node rtn1 = tn1 as ref_type_node;
            if (rtn1 != null)
            {
                ref_type_node rtn2 = tn2 as ref_type_node;
                if (rtn2 == null)
                {
                    return false;
                }
                return eq_type_nodes(rtn1.pointed_type, rtn2.pointed_type, strong);
            }
            if (tn1.is_generic_type_definition && tn2.is_generic_type_instance ||
                tn2.is_generic_type_definition && tn1.is_generic_type_instance)
            {
                type_node tdef, tinst;
                if (tn1.is_generic_type_definition)
                {
                    tdef = tn1;
                    tinst = tn2;
                }
                else
                {
                    tdef = tn2;
                    tinst = tn1;
                }
                if (tinst.original_generic != tdef)
                {
                    return false;
                }
                common_type_node ctdef = tdef as common_type_node;
                int count = ctdef.generic_params.Count;
                for (int i = 0; i < count; ++i)
                {
                    if (ctdef.generic_params[i] != tinst.instance_params[i])
                    {
                        return false;
                    }
                }
                return true;
            }

            if (tn1.is_generic_type_instance)
            {
                if (!tn2.is_generic_type_instance)
                {
                    return false;
                }
                if (tn1.original_generic != tn2.original_generic)
                {
                    return false;
                }
                int count = tn1.instance_params.Count;
                for (int i = 0; i < count; ++i)
                {
                    if (!eq_type_nodes(tn1.instance_params[i], tn2.instance_params[i], strong))
                    {
                        return false;
                    }
                }
                return true;
            }
            if (tn1.get_internal_interface(internal_interface_kind.delegate_interface) != null)
            {
                delegate_internal_interface d1 = tn1.get_internal_interface(internal_interface_kind.delegate_interface) as delegate_internal_interface;
                delegate_internal_interface d2 = tn2.get_internal_interface(internal_interface_kind.delegate_interface) as delegate_internal_interface;
                if (d2 != null)
                    return function_eq_params_and_result(d1.invoke_method, d2.invoke_method);
            }
            return false;
        }
 private bool CanUseThisTypeForFiles(type_node el_type, bool allow_strings)
 {
     if (el_type.is_generic_parameter)
     {
         if (SemanticRules.AllowGenericParametersForFiles)
         {
             if (allow_strings)
                 get_type_abilities(el_type).useful_for_binary_files = true;
             else
                 get_type_abilities(el_type).useful_for_typed_files = true;
             return true;
         }
         else
         {
             return false;
         }
     }
     if (el_type.type_special_kind == SemanticTree.type_special_kind.short_string)
     	return true;
 	if (el_type.type_special_kind == SemanticTree.type_special_kind.set_type)
 	{
 		if (el_type.element_type == SystemLibrary.SystemLibrary.byte_type || el_type.element_type == SystemLibrary.SystemLibrary.sbyte_type
 		   || el_type.element_type == SystemLibrary.SystemLibrary.bool_type || el_type.element_type.IsEnum) return true;
 		else if (el_type.element_type.type_special_kind == SemanticTree.type_special_kind.diap_type)
 		{
 			if (el_type.element_type.base_type == SystemLibrary.SystemLibrary.byte_type || el_type.element_type.base_type == SystemLibrary.SystemLibrary.sbyte_type
 		   || el_type.element_type.base_type == SystemLibrary.SystemLibrary.bool_type || el_type.element_type.base_type.IsEnum) return true;
 			if (el_type.element_type.base_type == SystemLibrary.SystemLibrary.integer_type)
 			{
 				ordinal_type_interface oti = el_type.element_type.get_internal_interface(internal_interface_kind.ordinal_interface) as ordinal_type_interface;
 				if (((oti.upper_value as int_const_node).constant_value-(oti.lower_value as int_const_node).constant_value) <= 256)
 					return true;
 			}
 			
 			return false;
 		}
 		return false;
 	}
 	if (el_type.is_value)
     {
         generic_instance_type_node gitn = el_type as generic_instance_type_node;
         if (gitn != null)
         {
             List<type_node> ftypes = gitn.all_field_types;
             foreach (type_node ftype in ftypes)
             {
                 if (!CanUseThisTypeForFiles(ftype, allow_strings))
                     return false;
             }
             return true;
         }
         if (SystemLibrary.SystemLibrary.CanUseThisTypeForTypedFiles(el_type))
             return true;
         if (el_type is common_type_node)
         {
         	if (el_type as common_type_node == context.converted_type ||
                 (el_type.original_generic != null && el_type.original_generic == context.converted_type))
         		return false;
         	common_type_node ctn = el_type as common_type_node;
             foreach (class_field cf in ctn.fields)
             	if (cf.type.type_special_kind != SemanticTree.type_special_kind.short_string && !CanUseThisTypeForFiles(cf.type, allow_strings))
                     return false;
             return true;
         }
         if (el_type is compiled_type_node)
         {
             compiled_type_node ctn = el_type as compiled_type_node;
             if (!ctn.compiled_type.IsLayoutSequential)
             	return false;
             System.Reflection.FieldInfo[] fields = ctn.compiled_type.GetFields();
             foreach (System.Reflection.FieldInfo fi in fields)
                 if (!fi.IsStatic)
                     if (!CanUseThisTypeForFiles(compiled_type_node.get_type_node(fi.FieldType), allow_strings))
                         return false;
             return true;
         }
     }
     if (IsBoundedArray(el_type))
     {
         //это обычный массив
         bounded_array_interface bai = (bounded_array_interface)el_type.get_internal_interface(internal_interface_kind.bounded_array_interface);
         return CanUseThisTypeForFiles(bai.element_type, allow_strings);
     }
     if (allow_strings && el_type == SystemLibrary.SystemLibrary.string_type)
     {
         return true;
     }
     return false;
 }
Exemplo n.º 19
0
        public override function_node get_implicit_conversion_to(type_node ctn)
        {
            foreach (base_function_call fn in _proper_methods)
            {
                if (fn.simple_function_node.parameters.Count == 0
                    || (fn.simple_function_node is common_namespace_function_node && (fn.simple_function_node as common_namespace_function_node).ConnectedToType != null 
                            || fn.simple_function_node is compiled_function_node && (fn.simple_function_node as compiled_function_node).ConnectedToType != null)
                    && fn.simple_function_node.parameters.Count == 1 && !fn.simple_function_node.parameters[0].is_params)
                {
                    if (fn.simple_function_node.return_value_type == ctn)
                    {
                        convert_function_to_function_call cftfc = new convert_function_to_function_call(fn);
                        return (new convert_types_function_node(cftfc.compile_time_executor, true));
                    }
                    if (fn.simple_function_node.return_value_type == null)
                    {
                        continue;
                    }
                    //TODO: Очень внимательно рассмотреть. Если преобразование типов должно идти через compile_time_executor.
                    possible_type_convertions ptc=type_table.get_convertions(fn.simple_function_node.return_value_type, ctn);
                    if ((ptc.first == null) || (ptc.first.convertion_method == null))
                    {
                        continue;
                    }
                    expression_node ennew=type_table.type_table_function_call_maker(ptc.first.convertion_method, null, fn);
                    convert_function_to_function_call cftfc2 = new convert_function_to_function_call(ennew);
                    return (new convert_types_function_node(cftfc2.compile_time_executor, false));
                }
                else if (fn.simple_function_node.parameters.Count == 1 && fn.simple_function_node.parameters[0].is_params ||
                    (fn.simple_function_node is common_namespace_function_node && (fn.simple_function_node as common_namespace_function_node).ConnectedToType != null || fn.simple_function_node is compiled_function_node && (fn.simple_function_node as compiled_function_node).ConnectedToType != null) 
                    && fn.simple_function_node.parameters.Count == 2 && fn.simple_function_node.parameters[1].is_params)
                {
                    base_function_call copy_fn = get_function_call_copy(fn);
                    int param_num = (fn.simple_function_node is common_namespace_function_node && (fn.simple_function_node as common_namespace_function_node).ConnectedToType != null || fn.simple_function_node is compiled_function_node && (fn.simple_function_node as compiled_function_node).ConnectedToType != null) ? 1 : 0;
                	if (fn.simple_function_node.return_value_type == ctn)
                    {
                		common_namespace_function_call cnfc = new common_namespace_function_call(SystemLibrary.SystemLibInitializer.NewArrayProcedureDecl,null);
                        cnfc.parameters.AddElement(new typeof_operator(fn.simple_function_node.parameters[param_num].type, null));
                		cnfc.parameters.AddElement(new int_const_node(0,null));
                        if (copy_fn.parameters.Count < fn.simple_function_node.parameters.Count)
                            copy_fn.parameters.AddElement(cnfc);
                		convert_function_to_function_call cftfc = new convert_function_to_function_call(copy_fn);
                        return (new convert_types_function_node(cftfc.compile_time_executor, true));
                        
                    }
                    if (fn.simple_function_node.return_value_type == null)
                    {
                        continue;
                    }
                    //TODO: Очень внимательно рассмотреть. Если преобразование типов должно идти через compile_time_executor.
                    possible_type_convertions ptc=type_table.get_convertions(fn.simple_function_node.return_value_type, ctn);
                    if ((ptc.first == null) || (ptc.first.convertion_method == null))
                    {
                        continue;
                    }
                    common_namespace_function_call cnfc2 = new common_namespace_function_call(SystemLibrary.SystemLibInitializer.NewArrayProcedureDecl,null);
                    cnfc2.parameters.AddElement(new typeof_operator(fn.simple_function_node.parameters[param_num].type, null));
                	cnfc2.parameters.AddElement(new int_const_node(0,null));
                    if (copy_fn.parameters.Count < fn.simple_function_node.parameters.Count)
                        copy_fn.parameters.AddElement(cnfc2);
                    expression_node ennew=type_table.type_table_function_call_maker(ptc.first.convertion_method, null, copy_fn);
                    convert_function_to_function_call cftfc2 = new convert_function_to_function_call(ennew);
                    return (new convert_types_function_node(cftfc2.compile_time_executor, false));
                }
                else if (fn.simple_function_node.parameters.Count == 1 && fn.simple_function_node.parameters[0].default_value != null ||
                    (fn.simple_function_node is common_namespace_function_node && (fn.simple_function_node as common_namespace_function_node).ConnectedToType != null || fn.simple_function_node is compiled_function_node && (fn.simple_function_node as compiled_function_node).ConnectedToType != null)
                    && fn.simple_function_node.parameters.Count == 2 && fn.simple_function_node.parameters[1].default_value != null)
                {
                    int param_num = (fn.simple_function_node is common_namespace_function_node && (fn.simple_function_node as common_namespace_function_node).ConnectedToType != null || fn.simple_function_node is compiled_function_node && (fn.simple_function_node as compiled_function_node).ConnectedToType != null) ? 1 : 0;
                    base_function_call copy_fn = null;
                    if (fn.simple_function_node.return_value_type == ctn)
                    {
                        copy_fn = get_function_call_copy(fn);
                        copy_fn.parameters.AddElement(fn.simple_function_node.parameters[param_num].default_value);
                        convert_function_to_function_call cftfc = new convert_function_to_function_call(copy_fn);
                        return (new convert_types_function_node(cftfc.compile_time_executor, true));

                    }
                    if (fn.simple_function_node.return_value_type == null)
                    {
                        continue;
                    }
                    //TODO: Очень внимательно рассмотреть. Если преобразование типов должно идти через compile_time_executor.
                    possible_type_convertions ptc = type_table.get_convertions(fn.simple_function_node.return_value_type, ctn);
                    if ((ptc.first == null) || (ptc.first.convertion_method == null))
                    {
                        continue;
                    }
                    copy_fn = get_function_call_copy(fn);
                    copy_fn.parameters.AddElement(fn.simple_function_node.parameters[param_num].default_value);
                    expression_node ennew = type_table.type_table_function_call_maker(ptc.first.convertion_method, null, copy_fn);
                    convert_function_to_function_call cftfc2 = new convert_function_to_function_call(ennew);
                    return (new convert_types_function_node(cftfc2.compile_time_executor, false));
                }
                else if (fn.simple_function_node.parameters.Count == fn.simple_function_node.num_of_default_parameters)
                {
                    base_function_call copy_fn = get_function_call_copy(fn);
                    if (fn.simple_function_node.return_value_type == ctn)
                    {
                        foreach (parameter p in fn.simple_function_node.parameters)
                            copy_fn.parameters.AddElement(p.default_value);
                        convert_function_to_function_call cftfc = new convert_function_to_function_call(copy_fn);
                        return (new convert_types_function_node(cftfc.compile_time_executor, true));
                    }
                    if (fn.simple_function_node.return_value_type == null)
                    {
                        continue;
                    }
                    //TODO: Очень внимательно рассмотреть. Если преобразование типов должно идти через compile_time_executor.
                    possible_type_convertions ptc = type_table.get_convertions(fn.simple_function_node.return_value_type, ctn);
                    if ((ptc.first == null) || (ptc.first.convertion_method == null))
                    {
                        continue;
                    }
                    foreach (parameter p in fn.simple_function_node.parameters)
                        copy_fn.parameters.AddElement(p.default_value);
                    expression_node ennew = type_table.type_table_function_call_maker(ptc.first.convertion_method, null, copy_fn);
                    convert_function_to_function_call cftfc2 = new convert_function_to_function_call(ennew);
                    return (new convert_types_function_node(cftfc2.compile_time_executor, false));
                }
            }

            internal_interface ii = ctn.get_internal_interface(internal_interface_kind.delegate_interface);
            if (ii == null)
            {
            	if (ctn is compiled_type_node && (ctn as compiled_type_node).IsDelegate)
            	{
            		common_type_node del =
            			type_constructor.instance.create_delegate(compilation_context.instance.get_delegate_type_name(), this.proper_methods[0].simple_function_node.return_value_type, this.proper_methods[0].simple_function_node.parameters, compilation_context.instance.converted_namespace, null);
            		compilation_context.instance.converted_namespace.types.AddElement(del);
            		ii = del.get_internal_interface(internal_interface_kind.delegate_interface);
            	}
            	else
            	return null;
            }

            delegate_internal_interface dii = (delegate_internal_interface)ii;
			
            base_function_call _finded_call = null;

            foreach(base_function_call bfn in _proper_methods)
            {
                if (bfn.simple_function_node.parameters.Count != dii.parameters.Count)
                {
                    continue;
                }
                if (bfn.simple_function_node.return_value_type != dii.return_value_type)
                {
                    if (!type_table.is_derived(dii.return_value_type, bfn.simple_function_node.return_value_type)) // SSM 21/05/15
                        if (!(bfn.ret_type is lambda_any_type_node)) //lroman//
                            continue;
                }
                bool find_eq = true;
                int i=0;
                while ((find_eq == true) && (i<bfn.simple_function_node.parameters.Count))
                {
                    /*var a1 = bfn.simple_function_node.parameters[i].type != dii.parameters[i].type;
                    var a2 = bfn.simple_function_node.parameters[i].parameter_type != dii.parameters[i].parameter_type;
                    var a3 = bfn.simple_function_node.parameters[i].is_params != dii.parameters[i].is_params;*/
                    //lroman// Добавил все, что связано с lambda_any_type_node. Считаем, что этот тип равен всем типам. Это используется при выводе параметров лямбды
                    if ((bfn.simple_function_node.parameters[i].type != dii.parameters[i].type && !(bfn.simple_function_node.parameters[i].type is lambda_any_type_node)) ||
                        (bfn.simple_function_node.parameters[i].parameter_type != dii.parameters[i].parameter_type && !(bfn.simple_function_node.parameters[i].parameter_type is lambda_any_type_node)) 
                	    || bfn.simple_function_node.parameters[i].is_params != dii.parameters[i].is_params)
                    {
                        find_eq = false;
                    }
                    i++;
                }
                if (find_eq)
                {
                    _finded_call = bfn;
                    break;
                }
            }

            //Вообщето если мы можем найти более одного вызова функции в цикле выше, то это внутренняя ошибка компилятора, но мы не будем ругаться.
            if (_finded_call == null)
            {
                return null;
            }

            if ((_finded_call is common_constructor_call) || (_finded_call is compiled_constructor_call))
            {
                return null;
            }

            common_method_node cmn = dii.constructor as common_method_node;
            if (cmn != null)
            {
                common_constructor_call ccc = new common_constructor_call(cmn, null);
                ccc.parameters.AddElement(_finded_call);
                convert_function_to_function_call cftfc = new convert_function_to_function_call(ccc);
                return (new convert_types_function_node(cftfc.compile_time_executor, false));
            }

            compiled_constructor_node ccn = dii.constructor as compiled_constructor_node;
            if (ccn != null)
            {
                compiled_constructor_call ccc = new compiled_constructor_call(ccn, null);
                ccc.parameters.AddElement(_finded_call);
                convert_function_to_function_call cftfc = new convert_function_to_function_call(ccc);
                return (new convert_types_function_node(cftfc.compile_time_executor, false));
            }

            //Тут вообщето тоже внутренняя ошибка компилятора. (Не откомпилированный и не обычный конструктор).

            return null;
        }
        //запись ссылки на тип
        //флаг|смещение
		private void WriteTypeReference(type_node type)
		{
            if (type == null)
            {
                bw.Write((System.Byte)255);
                return;
            }
			//если это массив
            if (type.semantic_node_type == semantic_node_type.simple_array)
            {
                WriteArrayType((simple_array)type);
                return;
            }
            //если это указатель
            //Наверно также надо сохранять Pointer,
            //  пока он востанавливается из таблицы nethelper.special_types
            if (type.semantic_node_type == semantic_node_type.ref_type_node)
            {
                WritePointerType((ref_type_node)type);
                return;
            }
            if (type.semantic_node_type == semantic_node_type.short_string)
            {
            	WriteShortStringType((short_string_type_node)type);
            	return;
            }
            internal_interface ii=type.get_internal_interface(internal_interface_kind.unsized_array_interface);
            //(ssyy) 18.05.2008 Убрал проверку на compiled_type_node
            if (ii != null) //&& type.element_type is compiled_type_node)
            {
                array_internal_interface aii=(array_internal_interface)ii;
                WriteUnsizedArrayType(type,aii);
                return;
            }
            /*
            ii = type.get_internal_interface(internal_interface_kind.bounded_array_interface);
            if (ii != null)
            {
                bounded_array_interface bai = (bounded_array_interface)ii;
                WriteBoundedArray(bai);
                return;
            }
            */
            
            //Пишем параметр generic-типа
            if (type.is_generic_parameter)
            {
                WriteGenericParameter(type as common_type_node);
                return;
            }

            //Пишем инстанцию generic-типа
            generic_instance_type_node gitn = type as generic_instance_type_node;
            if (gitn != null)
            {
                WriteGenericTypeInstance(gitn);
                return;
            }

            //Пишем инстанцию шаблонного класса
            common_type_node c_t_n = type as common_type_node;
            if (c_t_n != null && c_t_n.original_template != null)
            {
                WriteTemplateInstance(c_t_n);
                return;
            }

            byte is_def = 0;
			int offset = GetTypeReference(type, ref is_def);
			bw.Write(is_def); //пишем флаг импортируемый ли это тип или нет
			bw.Write(offset); // сохраняем его смещение (это либо смещение в самом модуле, либо в списке импорт. сущностей)
		}
Exemplo n.º 21
0
		//TODO: Усовершенствовать. Как должны выглядеть типы-диапазоны для net-кода. Изменить методы inc и dec так, чтобы они генерировали исключения в случае выхода за границы типа диапазона.
		private type_node create_diap_type(type_node element_type, constant_node lower_value, constant_node upper_value,common_namespace_node _cmn)
		{
			SymbolTable.Scope top_scope = null;
			if (_cmn != null)
			{
				top_scope = _cmn.scope;
			}
			//basic_type_node btn=new basic_type_node(element_type.name+"_diap");
			common_type_node ctn = new common_type_node(element_type, get_diap_type_name(lower_value, upper_value, element_type.name), SemanticTree.type_access_level.tal_internal,
			                                            _cmn, convertion_data_and_alghoritms.symbol_table.CreateClassScope(top_scope, null), null);
			ctn.type_special_kind = PascalABCCompiler.SemanticTree.type_special_kind.diap_type;
			ctn.internal_is_value = true;
			internal_interface ii = element_type.get_internal_interface(internal_interface_kind.ordinal_interface);
			ordinal_type_interface oti_old = (ordinal_type_interface)ii;

			//TODO: Переделать создание потомков oti.
			ordinal_type_interface oti_new = new ordinal_type_interface(oti_old.inc_method, oti_old.dec_method,
			                                                            oti_old.inc_value_method,oti_old.dec_value_method,
			                                                            oti_old.lower_eq_method, oti_old.greater_eq_method, 
			                                                            oti_old.lower_method, oti_old.greater_method,
			                                                            lower_value, upper_value, oti_old.value_to_int, oti_old.ordinal_type_to_int);
			//type_table.add_type_conversion_from_defined(ctn,SystemLibrary.SystemLibrary.integer_type,new basic_function_node(PascalABCCompiler.SemanticTree.basic_function_type.none,ctn,true,"diaptoord"),type_compare.less_type,true);
			//type_table.add_type_conversion_from_defined(SystemLibrary.SystemLibrary.integer_type,ctn,new basic_function_node(PascalABCCompiler.SemanticTree.basic_function_type.none,ctn,true,"ordtodiap"),type_compare.less_type,true);
			//element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.iassign)));
			//type_table.add_type_conversion_from_defined(ctn,SystemLibrary.SystemLibrary.byte_type,new basic_function_node(PascalABCCompiler.SemanticTree.basic_function_type.none,ctn,true,"diaptoord"),type_compare.less_type,true);
			//type_table.add_type_conversion_from_defined(SystemLibrary.SystemLibrary.byte_type,ctn,new basic_function_node(PascalABCCompiler.SemanticTree.basic_function_type.none,ctn,true,"ordtodiap"),type_compare.less_type,true);
			
			//type_table.add_type_conversion_from_defined(ctn,element_type,new basic_function_node(PascalABCCompiler.SemanticTree.basic_function_type.none,element_type,false,"diaptoord"),type_compare.less_type,true);
			//type_table.add_type_conversion_from_defined(ctn,SystemLibrary.SystemLibrary.integer_type,new basic_function_node(PascalABCCompiler.SemanticTree.basic_function_type.none,ctn,true,"diaptoord"),type_compare.less_type,true);
			
			if (element_type != SystemLibrary.SystemLibrary.char_type && element_type != SystemLibrary.SystemLibrary.bool_type)
			{
				element_type.add_generated_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.iassign)));
				/*element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.bassign)));
            	element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.sassign)));
            	element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.sbassign)));
            	element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.usassign)));
            	element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.uiassign)));
            	element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.lassign)));
            	element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.ulassign)));*/
			}
			else if (element_type == SystemLibrary.SystemLibrary.char_type)
                element_type.add_generated_name(compiler_string_consts.assign_name, new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn, PascalABCCompiler.SemanticTree.basic_function_type.charassign)));
			else if (element_type == SystemLibrary.SystemLibrary.bool_type)
                element_type.add_generated_name(compiler_string_consts.assign_name, new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn, PascalABCCompiler.SemanticTree.basic_function_type.boolassign)));
			else if (element_type.IsEnum)
			{
                element_type.add_generated_name(compiler_string_consts.assign_name, new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn, PascalABCCompiler.SemanticTree.basic_function_type.iassign)));
                element_type.add_generated_name(compiler_string_consts.assign_name, new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(element_type, PascalABCCompiler.SemanticTree.basic_function_type.iassign)));
			}
			if (element_type == SystemLibrary.SystemLibrary.integer_type)
			{
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.byte_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.itob,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.sbyte_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.itosb,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.short_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.itos,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.ushort_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.itous,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.uint_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.itoui,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.int64_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itol,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.uint64_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itoul,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.double_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itod,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.float_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itof,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.char_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.itochar,false);
				
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.byte_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.btoi,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.sbyte_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.sbtoi,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.short_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.stoi,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.ushort_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.ustoi,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.integer_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.none,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.uint_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.uitoi,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.int64_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ltoi,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.uint64_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ultoi,true);
				//SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.real_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itod,true);
				//SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.float_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itof,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.char_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartoi,false);
				
				//SystemLibrary.SystemLibrary.make_unary_empty_operator(compiler_string_consts.plus_name, ctn, ctn);
                SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.not_name, ctn, SystemLibrary.SystemLibrary.int_not);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_unmin);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.gr_name, ctn, SystemLibrary.SystemLibrary.int_gr);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.greq_name, ctn, SystemLibrary.SystemLibrary.int_greq);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.sm_name, ctn, SystemLibrary.SystemLibrary.int_sm);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.smeq_name, ctn, SystemLibrary.SystemLibrary.int_smeq);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.eq_name, ctn, SystemLibrary.SystemLibrary.int_eq);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.noteq_name, ctn, SystemLibrary.SystemLibrary.int_noteq);

				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.plus_name, ctn, SystemLibrary.SystemLibrary.int_add);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_sub);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mul_name, ctn, SystemLibrary.SystemLibrary.int_mul);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.idiv_name, ctn, SystemLibrary.SystemLibrary.int_idiv);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mod_name, ctn, SystemLibrary.SystemLibrary.int_mod);
				
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.and_name, ctn, SystemLibrary.SystemLibrary.int_and);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.or_name, ctn, SystemLibrary.SystemLibrary.int_or);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.xor_name, ctn, SystemLibrary.SystemLibrary.int_xor);
				
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shl_name, ctn, SystemLibrary.SystemLibrary.int_shl);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shr_name, ctn, SystemLibrary.SystemLibrary.int_shr);
			}
			else if (element_type == SystemLibrary.SystemLibrary.byte_type)
			{
				//SystemLibrary.SystemLibrary.make_generated_type_conversion(tctn,SystemLibrary.SystemLibrary.byte_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.itob,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.sbyte_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.btosb,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.short_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.btos,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.ushort_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.btous,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.integer_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.btoi,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.uint_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.btoui,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.int64_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.btol,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.uint64_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.btoul,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.double_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.btod,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.float_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.btof,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.char_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.btochar,false);
				
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.byte_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.none,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.sbyte_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.sbtob,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.short_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.stob,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.ushort_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ustob,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.integer_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.uitob,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.uint_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.uitob,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.int64_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ltob,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.uint64_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ultob,true);
				//SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.real_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itod,true);
				//SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.float_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itof,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.char_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.chartob,false);
				
				//SystemLibrary.SystemLibrary.make_unary_empty_operator(compiler_string_consts.plus_name, ctn, ctn);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.not_name, ctn, SystemLibrary.SystemLibrary.int_not);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_unmin);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.gr_name, ctn, SystemLibrary.SystemLibrary.int_gr);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.greq_name, ctn, SystemLibrary.SystemLibrary.int_greq);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.sm_name, ctn, SystemLibrary.SystemLibrary.int_sm);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.smeq_name, ctn, SystemLibrary.SystemLibrary.int_smeq);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.eq_name, ctn, SystemLibrary.SystemLibrary.int_eq);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.noteq_name, ctn, SystemLibrary.SystemLibrary.int_noteq);

				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.plus_name, ctn, SystemLibrary.SystemLibrary.int_add);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_sub);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mul_name, ctn, SystemLibrary.SystemLibrary.int_mul);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.idiv_name, ctn, SystemLibrary.SystemLibrary.int_idiv);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mod_name, ctn, SystemLibrary.SystemLibrary.int_mod);
				
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.and_name, ctn, SystemLibrary.SystemLibrary.int_and);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.or_name, ctn, SystemLibrary.SystemLibrary.int_or);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.xor_name, ctn, SystemLibrary.SystemLibrary.int_xor);
				
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shl_name, ctn, SystemLibrary.SystemLibrary.int_shl);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shr_name, ctn, SystemLibrary.SystemLibrary.int_shr);
			}
			else if (element_type == SystemLibrary.SystemLibrary.sbyte_type)
			{
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.byte_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.sbtob,true);
				//SystemLibrary.SystemLibrary.make_generated_type_conversion(tctn,SystemLibrary.SystemLibrary.sbyte_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.short_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.sbtos,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.ushort_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.sbtous,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.integer_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.sbtoi,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.uint_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.sbtoui,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.int64_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.sbtol,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.uint64_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.sbtoul,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.double_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.sbtod,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.float_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.sbtof,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.char_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.sbtochar,false);
				
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.byte_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.btosb,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.sbyte_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.none,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.short_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.stosb,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.ushort_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ustosb,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.integer_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.uitosb,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.uint_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.uitosb,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.int64_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ltosb,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.uint64_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ultosb,true);
				//SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.real_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itod,true);
				//SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.float_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itof,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.char_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.chartosb,false);
				
				//SystemLibrary.SystemLibrary.make_unary_empty_operator(compiler_string_consts.plus_name, ctn, ctn);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.not_name, ctn, SystemLibrary.SystemLibrary.int_not);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_unmin);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.gr_name, ctn, SystemLibrary.SystemLibrary.int_gr);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.greq_name, ctn, SystemLibrary.SystemLibrary.int_greq);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.sm_name, ctn, SystemLibrary.SystemLibrary.int_sm);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.smeq_name, ctn, SystemLibrary.SystemLibrary.int_smeq);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.eq_name, ctn, SystemLibrary.SystemLibrary.int_eq);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.noteq_name, ctn, SystemLibrary.SystemLibrary.int_noteq);

				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.plus_name, ctn, SystemLibrary.SystemLibrary.int_add);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_sub);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mul_name, ctn, SystemLibrary.SystemLibrary.int_mul);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.idiv_name, ctn, SystemLibrary.SystemLibrary.int_idiv);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mod_name, ctn, SystemLibrary.SystemLibrary.int_mod);
				
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.and_name, ctn, SystemLibrary.SystemLibrary.int_and);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.or_name, ctn, SystemLibrary.SystemLibrary.int_or);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.xor_name, ctn, SystemLibrary.SystemLibrary.int_xor);
				
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shl_name, ctn, SystemLibrary.SystemLibrary.int_shl);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shr_name, ctn, SystemLibrary.SystemLibrary.int_shr);
			}
			else if (element_type == SystemLibrary.SystemLibrary.short_type)
			{
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.byte_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.stob,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.sbyte_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.stosb,true);
				//SystemLibrary.SystemLibrary.make_generated_type_conversion(tctn,SystemLibrary.SystemLibrary.short_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.btos,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.ushort_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.stous,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.integer_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.stoi,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.uint_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.stoui,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.int64_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.stol,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.uint64_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.stoul,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.double_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.stod,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.float_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.stof,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.char_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.stochar,false);
				
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.byte_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.btos,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.sbyte_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.sbtos,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.short_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.none,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.ushort_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.ustos,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.integer_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.uitos,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.uint_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.uitos,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.int64_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ltos,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.uint64_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ultos,true);
				//SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.real_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itod,true);
				//SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.float_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itof,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.char_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartos,false);
				
				//SystemLibrary.SystemLibrary.make_unary_empty_operator(compiler_string_consts.plus_name, ctn, ctn);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.not_name, ctn, SystemLibrary.SystemLibrary.int_not);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_unmin);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.gr_name, ctn, SystemLibrary.SystemLibrary.int_gr);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.greq_name, ctn, SystemLibrary.SystemLibrary.int_greq);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.sm_name, ctn, SystemLibrary.SystemLibrary.int_sm);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.smeq_name, ctn, SystemLibrary.SystemLibrary.int_smeq);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.eq_name, ctn, SystemLibrary.SystemLibrary.int_eq);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.noteq_name, ctn, SystemLibrary.SystemLibrary.int_noteq);

				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.plus_name, ctn, SystemLibrary.SystemLibrary.int_add);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_sub);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mul_name, ctn, SystemLibrary.SystemLibrary.int_mul);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.idiv_name, ctn, SystemLibrary.SystemLibrary.int_idiv);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mod_name, ctn, SystemLibrary.SystemLibrary.int_mod);
				
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.and_name, ctn, SystemLibrary.SystemLibrary.int_and);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.or_name, ctn, SystemLibrary.SystemLibrary.int_or);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.xor_name, ctn, SystemLibrary.SystemLibrary.int_xor);
				
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shl_name, ctn, SystemLibrary.SystemLibrary.int_shl);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shr_name, ctn, SystemLibrary.SystemLibrary.int_shr);
			}
			else if (element_type == SystemLibrary.SystemLibrary.ushort_type)
			{
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.byte_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ustob,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.sbyte_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ustosb,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.short_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.ustos,true);
				//SystemLibrary.SystemLibrary.make_generated_type_conversion(tctn,SystemLibrary.SystemLibrary.ushort_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.stous,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.integer_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.ustoi,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.uint_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.ustoui,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.int64_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.ustol,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.uint64_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.ustoul,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.double_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.ustod,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.float_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.ustof,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.char_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ustochar,false);
				
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.byte_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.btous,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.sbyte_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.sbtous,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.short_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.stous,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.ushort_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.none,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.integer_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.uitous,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.uint_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.uitous,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.int64_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ltous,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.uint64_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ultous,true);
				//SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.real_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itod,true);
				//SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.float_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itof,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.char_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartous,false);
				
				//SystemLibrary.SystemLibrary.make_unary_empty_operator(compiler_string_consts.plus_name, ctn, ctn);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.not_name, ctn, SystemLibrary.SystemLibrary.int_not);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_unmin);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.gr_name, ctn, SystemLibrary.SystemLibrary.int_gr);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.greq_name, ctn, SystemLibrary.SystemLibrary.int_greq);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.sm_name, ctn, SystemLibrary.SystemLibrary.int_sm);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.smeq_name, ctn, SystemLibrary.SystemLibrary.int_smeq);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.eq_name, ctn, SystemLibrary.SystemLibrary.int_eq);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.noteq_name, ctn, SystemLibrary.SystemLibrary.int_noteq);

				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.plus_name, ctn, SystemLibrary.SystemLibrary.int_add);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_sub);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mul_name, ctn, SystemLibrary.SystemLibrary.int_mul);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.idiv_name, ctn, SystemLibrary.SystemLibrary.int_idiv);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mod_name, ctn, SystemLibrary.SystemLibrary.int_mod);
				
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.and_name, ctn, SystemLibrary.SystemLibrary.int_and);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.or_name, ctn, SystemLibrary.SystemLibrary.int_or);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.xor_name, ctn, SystemLibrary.SystemLibrary.int_xor);
				
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shl_name, ctn, SystemLibrary.SystemLibrary.int_shl);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shr_name, ctn, SystemLibrary.SystemLibrary.int_shr);
			}
			else if (element_type == SystemLibrary.SystemLibrary.uint_type)
			{
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.byte_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.uitob,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.sbyte_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.uitosb,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.short_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.uitos,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.ushort_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.uitous,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.integer_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.uitoi,true);
				//SystemLibrary.SystemLibrary.make_generated_type_conversion(tctn,SystemLibrary.SystemLibrary.uint_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.stoui,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.int64_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.uitol,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.uint64_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.uitoul,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.double_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.uitod,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.float_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.uitof,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.char_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.uitochar,false);
				
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.byte_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.btoui,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.sbyte_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.sbtoui,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.short_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.stoui,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.ushort_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.ustoui,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.integer_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.itoui,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.uint_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.none,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.int64_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ltoui,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.uint64_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ultoui,true);
				//SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.real_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itod,true);
				//SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.float_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itof,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.char_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartoui,false);
				
				//SystemLibrary.SystemLibrary.make_unary_empty_operator(compiler_string_consts.plus_name, ctn, ctn);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.not_name, ctn, SystemLibrary.SystemLibrary.uint_not);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.uint_unmin);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.gr_name, ctn, SystemLibrary.SystemLibrary.uint_gr);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.greq_name, ctn, SystemLibrary.SystemLibrary.uint_greq);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.sm_name, ctn, SystemLibrary.SystemLibrary.uint_sm);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.smeq_name, ctn, SystemLibrary.SystemLibrary.uint_smeq);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.eq_name, ctn, SystemLibrary.SystemLibrary.uint_eq);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.noteq_name, ctn, SystemLibrary.SystemLibrary.uint_noteq);

				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.plus_name, ctn, SystemLibrary.SystemLibrary.uint_add);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.uint_sub);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mul_name, ctn, SystemLibrary.SystemLibrary.uint_mul);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.idiv_name, ctn, SystemLibrary.SystemLibrary.uint_idiv);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mod_name, ctn, SystemLibrary.SystemLibrary.uint_mod);
				
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.and_name, ctn, SystemLibrary.SystemLibrary.uint_and);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.or_name, ctn, SystemLibrary.SystemLibrary.uint_or);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.xor_name, ctn, SystemLibrary.SystemLibrary.uint_xor);
				
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shl_name, ctn, SystemLibrary.SystemLibrary.uint_shl);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shr_name, ctn, SystemLibrary.SystemLibrary.uint_shr);
			}
			else if (element_type == SystemLibrary.SystemLibrary.int64_type)
			{
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.byte_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ltob,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.sbyte_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ltosb,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.short_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ltos,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.ushort_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ltous,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.integer_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ltoi,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.uint_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ltoui,true);
				//SystemLibrary.SystemLibrary.make_generated_type_conversion(tctn,SystemLibrary.SystemLibrary.long_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.uitol,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.uint64_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ltoul,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.double_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.ltod,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.float_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.ltof,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.char_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ltochar,false);
				
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.byte_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.btol,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.sbyte_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.sbtol,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.short_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.stol,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.ushort_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.ustol,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.integer_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.uitol,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.uint_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.uitol,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.int64_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.none,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.uint64_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.ultol,true);
				//SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.real_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itod,true);
				//SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.float_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itof,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.char_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartol,false);
				
				//SystemLibrary.SystemLibrary.make_unary_empty_operator(compiler_string_consts.plus_name, ctn, ctn);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.not_name, ctn, SystemLibrary.SystemLibrary.long_not);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.long_unmin);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.gr_name, ctn, SystemLibrary.SystemLibrary.long_gr);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.greq_name, ctn, SystemLibrary.SystemLibrary.long_greq);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.sm_name, ctn, SystemLibrary.SystemLibrary.long_sm);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.smeq_name, ctn, SystemLibrary.SystemLibrary.long_smeq);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.eq_name, ctn, SystemLibrary.SystemLibrary.long_eq);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.noteq_name, ctn, SystemLibrary.SystemLibrary.long_noteq);

				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.plus_name, ctn, SystemLibrary.SystemLibrary.long_add);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.long_sub);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mul_name, ctn, SystemLibrary.SystemLibrary.long_mul);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.idiv_name, ctn, SystemLibrary.SystemLibrary.long_idiv);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mod_name, ctn, SystemLibrary.SystemLibrary.long_mod);
				
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.and_name, ctn, SystemLibrary.SystemLibrary.long_and);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.or_name, ctn, SystemLibrary.SystemLibrary.long_or);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.xor_name, ctn, SystemLibrary.SystemLibrary.long_xor);
				
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shl_name, ctn, SystemLibrary.SystemLibrary.long_shl);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shr_name, ctn, SystemLibrary.SystemLibrary.long_shr);
			}
			else if (element_type == SystemLibrary.SystemLibrary.uint64_type)
			{
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.byte_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ultob,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.sbyte_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ultosb,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.short_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ultos,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.ushort_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ultous,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.integer_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ultoi,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.uint_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ultoui,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.int64_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.ultol,true);
				//SystemLibrary.SystemLibrary.make_generated_type_conversion(tctn,SystemLibrary.SystemLibrary.ulong_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ltoul,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.double_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.ultod,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.float_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.ultof,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.char_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ultochar,false);
				
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.byte_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.btoul,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.sbyte_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.sbtoul,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.short_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.stoul,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.ushort_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.ustoul,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.integer_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.uitoul,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.uint_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.uitoul,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.int64_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ltoul,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.uint64_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.none,true);
				//SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.real_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itod,true);
				//SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.float_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itof,true);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.char_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartoul,false);
				
				
				//SystemLibrary.SystemLibrary.make_unary_empty_operator(compiler_string_consts.plus_name, ctn, ctn);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.not_name, ctn, SystemLibrary.SystemLibrary.ulong_not);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.ulong_unmin);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.gr_name, ctn, SystemLibrary.SystemLibrary.ulong_gr);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.greq_name, ctn, SystemLibrary.SystemLibrary.ulong_greq);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.sm_name, ctn, SystemLibrary.SystemLibrary.ulong_sm);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.smeq_name, ctn, SystemLibrary.SystemLibrary.ulong_smeq);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.eq_name, ctn, SystemLibrary.SystemLibrary.ulong_eq);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.noteq_name, ctn, SystemLibrary.SystemLibrary.ulong_noteq);

				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.plus_name, ctn, SystemLibrary.SystemLibrary.ulong_add);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.ulong_sub);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mul_name, ctn, SystemLibrary.SystemLibrary.ulong_mul);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.idiv_name, ctn, SystemLibrary.SystemLibrary.ulong_idiv);

				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.and_name, ctn, SystemLibrary.SystemLibrary.ulong_and);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.or_name, ctn, SystemLibrary.SystemLibrary.ulong_or);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.xor_name, ctn, SystemLibrary.SystemLibrary.ulong_xor);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mod_name, ctn, SystemLibrary.SystemLibrary.ulong_mod);
				
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shl_name, ctn, SystemLibrary.SystemLibrary.ulong_shl);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shr_name, ctn, SystemLibrary.SystemLibrary.ulong_shr);
			}
			else if (element_type == SystemLibrary.SystemLibrary.char_type)
			{
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.byte_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.chartob,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.sbyte_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.chartosb,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.short_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartos,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.ushort_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartous,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.integer_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartoi,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.uint_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartoui,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.int64_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartol,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.uint64_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartoul,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.double_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartod,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.float_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartof,false);
				//SystemLibrary.SystemLibrary.make_generated_type_conversion(tctn,SystemLibrary.SystemLibrary.char_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ultochar,false);
				
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.byte_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.btochar,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.sbyte_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.sbtochar,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.short_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.stochar,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.ushort_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ustochar,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.integer_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.itochar,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.uint_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.uitochar,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.int64_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ltochar,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.uint64_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ultochar,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.char_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.none,true);
				//SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.real_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.dtochar,false);
				//SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.float_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartof,false);
				
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.gr_name, ctn, SystemLibrary.SystemLibrary.char_gr);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.greq_name, ctn, SystemLibrary.SystemLibrary.char_greq);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.sm_name, ctn, SystemLibrary.SystemLibrary.char_sm);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.smeq_name, ctn, SystemLibrary.SystemLibrary.char_smeq);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.eq_name, ctn, SystemLibrary.SystemLibrary.char_eq);
				SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.noteq_name, ctn, SystemLibrary.SystemLibrary.char_noteq);
			}
			else if (element_type.IsEnum)
			{
				SystemLibrary.SystemLibrary.make_generated_type_conversion(element_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.none,true);
				
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.byte_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.itob,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.sbyte_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.itosb,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.short_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.itos,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.integer_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.none,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.ushort_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.itous,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.uint_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.itoui,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.int64_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itol,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,SystemLibrary.SystemLibrary.uint64_type,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itoul,false);
				
				
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.byte_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.btoi,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.sbyte_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.sbtoi,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.short_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.stoi,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.ushort_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.ustoi,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.integer_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.none,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.uint_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.uitoi,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.int64_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ltoi,false);
				SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.uint64_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.ultoi,false);
				//SystemLibrary.SystemLibrary.make_generated_type_conversion(ctn,element_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.none);
				//SystemLibrary.SystemLibrary.make_generated_type_conversion(element_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.none);
			}
			
			/*if (element_type != SystemLibrary.SystemLibrary.char_type && element_type != SystemLibrary.SystemLibrary.bool_type)
            {
            	//if (SystemLibrary.SystemLibrary.sbyte_type != element_type)
            	//type_table.add_type_conversion_from_defined(ctn,SystemLibrary.SystemLibrary.sbyte_type,new basic_function_node(PascalABCCompiler.SemanticTree.basic_function_type.none,ctn,true,"diaptoord"),type_compare.less_type,true);
            	if (SystemLibrary.SystemLibrary.byte_type != element_type)
				type_table.add_type_conversion_from_defined(ctn,SystemLibrary.SystemLibrary.byte_type,new basic_function_node(PascalABCCompiler.SemanticTree.basic_function_type.none,ctn,true,"diaptoord"),type_compare.less_type,true);
            	
            	if (SystemLibrary.SystemLibrary.short_type != element_type)
            	type_table.add_type_conversion_from_defined(ctn,SystemLibrary.SystemLibrary.short_type,new basic_function_node(PascalABCCompiler.SemanticTree.basic_function_type.none,ctn,true,"diaptoord"),type_compare.less_type,true);
            	if (SystemLibrary.SystemLibrary.ushort_type != element_type)
            	type_table.add_type_conversion_from_defined(ctn,SystemLibrary.SystemLibrary.ushort_type,new basic_function_node(PascalABCCompiler.SemanticTree.basic_function_type.none,ctn,true,"diaptoord"),type_compare.less_type,true);
            	if (SystemLibrary.SystemLibrary.integer_type != element_type)
            	type_table.add_type_conversion_from_defined(ctn,SystemLibrary.SystemLibrary.integer_type,new basic_function_node(PascalABCCompiler.SemanticTree.basic_function_type.none,ctn,true,"diaptoord"),type_compare.less_type,true);
            	if (SystemLibrary.SystemLibrary.uint_type != element_type)
            	type_table.add_type_conversion_from_defined(ctn,SystemLibrary.SystemLibrary.uint_type,new basic_function_node(PascalABCCompiler.SemanticTree.basic_function_type.none,ctn,true,"diaptoord"),type_compare.less_type,true);
            	if (SystemLibrary.SystemLibrary.long_type != element_type)
            	type_table.add_type_conversion_from_defined(ctn,SystemLibrary.SystemLibrary.long_type,new basic_function_node(PascalABCCompiler.SemanticTree.basic_function_type.none,ctn,true,"diaptoord"),type_compare.less_type,true);
            	if (SystemLibrary.SystemLibrary.ulong_type != element_type)
            	type_table.add_type_conversion_from_defined(ctn,SystemLibrary.SystemLibrary.ulong_type,new basic_function_node(PascalABCCompiler.SemanticTree.basic_function_type.none,ctn,true,"diaptoord"),type_compare.less_type,true);
            }
             if (element_type != SystemLibrary.SystemLibrary.char_type && element_type != SystemLibrary.SystemLibrary.bool_type)
            {
            	//type_table.add_type_conversion_from_defined(SystemLibrary.SystemLibrary.integer_type,ctn,new basic_function_node(PascalABCCompiler.SemanticTree.basic_function_type.none,ctn,true,"ordtodiap"),type_compare.less_type,true);
            	//if (SystemLibrary.SystemLibrary.byte_type != element_type)
            	//type_table.add_type_conversion_from_defined(SystemLibrary.SystemLibrary.sbyte_type,ctn,new basic_function_node(PascalABCCompiler.SemanticTree.basic_function_type.none,ctn,true,"ordtodiap"),type_compare.less_type,true);
            	type_table.add_type_conversion_from_defined(SystemLibrary.SystemLibrary.byte_type,ctn,new basic_function_node(PascalABCCompiler.SemanticTree.basic_function_type.none,ctn,true,"ordtodiap"),type_compare.less_type,true);
            	//if (SystemLibrary.SystemLibrary.sbyte_type != element_type)
            	//if (SystemLibrary.SystemLibrary.short_type != element_type)
            	type_table.add_type_conversion_from_defined(SystemLibrary.SystemLibrary.short_type,ctn,new basic_function_node(PascalABCCompiler.SemanticTree.basic_function_type.none,ctn,true,"ordtodiap"),type_compare.less_type,true);
            	//if (SystemLibrary.SystemLibrary.ushort_type != element_type)
            	type_table.add_type_conversion_from_defined(SystemLibrary.SystemLibrary.ushort_type,ctn,new basic_function_node(PascalABCCompiler.SemanticTree.basic_function_type.none,ctn,true,"ordtodiap"),type_compare.less_type,true);
            	//if (SystemLibrary.SystemLibrary.integer_type != element_type)
            	type_table.add_type_conversion_from_defined(SystemLibrary.SystemLibrary.integer_type,ctn,new basic_function_node(PascalABCCompiler.SemanticTree.basic_function_type.none,ctn,true,"ordtodiap"),type_compare.less_type,true);
            	//if (SystemLibrary.SystemLibrary.uint_type != element_type)
            	type_table.add_type_conversion_from_defined(SystemLibrary.SystemLibrary.uint_type,ctn,new basic_function_node(PascalABCCompiler.SemanticTree.basic_function_type.none,ctn,true,"ordtodiap"),type_compare.less_type,true);
            	//if (SystemLibrary.SystemLibrary.long_type != element_type)
            	type_table.add_type_conversion_from_defined(SystemLibrary.SystemLibrary.long_type,ctn,new basic_function_node(PascalABCCompiler.SemanticTree.basic_function_type.none,ctn,true,"ordtodiap"),type_compare.less_type,true);
            	//if (SystemLibrary.SystemLibrary.ulong_type != element_type)
            	type_table.add_type_conversion_from_defined(SystemLibrary.SystemLibrary.ulong_type,ctn,new basic_function_node(PascalABCCompiler.SemanticTree.basic_function_type.none,ctn,true,"ordtodiap"),type_compare.less_type,true);
            }
            else
            type_table.add_type_conversion_from_defined(element_type,ctn,new basic_function_node(PascalABCCompiler.SemanticTree.basic_function_type.none,ctn,true,"ordtodiap"),type_compare.less_type,true);
			 */
			//            common_namespace_function_node cnfn = new common_namespace_function_node("Inc$"+pascal_arrays_num++,null,this.convertion_data_and_alghoritms.syntax_tree_visitor.context.converted_namespace,null);
			//            cnfn.parameters.AddElement(new common_parameter("value",ctn,PascalABCCompiler.SemanticTree.parameter_type.var,cnfn,concrete_parameter_type.cpt_var,null,null));
			//            cnfn.is_overload = true;
			//this.convertion_data_and_alghoritms.syntax_tree_visitor.context.converted_namespace.functions.AddElement(cnfn);
			// if (SystemLibrary.SystemLibrary.system_unit.namespaces.Count > 0)
			// 	SystemLibrary.SystemLibrary.system_unit.namespaces[0].functions.AddElement(cnfn);
			// (SystemLibrary.SystemLibrary.system_unit.scope.Find(PascalABCCompiler.TreeConverter.compiler_string_consts.system_unit_name).sym_info as common_namespace_node).functions.AddElement(cnfn);
			// else
			// 	this.convertion_data_and_alghoritms.syntax_tree_visitor.context.converted_namespace.functions.AddElement(cnfn);
			//            statements_list sl = new statements_list(null);
			//            PascalABCCompiler.SemanticTree.basic_function_type bft = PascalABCCompiler.SemanticTree.basic_function_type.iinc;
			//            if (element_type == SystemLibrary.SystemLibrary.byte_type)
			//            	bft = PascalABCCompiler.SemanticTree.basic_function_type.binc;
			//            else if (element_type == SystemLibrary.SystemLibrary.sbyte_type)
			//            	bft = PascalABCCompiler.SemanticTree.basic_function_type.sbinc;
			//            else if (element_type == SystemLibrary.SystemLibrary.short_type)
			//            	bft = PascalABCCompiler.SemanticTree.basic_function_type.sinc;
			//            else if (element_type == SystemLibrary.SystemLibrary.ushort_type)
			//            	bft = PascalABCCompiler.SemanticTree.basic_function_type.usinc;
			//            else if (element_type == SystemLibrary.SystemLibrary.uint_type)
			//            	bft = PascalABCCompiler.SemanticTree.basic_function_type.uiinc;
			//            else if (element_type == SystemLibrary.SystemLibrary.long_type)
			//            	bft = PascalABCCompiler.SemanticTree.basic_function_type.linc;
			//            else if (element_type == SystemLibrary.SystemLibrary.ulong_type)
			//            	bft = PascalABCCompiler.SemanticTree.basic_function_type.ulinc;
			//            else if (element_type == SystemLibrary.SystemLibrary.char_type)
			//            	bft = PascalABCCompiler.SemanticTree.basic_function_type.cinc;
			//            else if (element_type == SystemLibrary.SystemLibrary.bool_type)
			//            	bft = PascalABCCompiler.SemanticTree.basic_function_type.boolinc;
			//            basic_function_call bfc = new basic_function_call(new basic_function_node(bft,element_type,true),null);
			//            bfc.parameters.AddElement(new common_parameter_reference(cnfn.parameters[0] as common_parameter,0,null));
			//            sl.statements.AddElement(bfc);
			//            cnfn.function_code = sl;
			//            SymbolInfo si = this.convertion_data_and_alghoritms.syntax_tree_visitor.context.converted_namespace.scope.Find("Inc");
			//            while (si.Next != null)
			//            	si = si.Next;
			//            si.Next = new SymbolInfo(cnfn);
			//            si.Next.access_level = access_level.al_internal;
			//            si.Next.symbol_kind = symbol_kind.sk_overload_procedure;
			//            //SystemLibrary.SystemLibrary.system_unit.scope.AddSymbol("Inc",new SymbolInfo(cnfn));
//
			//            cnfn = new common_namespace_function_node("Dec$"+pascal_arrays_num++,null,this.convertion_data_and_alghoritms.syntax_tree_visitor.context.converted_namespace,null);
			//            cnfn.parameters.AddElement(new common_parameter("value",ctn,PascalABCCompiler.SemanticTree.parameter_type.var,cnfn,concrete_parameter_type.cpt_var,null,null));
			//            //this.convertion_data_and_alghoritms.syntax_tree_visitor.context.converted_namespace.functions.AddElement(cnfn);
			//            if (SystemLibrary.SystemLibrary.system_unit.namespaces.Count > 0)
			//            	SystemLibrary.SystemLibrary.system_unit.namespaces[0].functions.AddElement(cnfn);
			//            else
			//            	this.convertion_data_and_alghoritms.syntax_tree_visitor.context.converted_namespace.functions.AddElement(cnfn);
			//            sl = new statements_list(null);
			//            bft = PascalABCCompiler.SemanticTree.basic_function_type.idec;
			//            if (element_type == SystemLibrary.SystemLibrary.byte_type)
			//            	bft = PascalABCCompiler.SemanticTree.basic_function_type.bdec;
			//            else if (element_type == SystemLibrary.SystemLibrary.sbyte_type)
			//            	bft = PascalABCCompiler.SemanticTree.basic_function_type.sbdec;
			//            else if (element_type == SystemLibrary.SystemLibrary.short_type)
			//            	bft = PascalABCCompiler.SemanticTree.basic_function_type.sdec;
			//            else if (element_type == SystemLibrary.SystemLibrary.ushort_type)
			//            	bft = PascalABCCompiler.SemanticTree.basic_function_type.usdec;
			//            else if (element_type == SystemLibrary.SystemLibrary.uint_type)
			//            	bft = PascalABCCompiler.SemanticTree.basic_function_type.uidec;
			//            else if (element_type == SystemLibrary.SystemLibrary.long_type)
			//            	bft = PascalABCCompiler.SemanticTree.basic_function_type.ldec;
			//            else if (element_type == SystemLibrary.SystemLibrary.ulong_type)
			//            	bft = PascalABCCompiler.SemanticTree.basic_function_type.uldec;
			//            else if (element_type == SystemLibrary.SystemLibrary.char_type)
			//            	bft = PascalABCCompiler.SemanticTree.basic_function_type.cdec;
			//            else if (element_type == SystemLibrary.SystemLibrary.bool_type)
			//            	bft = PascalABCCompiler.SemanticTree.basic_function_type.booldec;
			//            bfc = new basic_function_call(new basic_function_node(bft,element_type,true),null);
			//            bfc.parameters.AddElement(new common_parameter_reference(cnfn.parameters[0] as common_parameter,0,null));
			//            sl.statements.AddElement(bfc);
			//            cnfn.function_code = sl;
//
			//           SystemLibrary.SystemLibrary.system_unit.scope.AddSymbol("Dec",new SymbolInfo(cnfn));
			// if (element_type == SystemLibrary.SystemLibrary.integer_type)
			// element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.iassign)));
			// else if (element_type == SystemLibrary.SystemLibrary.byte_type)
			// element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.bassign)));
			/*element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.sassign)));
            	element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.sbassign)));
            	element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.usassign)));
            	element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.uiassign)));
            	element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.lassign)));
            	element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.ulassign)));*/
			// else if (element_type == SystemLibrary.SystemLibrary.char_type)
			// 	element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.charassign)));
			// else if (element_type == SystemLibrary.SystemLibrary.bool_type)
			// 	element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.boolassign)));
			
			ctn.add_internal_interface(oti_new);
			this.convertion_data_and_alghoritms.syntax_tree_visitor.context.converted_namespace.types.AddElement(ctn);
			return ctn;
		}