Beispiel #1
0
 public SymbolInfo(basic_parameter value)
 {
     //_name_information_type=name_information_type.nit_basic_parameter;
     _sym_info     = value;
     _access_level = access_level.al_public;
     _symbol_kind  = symbol_kind.sk_none;
 }
Beispiel #2
0
        //End: No v drugom smisle reference.

        public void make_empty_operator(string name, compiled_type_node ctn)
        {
            parameterArrayList  pars = new parameterArrayList();
            empty_function_node efn  = new empty_function_node(pars, ctn);

            efn.is_overload = true;
            basic_parameter par = new basic_parameter(compiler_string_consts.unary_param_name, ctn,
                                                      SemanticTree.parameter_type.value, null);

            pars.Add(par);
            ctn.add_additional_name(name, new SymbolInfo(efn));
        }
Beispiel #3
0
        private void make_unary_operator(string operator_name, compiled_type_node to,
                                         SemanticTree.basic_function_type bft, type_node ret_value_type)
        {
            parameterArrayList  pars = new parameterArrayList();
            basic_function_node bfn  = new basic_function_node(bft, pars, ret_value_type);

            bfn.is_overload = true;
            basic_parameter par = new basic_parameter(compiler_string_consts.unary_param_name, to,
                                                      SemanticTree.parameter_type.value, bfn);

            pars.Add(par);
            to.add_additional_name(operator_name, new SymbolInfo(bfn));
        }
Beispiel #4
0
        private void make_type_conversion(compiled_type_node from, compiled_type_node to, type_compare tc,
                                          SemanticTree.basic_function_type bft)
        {
            parameterArrayList  pars        = new parameterArrayList();
            basic_function_node conv_method = new basic_function_node(bft, pars, to);
            basic_parameter     bp          = new basic_parameter(compiler_string_consts.unary_param_name,
                                                                  from, SemanticTree.parameter_type.value, conv_method);

            pars.Add(bp);

            type_intersection_node inter_node = new type_intersection_node(tc);

            inter_node.this_to_another = new type_conversion_factory(conv_method);
            from.add_intersection_node(to, inter_node);
        }
Beispiel #5
0
        private void make_object_operator(common_type_node ctn, SemanticTree.basic_function_type bas_ft,
                                          string name, type_node ret_type, SemanticTree.parameter_type first_parameter_type)
        {
            parameterArrayList  pars = new parameterArrayList();
            basic_function_node bfn  = new basic_function_node(bas_ft, pars, ret_type);

            bfn.is_overload = true;
            basic_parameter to = new basic_parameter(compiler_string_consts.left_param_name, ctn,
                                                     first_parameter_type, bfn);
            basic_parameter from = new basic_parameter(compiler_string_consts.right_param_name, ctn,
                                                       SemanticTree.parameter_type.value, bfn);

            pars.Add(to);
            pars.Add(from);
            ctn.Scope.AddSymbol(name, new SymbolInfo(bfn));
        }
Beispiel #6
0
        private void make_compiled_object_operator(string name, compiled_type_node tp, SemanticTree.basic_function_type bft,
                                                   SemanticTree.parameter_type first_param_type)
        {
            parameterArrayList  pars = new parameterArrayList();
            basic_function_node bfn  = new basic_function_node(bft, pars, tp);

            bfn.is_overload = true;
            basic_parameter to = new basic_parameter(compiler_string_consts.left_param_name, tp,
                                                     first_param_type, bfn);
            basic_parameter from = new basic_parameter(compiler_string_consts.right_param_name, tp,
                                                       SemanticTree.parameter_type.value, bfn);

            pars.Add(to);
            pars.Add(from);
            tp.add_additional_name(name, new SymbolInfo(bfn));
        }
