Esempio n. 1
0
 public void initialize(convertion_data_and_alghoritms conv)
 {
     if (is_initialized)
     {
         return;
     }
     make_types();
     make_system_unit(conv);
 }
Esempio n. 2
0
        private void init_procedures(convertion_data_and_alghoritms conv, SymbolTable.Scope susc)
        {
            pseudo_function break_procedure = new pseudo_function(compiler_string_consts.break_procedure_name,
                                                                  new pseudo_function_algorithm(conv.syntax_tree_visitor.make_break_node));

            susc.AddSymbol(compiler_string_consts.break_procedure_name, new SymbolInfo(break_procedure));

            pseudo_function continue_procedure = new pseudo_function(compiler_string_consts.continue_procedure_name,
                                                                     new pseudo_function_algorithm(conv.syntax_tree_visitor.make_continue_node));

            susc.AddSymbol(compiler_string_consts.continue_procedure_name, new SymbolInfo(continue_procedure));
        }
Esempio n. 3
0
        private void make_system_unit(convertion_data_and_alghoritms conv)
        {
            _system_unit       = new unit_node();
            _system_unit.scope = conv.symbol_table.CreateUnitInterfaceScope(new SymbolTable.Scope[0]);

            SymbolTable.Scope susc = _system_unit.scope;
            //Добавляем типы.
            susc.AddSymbol(compiler_string_consts.integer_type_name, new SymbolInfo(_integer_type));
            susc.AddSymbol(compiler_string_consts.real_type_name, new SymbolInfo(_real_type));
            susc.AddSymbol(compiler_string_consts.char_type_name, new SymbolInfo(_char_type));
            susc.AddSymbol(compiler_string_consts.bool_type_name, new SymbolInfo(_bool_type));
            susc.AddSymbol(compiler_string_consts.string_type_name, new SymbolInfo(_string_type));

            susc.AddSymbol(compiler_string_consts.pointer_type_name, new SymbolInfo(_pointer_type));
            init_constants(susc);
            init_procedures(conv, susc);
            init_temp_methods(susc);
        }
		public void initialize(convertion_data_and_alghoritms conv)
		{
			if (is_initialized)
			{
				return;
			}
			make_types();
			make_system_unit(conv);
		}
		private void make_system_unit(convertion_data_and_alghoritms conv)
		{
			_system_unit=new unit_node();
			_system_unit.scope=conv.symbol_table.CreateUnitInterfaceScope(new SymbolTable.Scope[0]);

			SymbolTable.Scope susc=_system_unit.scope;
			//Добавляем типы.
			susc.AddSymbol(compiler_string_consts.integer_type_name,new SymbolInfo(_integer_type));
			susc.AddSymbol(compiler_string_consts.real_type_name,new SymbolInfo(_real_type));
			susc.AddSymbol(compiler_string_consts.char_type_name,new SymbolInfo(_char_type));
			susc.AddSymbol(compiler_string_consts.bool_type_name,new SymbolInfo(_bool_type));
			susc.AddSymbol(compiler_string_consts.string_type_name,new SymbolInfo(_string_type));

			susc.AddSymbol(compiler_string_consts.pointer_type_name,new SymbolInfo(_pointer_type));
			init_constants(susc);
			init_procedures(conv,susc);
			init_temp_methods(susc);
		}
		private void init_procedures(convertion_data_and_alghoritms conv,SymbolTable.Scope susc)
		{
			pseudo_function break_procedure=new pseudo_function(compiler_string_consts.break_procedure_name,
				new pseudo_function_algorithm(conv.syntax_tree_visitor.make_break_node));

			susc.AddSymbol(compiler_string_consts.break_procedure_name,new SymbolInfo(break_procedure));

			pseudo_function continue_procedure=new pseudo_function(compiler_string_consts.continue_procedure_name,
				new pseudo_function_algorithm(conv.syntax_tree_visitor.make_continue_node));

			susc.AddSymbol(compiler_string_consts.continue_procedure_name,new SymbolInfo(continue_procedure));
		}