// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using PascalABCCompiler.Collections;
namespace PascalABCCompiler.TreeRealization
{
///
/// Класс, представляющий список выражений. Используется для представления фактических параметров функции.
///
[Serializable]
public class expressions_list : extended_collection
{
public override string ToString() => string.Join(", ", this._elements);
public expressions_list Clone()
{
var exprl = new expressions_list();
foreach (var elem in this)
exprl.AddElement(elem);
return exprl;
}
}
[Serializable]
public class attributes_list : extended_collection
{
}
///
/// Список типов, определенных в программе.
///
[Serializable]
public class common_type_node_list : extended_collection
{
}
//ssyy добавил
///
/// Список шаблонных классов, определенных в программе.
///
[Serializable]
public class template_class_list : extended_collection
{
}
//\ssyy
///
/// Список runtime типов, определенных в программе.
///
[Serializable]
public class compiled_type_node_list : extended_collection
{
}
///
/// Список переменных, определенных в пространстве имен.
///
[Serializable]
public class namespace_variable_list : extendable_collection
{
}
[Serializable]
public class namespace_event_list : extendable_collection
{
}
///
/// Список функций, определенных в пространстве имен.
///
[Serializable]
public class common_namespace_function_node_list : extended_collection
{
}
///
/// Список вложенных пространств имен.
///
[Serializable]
public class common_namespace_node_list : extendable_collection
{
}
///
/// Список вложенных в пространство имен констант.
///
[Serializable]
public class namespace_constant_definition_list : extendable_collection
{
}
///
/// Список вложенных в класс.
///
[Serializable]
public class class_constant_definition_list : extendable_collection
{
}
///
/// Список констант, вложенных в класс.
///
[Serializable]
public class function_constant_definition_list : extendable_collection
{
}
///
/// Список модулей.
///
[Serializable]
public class unit_node_list : extended_collection
{
public Dictionary unit_uses_paths = new Dictionary();
public new void AddElement(unit_node unit)
{
throw new InvalidOperationException("Use second overload of \"unit_node_list.AddElement\"");
}
///
/// Adds element to the "uses" list
///
/// Element to add. Can be unit, namespace, .dll reference, etc.
/// Path to unit. Can be relative string, null for non-pascal_unit's
/// Returns true if new pascal unit (not .dll, namespace, etc.) was added
public bool AddElement(unit_node unit, string unit_uses_path)
{
if (unit_uses_paths.ContainsKey(unit)) return false;
base.AddElement(unit);
if (unit_uses_path != null) unit_uses_paths.Add(unit, unit_uses_path);
return true;
}
}
///
/// Список параметров.
///
[Serializable]
public class parameter_list : extended_collection
{
}
///
/// Список выражений.
///
[Serializable]
public class statement_node_list : extendable_collection
{
public new statement_node this[int num]
{
get
{
return _elements[num];
}
set
{
_elements[num] = value;
}
}
}
///
/// Список методов.
///
[Serializable]
public class common_method_node_list : extended_collection
{
}
///
/// Список полей класса.
///
[Serializable]
public class class_field_list : extendable_collection
{
}
///
/// Список свойств класса.
///
[Serializable]
public class common_property_node_list : extendable_collection
{
}
[Serializable]
public class common_event_list : extendable_collection
{
}
///
/// Список локальных переменных.
///
[Serializable]
public class local_variable_list : extendable_collection
{
}
///
/// Список функций, определенных в функции.
///
[Serializable]
public class common_in_function_function_node_list : extended_collection
{
}
[Serializable]
public class statement_node_stack : Stack
{
}
[Serializable]
public class statement_list_stack: Stack
{
}
[Serializable]
public class common_function_node_stack: Stack
{
}
[Serializable]
public class possible_type_convertions_list : extended_collection
{
private statement_node_list _snl;
private expression_node _var_ref;
public statement_node_list snl
{
get
{
return _snl;
}
set
{
_snl = value;
}
}
public expression_node var_ref
{
get
{
return _var_ref;
}
set
{
_var_ref = value;
}
}
}
[Serializable]
public class possible_type_convertions_list_list : extended_collection
{
}
[Serializable]
public class function_node_list : extended_collection
{
}
[Serializable]
public class using_namespace_list : extended_collection
{
}
[Serializable]
public class type_node_list : extended_collection
{
}
[Serializable]
public class common_unit_node_list : extended_collection
{
}
[Serializable]
public class constant_node_list : extendable_collection
{
}
[Serializable]
public class case_range_node_list : extendable_collection
{
}
[Serializable]
public class case_variant_node_list : extendable_collection
{
}
[Serializable]
public class int_const_node_list : extendable_collection
{
}
[Serializable]
public class base_function_call_list : extended_collection
{
}
[Serializable]
public class exception_filters_list : extended_collection
{
}
}