Beispiel #7
0
        private basic_function_node make_common_binary_operation(string operator_name, compiled_type_node def_type, compiled_type_node left,
                                                                 compiled_type_node right, SemanticTree.basic_function_type bft, type_node ret_value_type)
        {
            parameterArrayList  pars = new parameterArrayList();
            basic_function_node bfn  = new basic_function_node(bft, pars, ret_value_type);

            bfn.is_overload = true;
            basic_parameter par_left = new basic_parameter(compiler_string_consts.left_param_name, left,
                                                           SemanticTree.parameter_type.value, bfn);
            basic_parameter par_right = new basic_parameter(compiler_string_consts.right_param_name, right,
                                                            SemanticTree.parameter_type.value, bfn);

            pars.Add(par_left);
            pars.Add(par_right);
            def_type.add_additional_name(operator_name, new SymbolInfo(bfn));
            return(bfn);
        }
		private void make_object_operator(common_type_node ctn,SemanticTree.basic_function_type bas_ft,
			string name,type_node ret_type,SemanticTree.parameter_type first_parameter_type)
		{
			parameterArrayList pars=new parameterArrayList();
			basic_function_node bfn=new basic_function_node(bas_ft,pars,ret_type);
			bfn.is_overload=true;
			basic_parameter to=new basic_parameter(compiler_string_consts.left_param_name,ctn,
				first_parameter_type,bfn);
			basic_parameter from=new basic_parameter(compiler_string_consts.right_param_name,ctn,
				SemanticTree.parameter_type.value,bfn);
			pars.Add(to);
			pars.Add(from);
			ctn.Scope.AddSymbol(name,new SymbolInfo(bfn));
		}
		//End: No v drugom smisle reference.

		public void make_empty_operator(string name,compiled_type_node ctn)
		{
			parameterArrayList pars=new parameterArrayList();
			empty_function_node efn=new empty_function_node(pars,ctn);
			efn.is_overload=true;
			basic_parameter par=new basic_parameter(compiler_string_consts.unary_param_name,ctn,
				SemanticTree.parameter_type.value,null);
			pars.Add(par);
			ctn.add_additional_name(name,new SymbolInfo(efn));
		}
		private void make_compiled_object_operator(string name,compiled_type_node tp,SemanticTree.basic_function_type bft,
			SemanticTree.parameter_type first_param_type)
		{
			parameterArrayList pars=new parameterArrayList();
			basic_function_node bfn=new basic_function_node(bft,pars,tp);
			bfn.is_overload=true;
			basic_parameter to=new basic_parameter(compiler_string_consts.left_param_name,tp,
				first_param_type,bfn);
			basic_parameter from=new basic_parameter(compiler_string_consts.right_param_name,tp,
				SemanticTree.parameter_type.value,bfn);
			pars.Add(to);
			pars.Add(from);
			tp.add_additional_name(name,new SymbolInfo(bfn));
		}
		private void make_type_conversion(compiled_type_node from,compiled_type_node to,type_compare tc,
			SemanticTree.basic_function_type bft)
		{
			parameterArrayList pars=new parameterArrayList();
			basic_function_node conv_method=new basic_function_node(bft,pars,to);
			basic_parameter bp=new basic_parameter(compiler_string_consts.unary_param_name,
				from,SemanticTree.parameter_type.value,conv_method);
			pars.Add(bp);

			type_intersection_node inter_node=new type_intersection_node(tc);
			inter_node.this_to_another=new type_conversion_factory(conv_method);
			from.add_intersection_node(to,inter_node);
		}
		private void make_unary_operator(string operator_name,compiled_type_node to,
			SemanticTree.basic_function_type bft,type_node ret_value_type)
		{
			parameterArrayList pars=new parameterArrayList();
			basic_function_node bfn=new basic_function_node(bft,pars,ret_value_type);
			bfn.is_overload=true;
			basic_parameter par=new basic_parameter(compiler_string_consts.unary_param_name,to,
				SemanticTree.parameter_type.value,bfn);
			pars.Add(par);
			to.add_additional_name(operator_name,new SymbolInfo(bfn));
		}
		private basic_function_node make_common_binary_operation(string operator_name,compiled_type_node def_type,compiled_type_node left,
			compiled_type_node right,SemanticTree.basic_function_type bft,type_node ret_value_type)
		{
			parameterArrayList pars=new parameterArrayList();
			basic_function_node bfn=new basic_function_node(bft,pars,ret_value_type);
			bfn.is_overload=true;
			basic_parameter par_left=new basic_parameter(compiler_string_consts.left_param_name,left,
				SemanticTree.parameter_type.value,bfn);
			basic_parameter par_right=new basic_parameter(compiler_string_consts.right_param_name,right,
				SemanticTree.parameter_type.value,bfn);
			pars.Add(par_left);
			pars.Add(par_right);
			def_type.add_additional_name(operator_name,new SymbolInfo(bfn));
			return bfn;
		}