Example #1
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);
        }
		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);
		}
Example #3
0
 ///<summary>
 ///Searches the entire sorted ArrayList for an element using the specified comparer and returns the zero-based index of the element.
 ///</summary>
 ///<param name="index">The zero-based starting index of the range to search.<param>
 ///<param name="count">The length of the range to search.<param>
 ///<param name="value">The Object to locate. The value can be a null reference.<param>
 ///<param name="comparer">The IComparer implementation to use when comparing elements. -or- A null reference (Nothing in Visual Basic) to use the default comparer that is the IComparable implementation of each element.<param>
 ///<returns>The zero-based index of value in the sorted unit_nodeArrayList, if value is found; otherwise, a negative number, which is the bitwise complement of the index of the next element that is larger than value or, if there is no larger element, the bitwise complement of Count.</returns>
 public void BinarySearch(int index, int count, unit_node value, System.Collections.IComparer comparer)
 {
     arr.BinarySearch(value, comparer);
 }
Example #4
0
 ///<summary>
 ///Uses a binary search algorithm to locate a specific element in the sorted unit_nodeArrayList or a portion of it.
 ///</summary>
 ///<param name="value">The Object to locate. The value can be a null reference.<param>
 ///<returns>The zero-based index of value in the sorted unit_nodeArrayList, if value is found; otherwise, a negative number, which is the bitwise complement of the index of the next element that is larger than value or, if there is no larger element, the bitwise complement of Count.</returns>
 public int BinarySearch(unit_node value)
 {
     return(arr.BinarySearch(value));
 }
Example #5
0
 ///<summary>
 ///Searches the entire sorted ArrayList for an element using the specified comparer and returns the zero-based index of the element.
 ///</summary>
 ///<param name="value">The Object to locate. The value can be a null reference.<param>
 ///<param name="comparer">The IComparer implementation to use when comparing elements. -or- A null reference (Nothing in Visual Basic) to use the default comparer that is the IComparable implementation of each element.<param>
 ///<returns>The zero-based index of value in the sorted unit_nodeArrayList, if value is found; otherwise, a negative number, which is the bitwise complement of the index of the next element that is larger than value or, if there is no larger element, the bitwise complement of Count.</returns>
 public void BinarySearch(unit_node value, System.Collections.IComparer comparer)
 {
     arr.BinarySearch(value, comparer);
 }
Example #6
0
 ///<summary>
 ///Searches for the specified unit_node and returns the zero-based index of the last occurrence within the section of the unit_nodeArrayList that contains the specified number of elements and ends at the specified index.
 ///</summary>
 ///<param name="value">The unit_node to locate in the unit_nodeArrayList. The value can be a null reference.<param>
 ///<param name="startIndex">The zero-based starting index of the backward search.<param>
 ///<param name="count">The number of elements in the section to search.<param>
 ///<returns>The zero-based index of the last occurrence of value within the section of the unit_nodeArrayList that extends from the first element to startIndex, if found; otherwise, -1.</returns>
 public int LastIndexOf(unit_node value, int startIndex, int count)
 {
     return(arr.LastIndexOf(value, startIndex, count));
 }
Example #7
0
 ///<summary>
 ///Removes the first occurrence of a specific object from the ArrayList.
 ///</summary>
 ///<param name="value">The unit_node to remove from the ArrayList. The value can be a null reference.<param>
 ///<returns>Return value is void</returns>
 public void Remove(unit_node value)
 {
     arr.Remove(value);
 }
Example #8
0
 ///<summary>
 ///Searches for the specified unit_node and returns the zero-based index of the last occurrence within the entire unit_nodeArrayList.
 ///</summary>
 ///<param name="value">The unit_node to locate in the unit_nodeArrayList. The value can be a null reference.<param>
 ///<returns>The zero-based index of the last occurrence of value within the entire the ArrayList, if found; otherwise, -1.</returns>
 public int LastIndexOf(unit_node value)
 {
     return(arr.LastIndexOf(value));
 }
Example #9
0
 ///<summary>
 ///Adds an unit_node to the end of the unit_nodeArrayList.
 ///</summary>
 ///<param name="value">The unit_node to be added to the end of the ArrayList. The value can be a null reference.<param>
 ///<returns>The unit_nodeArrayList index at which the value has been added.</returns>
 public int Add(unit_node value)
 {
     return(arr.Add(value));
 }
Example #10
0
 ///<summary>
 ///Inserts an element into the unit_nodeArrayList at the specified index.
 ///</summary>
 ///<param name="index">The zero-based index at which value should be inserted.<param>
 ///<param name="value">The unit_node to insert. The value can be a null reference.<param>
 ///<returns>Return value is void</returns>
 public void Insert(int index, unit_node value)
 {
     arr.Insert(index, value);
 }
Example #11
0
 ///<summary>
 ///Searches for the specified unit_node and returns the zero-based index of the first occurrence within the section of the unit_nodeArrayList that extends from the specified index to the last element.
 ///</summary>
 ///<param name="value">The unit_node to locate in the unit_nodeArrayList. The value can be a null reference.<param>
 ///<param name="startIndex">The zero-based starting index of the search.<param>
 ///<returns>The zero-based index of the first occurrence of value within the section of the unit_nodeArrayList that extends from startIndex to the last element, if found; otherwise, -1.</returns>
 public int IndexOf(unit_node value, int startIndex)
 {
     return(arr.IndexOf(value, startIndex));
 }
Example #12
0
 ///<summary>
 ///Determines whether an element is in the unit_nodeArrayList.
 ///</summary>
 ///<param name="item">The unit_node to locate in the ArrayList. The value can be a null reference.<param>
 ///<returns>true if item is found in the unit_nodeArrayList; otherwise, false.</returns>
 public bool Contains(unit_node item)
 {
     return(arr.Contains(item));
 }