using System;
using System.Collections;
using System.Collections.Generic;
namespace PascalABCCompiler.SyntaxTree
{
///
///Базовый класс для всех классов синтаксического дерева
///
[Serializable]
public partial class syntax_tree_node
{
///
///Конструктор без параметров.
///
public syntax_tree_node()
{
}
///
///Конструктор с параметрами.
///
public syntax_tree_node(SourceContext _source_context)
{
this._source_context=_source_context;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public syntax_tree_node(SourceContext _source_context,SourceContext sc)
{
this._source_context=_source_context;
source_context = sc;
FillParentsInDirectChilds();
}
protected SourceContext _source_context;
///
///Позиция в тексте (строка-столбец начала - строка-столбец конца)
///
public SourceContext source_context
{
get
{
return _source_context;
}
set
{
_source_context=value;
}
}
/// Создает копию узла
public virtual syntax_tree_node Clone()
{
syntax_tree_node copy = new syntax_tree_node();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
return copy;
}
/// Получает копию данного узла корректного типа
public virtual syntax_tree_node TypedClone()
{
return Clone() as syntax_tree_node;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public virtual void FillParentsInDirectChilds()
{
}
/// Заполняет поля Parent во всем поддереве
public virtual void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public virtual Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public virtual Int32 subnodes_count
{
get
{
return 0;
}
}
///
///Индексатор для получения всех подузлов
///
public virtual syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public virtual void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Выражение
///
[Serializable]
public partial class expression : declaration
{
///
///Конструктор без параметров.
///
public expression()
{
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
expression copy = new expression();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new expression TypedClone()
{
return Clone() as expression;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Оператор
///
[Serializable]
public partial class statement : declaration
{
///
///Конструктор без параметров.
///
public statement()
{
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
statement copy = new statement();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new statement TypedClone()
{
return Clone() as statement;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Блок операторов
///
[Serializable]
public partial class statement_list : statement
{
///
///Конструктор без параметров.
///
public statement_list()
{
}
///
///Конструктор с параметрами.
///
public statement_list(List _subnodes,token_info _left_logical_bracket,token_info _right_logical_bracket,bool _expr_lambda_body)
{
this._subnodes=_subnodes;
this._left_logical_bracket=_left_logical_bracket;
this._right_logical_bracket=_right_logical_bracket;
this._expr_lambda_body=_expr_lambda_body;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public statement_list(List _subnodes,token_info _left_logical_bracket,token_info _right_logical_bracket,bool _expr_lambda_body,SourceContext sc)
{
this._subnodes=_subnodes;
this._left_logical_bracket=_left_logical_bracket;
this._right_logical_bracket=_right_logical_bracket;
this._expr_lambda_body=_expr_lambda_body;
source_context = sc;
FillParentsInDirectChilds();
}
public statement_list(statement elem, SourceContext sc = null)
{
Add(elem, sc);
FillParentsInDirectChilds();
}
protected List _subnodes=new List();
protected token_info _left_logical_bracket;
protected token_info _right_logical_bracket;
protected bool _expr_lambda_body=new bool();
///
///Список операторов
///
public List subnodes
{
get
{
return _subnodes;
}
set
{
_subnodes=value;
}
}
///
///Левая операторная скобка
///
public token_info left_logical_bracket
{
get
{
return _left_logical_bracket;
}
set
{
_left_logical_bracket=value;
}
}
///
///Правая операторная скобка
///
public token_info right_logical_bracket
{
get
{
return _right_logical_bracket;
}
set
{
_right_logical_bracket=value;
}
}
///
///Поле, показывающее, что это - тело лямбда-выражения из одного выражения (созданное вызовом NewLambdaBody)
///
public bool expr_lambda_body
{
get
{
return _expr_lambda_body;
}
set
{
_expr_lambda_body=value;
}
}
public statement_list Add(statement elem, SourceContext sc = null)
{
subnodes.Add(elem);
if (elem != null)
elem.Parent = this;
if (sc != null)
source_context = sc;
return this;
}
public void AddFirst(statement el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
subnodes.Insert(0, el);
FillParentsInDirectChilds();
}
public void AddFirst(IEnumerable els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
subnodes.InsertRange(0, els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
public void AddMany(params statement[] els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
subnodes.AddRange(els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
private int FindIndexInList(statement el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
var ind = subnodes.FindIndex(x => x == el);
if (ind == -1)
throw new Exception(string.Format("У списка {0} не найден элемент {1} среди дочерних\n", this, el));
return ind;
}
public void InsertAfter(statement el, statement newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
subnodes.Insert(FindIndexInList(el) + 1, newel);
newel.Parent = this;
}
public void InsertAfter(statement el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
subnodes.InsertRange(FindIndexInList(el) + 1, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public void InsertBefore(statement el, statement newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
subnodes.Insert(FindIndexInList(el), newel);
newel.Parent = this;
}
public void InsertBefore(statement el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
subnodes.InsertRange(FindIndexInList(el), newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public bool Remove(statement el)
{
return subnodes.Remove(el);
}
public void ReplaceInList(statement el, statement newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
subnodes[FindIndexInList(el)] = newel;
newel.Parent = this;
}
public void ReplaceInList(statement el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
var ind = FindIndexInList(el);
subnodes.RemoveAt(ind);
subnodes.InsertRange(ind, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public int RemoveAll(Predicate match)
{
return subnodes.RemoveAll(match);
}
public statement Last()
{
if (subnodes.Count > 0)
return subnodes[subnodes.Count - 1];
throw new InvalidOperationException("Список пуст");
}
public int Count
{
get { return subnodes.Count; }
}
public void Insert(int pos, statement el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
subnodes.Insert(pos,el);
if (el != null)
el.Parent = this;
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
statement_list copy = new statement_list();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (subnodes != null)
{
foreach (statement elem in subnodes)
{
if (elem != null)
{
copy.Add((statement)elem.Clone());
copy.Last().Parent = copy;
}
else
copy.Add(null);
}
}
if (left_logical_bracket != null)
{
copy.left_logical_bracket = (token_info)left_logical_bracket.Clone();
copy.left_logical_bracket.Parent = copy;
}
if (right_logical_bracket != null)
{
copy.right_logical_bracket = (token_info)right_logical_bracket.Clone();
copy.right_logical_bracket.Parent = copy;
}
copy.expr_lambda_body = expr_lambda_body;
return copy;
}
/// Получает копию данного узла корректного типа
public new statement_list TypedClone()
{
return Clone() as statement_list;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (subnodes != null)
{
foreach (var child in subnodes)
if (child != null)
child.Parent = this;
}
if (left_logical_bracket != null)
left_logical_bracket.Parent = this;
if (right_logical_bracket != null)
right_logical_bracket.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
if (subnodes != null)
{
foreach (var child in subnodes)
child?.FillParentsInAllChilds();
}
left_logical_bracket?.FillParentsInAllChilds();
right_logical_bracket?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2 + (subnodes == null ? 0 : subnodes.Count);
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return left_logical_bracket;
case 1:
return right_logical_bracket;
}
Int32 index_counter=ind - 2;
if(subnodes != null)
{
if(index_counter < subnodes.Count)
{
return subnodes[index_counter];
}
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
left_logical_bracket = (token_info)value;
break;
case 1:
right_logical_bracket = (token_info)value;
break;
}
Int32 index_counter=ind - 2;
if(subnodes != null)
{
if(index_counter < subnodes.Count)
{
subnodes[index_counter]= (statement)value;
return;
}
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Идентификатор
///
[Serializable]
public partial class ident : addressed_value_funcname
{
///
///Конструктор без параметров.
///
public ident()
{
}
///
///Конструктор с параметрами.
///
public ident(string _name)
{
this._name=_name;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public ident(string _name,SourceContext sc)
{
this._name=_name;
source_context = sc;
FillParentsInDirectChilds();
}
protected string _name;
///
///Строка, представляющая идентификатор
///
public string name
{
get
{
return _name;
}
set
{
_name=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
ident copy = new ident();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
copy.name = name;
return copy;
}
/// Получает копию данного узла корректного типа
public new ident TypedClone()
{
return Clone() as ident;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Оператор присваивания
///
[Serializable]
public partial class assign : statement
{
///
///Конструктор без параметров.
///
public assign()
{
}
///
///Конструктор с параметрами.
///
public assign(addressed_value _to,expression _from,Operators _operator_type)
{
this._to=_to;
this._from=_from;
this._operator_type=_operator_type;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public assign(addressed_value _to,expression _from,Operators _operator_type,SourceContext sc)
{
this._to=_to;
this._from=_from;
this._operator_type=_operator_type;
source_context = sc;
FillParentsInDirectChilds();
}
protected addressed_value _to;
protected expression _from;
protected Operators _operator_type;
///
///Левый операнд оператора присваивания (чему присваивать).
///
public addressed_value to
{
get
{
return _to;
}
set
{
_to=value;
}
}
///
///Выражение в правой части
///
public expression from
{
get
{
return _from;
}
set
{
_from=value;
}
}
///
///Тип оператора присваивания
///
public Operators operator_type
{
get
{
return _operator_type;
}
set
{
_operator_type=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
assign copy = new assign();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (to != null)
{
copy.to = (addressed_value)to.Clone();
copy.to.Parent = copy;
}
if (from != null)
{
copy.from = (expression)from.Clone();
copy.from.Parent = copy;
}
copy.operator_type = operator_type;
return copy;
}
/// Получает копию данного узла корректного типа
public new assign TypedClone()
{
return Clone() as assign;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (to != null)
to.Parent = this;
if (from != null)
from.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
to?.FillParentsInAllChilds();
from?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return to;
case 1:
return from;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
to = (addressed_value)value;
break;
case 1:
from = (expression)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Бинарное выражение
///
[Serializable]
public partial class bin_expr : addressed_value
{
///
///Конструктор без параметров.
///
public bin_expr()
{
}
///
///Конструктор с параметрами.
///
public bin_expr(expression _left,expression _right,Operators _operation_type)
{
this._left=_left;
this._right=_right;
this._operation_type=_operation_type;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public bin_expr(expression _left,expression _right,Operators _operation_type,SourceContext sc)
{
this._left=_left;
this._right=_right;
this._operation_type=_operation_type;
source_context = sc;
FillParentsInDirectChilds();
}
protected expression _left;
protected expression _right;
protected Operators _operation_type;
///
///
///
public expression left
{
get
{
return _left;
}
set
{
_left=value;
}
}
///
///
///
public expression right
{
get
{
return _right;
}
set
{
_right=value;
}
}
///
///
///
public Operators operation_type
{
get
{
return _operation_type;
}
set
{
_operation_type=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
bin_expr copy = new bin_expr();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (left != null)
{
copy.left = (expression)left.Clone();
copy.left.Parent = copy;
}
if (right != null)
{
copy.right = (expression)right.Clone();
copy.right.Parent = copy;
}
copy.operation_type = operation_type;
return copy;
}
/// Получает копию данного узла корректного типа
public new bin_expr TypedClone()
{
return Clone() as bin_expr;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (left != null)
left.Parent = this;
if (right != null)
right.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
left?.FillParentsInAllChilds();
right?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return left;
case 1:
return right;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
left = (expression)value;
break;
case 1:
right = (expression)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Унарное выражение
///
[Serializable]
public partial class un_expr : addressed_value
{
///
///Конструктор без параметров.
///
public un_expr()
{
}
///
///Конструктор с параметрами.
///
public un_expr(expression _subnode,Operators _operation_type)
{
this._subnode=_subnode;
this._operation_type=_operation_type;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public un_expr(expression _subnode,Operators _operation_type,SourceContext sc)
{
this._subnode=_subnode;
this._operation_type=_operation_type;
source_context = sc;
FillParentsInDirectChilds();
}
protected expression _subnode;
protected Operators _operation_type;
///
///
///
public expression subnode
{
get
{
return _subnode;
}
set
{
_subnode=value;
}
}
///
///
///
public Operators operation_type
{
get
{
return _operation_type;
}
set
{
_operation_type=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
un_expr copy = new un_expr();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (subnode != null)
{
copy.subnode = (expression)subnode.Clone();
copy.subnode.Parent = copy;
}
copy.operation_type = operation_type;
return copy;
}
/// Получает копию данного узла корректного типа
public new un_expr TypedClone()
{
return Clone() as un_expr;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (subnode != null)
subnode.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
subnode?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 1;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 1;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return subnode;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
subnode = (expression)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Константа
///
[Serializable]
public partial class const_node : addressed_value
{
///
///Конструктор без параметров.
///
public const_node()
{
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
const_node copy = new const_node();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new const_node TypedClone()
{
return Clone() as const_node;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Логическая константа
///
[Serializable]
public partial class bool_const : const_node
{
///
///Конструктор без параметров.
///
public bool_const()
{
}
///
///Конструктор с параметрами.
///
public bool_const(bool _val)
{
this._val=_val;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public bool_const(bool _val,SourceContext sc)
{
this._val=_val;
source_context = sc;
FillParentsInDirectChilds();
}
protected bool _val;
///
///Значение логической константы
///
public bool val
{
get
{
return _val;
}
set
{
_val=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
bool_const copy = new bool_const();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
copy.val = val;
return copy;
}
/// Получает копию данного узла корректного типа
public new bool_const TypedClone()
{
return Clone() as bool_const;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Целая константа
///
[Serializable]
public partial class int32_const : const_node
{
///
///Конструктор без параметров.
///
public int32_const()
{
}
///
///Конструктор с параметрами.
///
public int32_const(Int32 _val)
{
this._val=_val;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public int32_const(Int32 _val,SourceContext sc)
{
this._val=_val;
source_context = sc;
FillParentsInDirectChilds();
}
protected Int32 _val;
///
///Значение
///
public Int32 val
{
get
{
return _val;
}
set
{
_val=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
int32_const copy = new int32_const();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
copy.val = val;
return copy;
}
/// Получает копию данного узла корректного типа
public new int32_const TypedClone()
{
return Clone() as int32_const;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Вещественная константа
///
[Serializable]
public partial class double_const : const_node
{
///
///Конструктор без параметров.
///
public double_const()
{
}
///
///Конструктор с параметрами.
///
public double_const(double _val)
{
this._val=_val;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public double_const(double _val,SourceContext sc)
{
this._val=_val;
source_context = sc;
FillParentsInDirectChilds();
}
protected double _val;
///
///Значение вещественной константы
///
public double val
{
get
{
return _val;
}
set
{
_val=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
double_const copy = new double_const();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
copy.val = val;
return copy;
}
/// Получает копию данного узла корректного типа
public new double_const TypedClone()
{
return Clone() as double_const;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Тело подпрограммы
///
[Serializable]
public partial class subprogram_body : syntax_tree_node
{
///
///Конструктор без параметров.
///
public subprogram_body()
{
}
///
///Конструктор с параметрами.
///
public subprogram_body(statement_list _subprogram_code,declarations _subprogram_defs)
{
this._subprogram_code=_subprogram_code;
this._subprogram_defs=_subprogram_defs;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public subprogram_body(statement_list _subprogram_code,declarations _subprogram_defs,SourceContext sc)
{
this._subprogram_code=_subprogram_code;
this._subprogram_defs=_subprogram_defs;
source_context = sc;
FillParentsInDirectChilds();
}
protected statement_list _subprogram_code;
protected declarations _subprogram_defs;
///
///Блок операторов подпрограммы
///
public statement_list subprogram_code
{
get
{
return _subprogram_code;
}
set
{
_subprogram_code=value;
}
}
///
///Описания подпрограммы
///
public declarations subprogram_defs
{
get
{
return _subprogram_defs;
}
set
{
_subprogram_defs=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
subprogram_body copy = new subprogram_body();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (subprogram_code != null)
{
copy.subprogram_code = (statement_list)subprogram_code.Clone();
copy.subprogram_code.Parent = copy;
}
if (subprogram_defs != null)
{
copy.subprogram_defs = (declarations)subprogram_defs.Clone();
copy.subprogram_defs.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new subprogram_body TypedClone()
{
return Clone() as subprogram_body;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (subprogram_code != null)
subprogram_code.Parent = this;
if (subprogram_defs != null)
subprogram_defs.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
subprogram_code?.FillParentsInAllChilds();
subprogram_defs?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return subprogram_code;
case 1:
return subprogram_defs;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
subprogram_code = (statement_list)value;
break;
case 1:
subprogram_defs = (declarations)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Значение, имеющее адрес
///
[Serializable]
public partial class addressed_value : expression
{
///
///Конструктор без параметров.
///
public addressed_value()
{
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
addressed_value copy = new addressed_value();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new addressed_value TypedClone()
{
return Clone() as addressed_value;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Определение типа
///
[Serializable]
public partial class type_definition : declaration
{
///
///Конструктор без параметров.
///
public type_definition()
{
}
///
///Конструктор с параметрами.
///
public type_definition(type_definition_attr_list _attr_list)
{
this._attr_list=_attr_list;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public type_definition(type_definition_attr_list _attr_list,SourceContext sc)
{
this._attr_list=_attr_list;
source_context = sc;
FillParentsInDirectChilds();
}
protected type_definition_attr_list _attr_list;
///
///
///
public type_definition_attr_list attr_list
{
get
{
return _attr_list;
}
set
{
_attr_list=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
type_definition copy = new type_definition();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (attr_list != null)
{
copy.attr_list = (type_definition_attr_list)attr_list.Clone();
copy.attr_list.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new type_definition TypedClone()
{
return Clone() as type_definition;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (attr_list != null)
attr_list.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
attr_list?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 1;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 1;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return attr_list;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
attr_list = (type_definition_attr_list)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class roof_dereference : dereference
{
///
///Конструктор без параметров.
///
public roof_dereference()
{
}
///
///Конструктор с параметрами.
///
public roof_dereference(addressed_value _dereferencing_value)
{
this._dereferencing_value=_dereferencing_value;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public roof_dereference(addressed_value _dereferencing_value,SourceContext sc)
{
this._dereferencing_value=_dereferencing_value;
source_context = sc;
FillParentsInDirectChilds();
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
roof_dereference copy = new roof_dereference();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (dereferencing_value != null)
{
copy.dereferencing_value = (addressed_value)dereferencing_value.Clone();
copy.dereferencing_value.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new roof_dereference TypedClone()
{
return Clone() as roof_dereference;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (dereferencing_value != null)
dereferencing_value.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
dereferencing_value?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 1;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 1;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return dereferencing_value;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
dereferencing_value = (addressed_value)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Именованное определение типа
///
[Serializable]
public partial class named_type_reference : type_definition
{
///
///Конструктор без параметров.
///
public named_type_reference()
{
}
///
///Конструктор с параметрами.
///
public named_type_reference(List _names)
{
this._names=_names;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public named_type_reference(List _names,SourceContext sc)
{
this._names=_names;
source_context = sc;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public named_type_reference(type_definition_attr_list _attr_list,List _names)
{
this._attr_list=_attr_list;
this._names=_names;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public named_type_reference(type_definition_attr_list _attr_list,List _names,SourceContext sc)
{
this._attr_list=_attr_list;
this._names=_names;
source_context = sc;
FillParentsInDirectChilds();
}
public named_type_reference(ident elem, SourceContext sc = null)
{
Add(elem, sc);
FillParentsInDirectChilds();
}
protected List _names=new List();
///
///Список имен типа
///
public List names
{
get
{
return _names;
}
set
{
_names=value;
}
}
public named_type_reference Add(ident elem, SourceContext sc = null)
{
names.Add(elem);
if (elem != null)
elem.Parent = this;
if (sc != null)
source_context = sc;
return this;
}
public void AddFirst(ident el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
names.Insert(0, el);
FillParentsInDirectChilds();
}
public void AddFirst(IEnumerable els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
names.InsertRange(0, els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
public void AddMany(params ident[] els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
names.AddRange(els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
private int FindIndexInList(ident el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
var ind = names.FindIndex(x => x == el);
if (ind == -1)
throw new Exception(string.Format("У списка {0} не найден элемент {1} среди дочерних\n", this, el));
return ind;
}
public void InsertAfter(ident el, ident newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
names.Insert(FindIndexInList(el) + 1, newel);
newel.Parent = this;
}
public void InsertAfter(ident el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
names.InsertRange(FindIndexInList(el) + 1, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public void InsertBefore(ident el, ident newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
names.Insert(FindIndexInList(el), newel);
newel.Parent = this;
}
public void InsertBefore(ident el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
names.InsertRange(FindIndexInList(el), newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public bool Remove(ident el)
{
return names.Remove(el);
}
public void ReplaceInList(ident el, ident newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
names[FindIndexInList(el)] = newel;
newel.Parent = this;
}
public void ReplaceInList(ident el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
var ind = FindIndexInList(el);
names.RemoveAt(ind);
names.InsertRange(ind, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public int RemoveAll(Predicate match)
{
return names.RemoveAll(match);
}
public ident Last()
{
if (names.Count > 0)
return names[names.Count - 1];
throw new InvalidOperationException("Список пуст");
}
public int Count
{
get { return names.Count; }
}
public void Insert(int pos, ident el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
names.Insert(pos,el);
if (el != null)
el.Parent = this;
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
named_type_reference copy = new named_type_reference();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (attr_list != null)
{
copy.attr_list = (type_definition_attr_list)attr_list.Clone();
copy.attr_list.Parent = copy;
}
if (names != null)
{
foreach (ident elem in names)
{
if (elem != null)
{
copy.Add((ident)elem.Clone());
copy.Last().Parent = copy;
}
else
copy.Add(null);
}
}
return copy;
}
/// Получает копию данного узла корректного типа
public new named_type_reference TypedClone()
{
return Clone() as named_type_reference;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (attr_list != null)
attr_list.Parent = this;
if (names != null)
{
foreach (var child in names)
if (child != null)
child.Parent = this;
}
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
attr_list?.FillParentsInAllChilds();
if (names != null)
{
foreach (var child in names)
child?.FillParentsInAllChilds();
}
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 1;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 1 + (names == null ? 0 : names.Count);
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return attr_list;
}
Int32 index_counter=ind - 1;
if(names != null)
{
if(index_counter < names.Count)
{
return names[index_counter];
}
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
attr_list = (type_definition_attr_list)value;
break;
}
Int32 index_counter=ind - 1;
if(names != null)
{
if(index_counter < names.Count)
{
names[index_counter]= (ident)value;
return;
}
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Секция описания переменных (до beginа). Состоит из var_def_statement. Не путать с var_statement - однострочным описанием переменной внутри begin-end
///
[Serializable]
public partial class variable_definitions : declaration
{
///
///Конструктор без параметров.
///
public variable_definitions()
{
}
///
///Конструктор с параметрами.
///
public variable_definitions(List _var_definitions)
{
this._var_definitions=_var_definitions;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public variable_definitions(List _var_definitions,SourceContext sc)
{
this._var_definitions=_var_definitions;
source_context = sc;
FillParentsInDirectChilds();
}
public variable_definitions(var_def_statement elem, SourceContext sc = null)
{
Add(elem, sc);
FillParentsInDirectChilds();
}
protected List _var_definitions=new List();
///
///Список описаний переменных
///
public List var_definitions
{
get
{
return _var_definitions;
}
set
{
_var_definitions=value;
}
}
public variable_definitions Add(var_def_statement elem, SourceContext sc = null)
{
var_definitions.Add(elem);
if (elem != null)
elem.Parent = this;
if (sc != null)
source_context = sc;
return this;
}
public void AddFirst(var_def_statement el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
var_definitions.Insert(0, el);
FillParentsInDirectChilds();
}
public void AddFirst(IEnumerable els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
var_definitions.InsertRange(0, els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
public void AddMany(params var_def_statement[] els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
var_definitions.AddRange(els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
private int FindIndexInList(var_def_statement el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
var ind = var_definitions.FindIndex(x => x == el);
if (ind == -1)
throw new Exception(string.Format("У списка {0} не найден элемент {1} среди дочерних\n", this, el));
return ind;
}
public void InsertAfter(var_def_statement el, var_def_statement newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
var_definitions.Insert(FindIndexInList(el) + 1, newel);
newel.Parent = this;
}
public void InsertAfter(var_def_statement el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
var_definitions.InsertRange(FindIndexInList(el) + 1, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public void InsertBefore(var_def_statement el, var_def_statement newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
var_definitions.Insert(FindIndexInList(el), newel);
newel.Parent = this;
}
public void InsertBefore(var_def_statement el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
var_definitions.InsertRange(FindIndexInList(el), newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public bool Remove(var_def_statement el)
{
return var_definitions.Remove(el);
}
public void ReplaceInList(var_def_statement el, var_def_statement newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
var_definitions[FindIndexInList(el)] = newel;
newel.Parent = this;
}
public void ReplaceInList(var_def_statement el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
var ind = FindIndexInList(el);
var_definitions.RemoveAt(ind);
var_definitions.InsertRange(ind, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public int RemoveAll(Predicate match)
{
return var_definitions.RemoveAll(match);
}
public var_def_statement Last()
{
if (var_definitions.Count > 0)
return var_definitions[var_definitions.Count - 1];
throw new InvalidOperationException("Список пуст");
}
public int Count
{
get { return var_definitions.Count; }
}
public void Insert(int pos, var_def_statement el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
var_definitions.Insert(pos,el);
if (el != null)
el.Parent = this;
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
variable_definitions copy = new variable_definitions();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (var_definitions != null)
{
foreach (var_def_statement elem in var_definitions)
{
if (elem != null)
{
copy.Add((var_def_statement)elem.Clone());
copy.Last().Parent = copy;
}
else
copy.Add(null);
}
}
return copy;
}
/// Получает копию данного узла корректного типа
public new variable_definitions TypedClone()
{
return Clone() as variable_definitions;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (var_definitions != null)
{
foreach (var child in var_definitions)
if (child != null)
child.Parent = this;
}
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
if (var_definitions != null)
{
foreach (var child in var_definitions)
child?.FillParentsInAllChilds();
}
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0 + (var_definitions == null ? 0 : var_definitions.Count);
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(var_definitions != null)
{
if(index_counter < var_definitions.Count)
{
return var_definitions[index_counter];
}
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(var_definitions != null)
{
if(index_counter < var_definitions.Count)
{
var_definitions[index_counter]= (var_def_statement)value;
return;
}
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Список идентификаторов
///
[Serializable]
public partial class ident_list : syntax_tree_node
{
///
///Конструктор без параметров.
///
public ident_list()
{
}
///
///Конструктор с параметрами.
///
public ident_list(List _idents)
{
this._idents=_idents;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public ident_list(List _idents,SourceContext sc)
{
this._idents=_idents;
source_context = sc;
FillParentsInDirectChilds();
}
public ident_list(ident elem, SourceContext sc = null)
{
Add(elem, sc);
FillParentsInDirectChilds();
}
protected List _idents=new List();
///
///Список идентификаторов
///
public List idents
{
get
{
return _idents;
}
set
{
_idents=value;
}
}
public ident_list Add(ident elem, SourceContext sc = null)
{
idents.Add(elem);
if (elem != null)
elem.Parent = this;
if (sc != null)
source_context = sc;
return this;
}
public void AddFirst(ident el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
idents.Insert(0, el);
FillParentsInDirectChilds();
}
public void AddFirst(IEnumerable els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
idents.InsertRange(0, els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
public void AddMany(params ident[] els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
idents.AddRange(els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
private int FindIndexInList(ident el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
var ind = idents.FindIndex(x => x == el);
if (ind == -1)
throw new Exception(string.Format("У списка {0} не найден элемент {1} среди дочерних\n", this, el));
return ind;
}
public void InsertAfter(ident el, ident newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
idents.Insert(FindIndexInList(el) + 1, newel);
newel.Parent = this;
}
public void InsertAfter(ident el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
idents.InsertRange(FindIndexInList(el) + 1, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public void InsertBefore(ident el, ident newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
idents.Insert(FindIndexInList(el), newel);
newel.Parent = this;
}
public void InsertBefore(ident el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
idents.InsertRange(FindIndexInList(el), newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public bool Remove(ident el)
{
return idents.Remove(el);
}
public void ReplaceInList(ident el, ident newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
idents[FindIndexInList(el)] = newel;
newel.Parent = this;
}
public void ReplaceInList(ident el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
var ind = FindIndexInList(el);
idents.RemoveAt(ind);
idents.InsertRange(ind, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public int RemoveAll(Predicate match)
{
return idents.RemoveAll(match);
}
public ident Last()
{
if (idents.Count > 0)
return idents[idents.Count - 1];
throw new InvalidOperationException("Список пуст");
}
public int Count
{
get { return idents.Count; }
}
public void Insert(int pos, ident el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
idents.Insert(pos,el);
if (el != null)
el.Parent = this;
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
ident_list copy = new ident_list();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (idents != null)
{
foreach (ident elem in idents)
{
if (elem != null)
{
copy.Add((ident)elem.Clone());
copy.Last().Parent = copy;
}
else
copy.Add(null);
}
}
return copy;
}
/// Получает копию данного узла корректного типа
public new ident_list TypedClone()
{
return Clone() as ident_list;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (idents != null)
{
foreach (var child in idents)
if (child != null)
child.Parent = this;
}
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
if (idents != null)
{
foreach (var child in idents)
child?.FillParentsInAllChilds();
}
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0 + (idents == null ? 0 : idents.Count);
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(idents != null)
{
if(index_counter < idents.Count)
{
return idents[index_counter];
}
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(idents != null)
{
if(index_counter < idents.Count)
{
idents[index_counter]= (ident)value;
return;
}
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Описание переменных одной строкой. Не содержит var, т.к. встречается исключительно внутри другой конструкции.Может встречаться как до beginа (внутри variable_definitions), так и как внутриблочное описание (внутри var_statement).
///
[Serializable]
public partial class var_def_statement : declaration
{
///
///Конструктор без параметров.
///
public var_def_statement()
{
}
///
///Конструктор с параметрами.
///
public var_def_statement(ident_list _vars,type_definition _vars_type,expression _inital_value,definition_attribute _var_attr,bool _is_event)
{
this._vars=_vars;
this._vars_type=_vars_type;
this._inital_value=_inital_value;
this._var_attr=_var_attr;
this._is_event=_is_event;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public var_def_statement(ident_list _vars,type_definition _vars_type,expression _inital_value,definition_attribute _var_attr,bool _is_event,SourceContext sc)
{
this._vars=_vars;
this._vars_type=_vars_type;
this._inital_value=_inital_value;
this._var_attr=_var_attr;
this._is_event=_is_event;
source_context = sc;
FillParentsInDirectChilds();
}
protected ident_list _vars;
protected type_definition _vars_type;
protected expression _inital_value;
protected definition_attribute _var_attr;
protected bool _is_event;
///
///Список имен переменных
///
public ident_list vars
{
get
{
return _vars;
}
set
{
_vars=value;
}
}
///
///Тип переменных
///
public type_definition vars_type
{
get
{
return _vars_type;
}
set
{
_vars_type=value;
}
}
///
///Начальное значение переменных
///
public expression inital_value
{
get
{
return _inital_value;
}
set
{
_inital_value=value;
}
}
///
///
///
public definition_attribute var_attr
{
get
{
return _var_attr;
}
set
{
_var_attr=value;
}
}
///
///Являются ли переменные событиями
///
public bool is_event
{
get
{
return _is_event;
}
set
{
_is_event=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
var_def_statement copy = new var_def_statement();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (vars != null)
{
copy.vars = (ident_list)vars.Clone();
copy.vars.Parent = copy;
}
if (vars_type != null)
{
copy.vars_type = (type_definition)vars_type.Clone();
copy.vars_type.Parent = copy;
}
if (inital_value != null)
{
copy.inital_value = (expression)inital_value.Clone();
copy.inital_value.Parent = copy;
}
copy.var_attr = var_attr;
copy.is_event = is_event;
return copy;
}
/// Получает копию данного узла корректного типа
public new var_def_statement TypedClone()
{
return Clone() as var_def_statement;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (vars != null)
vars.Parent = this;
if (vars_type != null)
vars_type.Parent = this;
if (inital_value != null)
inital_value.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
vars?.FillParentsInAllChilds();
vars_type?.FillParentsInAllChilds();
inital_value?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 3;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 3;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return vars;
case 1:
return vars_type;
case 2:
return inital_value;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
vars = (ident_list)value;
break;
case 1:
vars_type = (type_definition)value;
break;
case 2:
inital_value = (expression)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Описание
///
[Serializable]
public partial class declaration : syntax_tree_node
{
///
///Конструктор без параметров.
///
public declaration()
{
}
///
///Конструктор с параметрами.
///
public declaration(attribute_list _attributes)
{
this._attributes=_attributes;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public declaration(attribute_list _attributes,SourceContext sc)
{
this._attributes=_attributes;
source_context = sc;
FillParentsInDirectChilds();
}
protected attribute_list _attributes;
///
///Список атрибутов описания
///
public attribute_list attributes
{
get
{
return _attributes;
}
set
{
_attributes=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
declaration copy = new declaration();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new declaration TypedClone()
{
return Clone() as declaration;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 1;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 1;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return attributes;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
attributes = (attribute_list)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Список описаний
///
[Serializable]
public partial class declarations : syntax_tree_node
{
///
///Конструктор без параметров.
///
public declarations()
{
}
///
///Конструктор с параметрами.
///
public declarations(List _defs)
{
this._defs=_defs;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public declarations(List _defs,SourceContext sc)
{
this._defs=_defs;
source_context = sc;
FillParentsInDirectChilds();
}
public declarations(declaration elem, SourceContext sc = null)
{
Add(elem, sc);
FillParentsInDirectChilds();
}
protected List _defs=new List();
///
///Список описаний
///
public List defs
{
get
{
return _defs;
}
set
{
_defs=value;
}
}
public declarations Add(declaration elem, SourceContext sc = null)
{
defs.Add(elem);
if (elem != null)
elem.Parent = this;
if (sc != null)
source_context = sc;
return this;
}
public void AddFirst(declaration el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
defs.Insert(0, el);
FillParentsInDirectChilds();
}
public void AddFirst(IEnumerable els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
defs.InsertRange(0, els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
public void AddMany(params declaration[] els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
defs.AddRange(els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
private int FindIndexInList(declaration el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
var ind = defs.FindIndex(x => x == el);
if (ind == -1)
throw new Exception(string.Format("У списка {0} не найден элемент {1} среди дочерних\n", this, el));
return ind;
}
public void InsertAfter(declaration el, declaration newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
defs.Insert(FindIndexInList(el) + 1, newel);
newel.Parent = this;
}
public void InsertAfter(declaration el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
defs.InsertRange(FindIndexInList(el) + 1, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public void InsertBefore(declaration el, declaration newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
defs.Insert(FindIndexInList(el), newel);
newel.Parent = this;
}
public void InsertBefore(declaration el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
defs.InsertRange(FindIndexInList(el), newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public bool Remove(declaration el)
{
return defs.Remove(el);
}
public void ReplaceInList(declaration el, declaration newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
defs[FindIndexInList(el)] = newel;
newel.Parent = this;
}
public void ReplaceInList(declaration el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
var ind = FindIndexInList(el);
defs.RemoveAt(ind);
defs.InsertRange(ind, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public int RemoveAll(Predicate match)
{
return defs.RemoveAll(match);
}
public declaration Last()
{
if (defs.Count > 0)
return defs[defs.Count - 1];
throw new InvalidOperationException("Список пуст");
}
public int Count
{
get { return defs.Count; }
}
public void Insert(int pos, declaration el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
defs.Insert(pos,el);
if (el != null)
el.Parent = this;
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
declarations copy = new declarations();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (defs != null)
{
foreach (declaration elem in defs)
{
if (elem != null)
{
copy.Add((declaration)elem.Clone());
copy.Last().Parent = copy;
}
else
copy.Add(null);
}
}
return copy;
}
/// Получает копию данного узла корректного типа
public new declarations TypedClone()
{
return Clone() as declarations;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (defs != null)
{
foreach (var child in defs)
if (child != null)
child.Parent = this;
}
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
if (defs != null)
{
foreach (var child in defs)
child?.FillParentsInAllChilds();
}
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0 + (defs == null ? 0 : defs.Count);
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(defs != null)
{
if(index_counter < defs.Count)
{
return defs[index_counter];
}
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(defs != null)
{
if(index_counter < defs.Count)
{
defs[index_counter]= (declaration)value;
return;
}
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class program_tree : syntax_tree_node
{
///
///Конструктор без параметров.
///
public program_tree()
{
}
///
///Конструктор с параметрами.
///
public program_tree(List _compilation_units)
{
this._compilation_units=_compilation_units;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public program_tree(List _compilation_units,SourceContext sc)
{
this._compilation_units=_compilation_units;
source_context = sc;
FillParentsInDirectChilds();
}
public program_tree(compilation_unit elem, SourceContext sc = null)
{
Add(elem, sc);
FillParentsInDirectChilds();
}
protected List _compilation_units=new List();
///
///Список подключенных модулей
///
public List compilation_units
{
get
{
return _compilation_units;
}
set
{
_compilation_units=value;
}
}
public program_tree Add(compilation_unit elem, SourceContext sc = null)
{
compilation_units.Add(elem);
if (elem != null)
elem.Parent = this;
if (sc != null)
source_context = sc;
return this;
}
public void AddFirst(compilation_unit el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
compilation_units.Insert(0, el);
FillParentsInDirectChilds();
}
public void AddFirst(IEnumerable els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
compilation_units.InsertRange(0, els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
public void AddMany(params compilation_unit[] els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
compilation_units.AddRange(els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
private int FindIndexInList(compilation_unit el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
var ind = compilation_units.FindIndex(x => x == el);
if (ind == -1)
throw new Exception(string.Format("У списка {0} не найден элемент {1} среди дочерних\n", this, el));
return ind;
}
public void InsertAfter(compilation_unit el, compilation_unit newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
compilation_units.Insert(FindIndexInList(el) + 1, newel);
newel.Parent = this;
}
public void InsertAfter(compilation_unit el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
compilation_units.InsertRange(FindIndexInList(el) + 1, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public void InsertBefore(compilation_unit el, compilation_unit newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
compilation_units.Insert(FindIndexInList(el), newel);
newel.Parent = this;
}
public void InsertBefore(compilation_unit el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
compilation_units.InsertRange(FindIndexInList(el), newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public bool Remove(compilation_unit el)
{
return compilation_units.Remove(el);
}
public void ReplaceInList(compilation_unit el, compilation_unit newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
compilation_units[FindIndexInList(el)] = newel;
newel.Parent = this;
}
public void ReplaceInList(compilation_unit el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
var ind = FindIndexInList(el);
compilation_units.RemoveAt(ind);
compilation_units.InsertRange(ind, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public int RemoveAll(Predicate match)
{
return compilation_units.RemoveAll(match);
}
public compilation_unit Last()
{
if (compilation_units.Count > 0)
return compilation_units[compilation_units.Count - 1];
throw new InvalidOperationException("Список пуст");
}
public int Count
{
get { return compilation_units.Count; }
}
public void Insert(int pos, compilation_unit el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
compilation_units.Insert(pos,el);
if (el != null)
el.Parent = this;
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
program_tree copy = new program_tree();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (compilation_units != null)
{
foreach (compilation_unit elem in compilation_units)
{
if (elem != null)
{
copy.Add((compilation_unit)elem.Clone());
copy.Last().Parent = copy;
}
else
copy.Add(null);
}
}
return copy;
}
/// Получает копию данного узла корректного типа
public new program_tree TypedClone()
{
return Clone() as program_tree;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (compilation_units != null)
{
foreach (var child in compilation_units)
if (child != null)
child.Parent = this;
}
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
if (compilation_units != null)
{
foreach (var child in compilation_units)
child?.FillParentsInAllChilds();
}
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0 + (compilation_units == null ? 0 : compilation_units.Count);
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(compilation_units != null)
{
if(index_counter < compilation_units.Count)
{
return compilation_units[index_counter];
}
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(compilation_units != null)
{
if(index_counter < compilation_units.Count)
{
compilation_units[index_counter]= (compilation_unit)value;
return;
}
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Имя программы
///
[Serializable]
public partial class program_name : syntax_tree_node
{
///
///Конструктор без параметров.
///
public program_name()
{
}
///
///Конструктор с параметрами.
///
public program_name(ident _prog_name)
{
this._prog_name=_prog_name;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public program_name(ident _prog_name,SourceContext sc)
{
this._prog_name=_prog_name;
source_context = sc;
FillParentsInDirectChilds();
}
protected ident _prog_name;
///
///Идентификатор - имя программы
///
public ident prog_name
{
get
{
return _prog_name;
}
set
{
_prog_name=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
program_name copy = new program_name();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (prog_name != null)
{
copy.prog_name = (ident)prog_name.Clone();
copy.prog_name.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new program_name TypedClone()
{
return Clone() as program_name;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (prog_name != null)
prog_name.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
prog_name?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 1;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 1;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return prog_name;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
prog_name = (ident)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Строковая константа
///
[Serializable]
public partial class string_const : literal
{
///
///Конструктор без параметров.
///
public string_const()
{
}
///
///Конструктор с параметрами.
///
public string_const(string _Value)
{
this._Value=_Value;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public string_const(string _Value,SourceContext sc)
{
this._Value=_Value;
source_context = sc;
FillParentsInDirectChilds();
}
protected string _Value;
///
///Значенеи строковой константы
///
public string Value
{
get
{
return _Value;
}
set
{
_Value=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
string_const copy = new string_const();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
copy.Value = Value;
return copy;
}
/// Получает копию данного узла корректного типа
public new string_const TypedClone()
{
return Clone() as string_const;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Список выражений
///
[Serializable]
public partial class expression_list : syntax_tree_node
{
///
///Конструктор без параметров.
///
public expression_list()
{
}
///
///Конструктор с параметрами.
///
public expression_list(List _expressions)
{
this._expressions=_expressions;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public expression_list(List _expressions,SourceContext sc)
{
this._expressions=_expressions;
source_context = sc;
FillParentsInDirectChilds();
}
public expression_list(expression elem, SourceContext sc = null)
{
Add(elem, sc);
FillParentsInDirectChilds();
}
protected List _expressions=new List();
///
///Список выражений
///
public List expressions
{
get
{
return _expressions;
}
set
{
_expressions=value;
}
}
public expression_list Add(expression elem, SourceContext sc = null)
{
expressions.Add(elem);
if (elem != null)
elem.Parent = this;
if (sc != null)
source_context = sc;
return this;
}
public void AddFirst(expression el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
expressions.Insert(0, el);
FillParentsInDirectChilds();
}
public void AddFirst(IEnumerable els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
expressions.InsertRange(0, els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
public void AddMany(params expression[] els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
expressions.AddRange(els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
private int FindIndexInList(expression el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
var ind = expressions.FindIndex(x => x == el);
if (ind == -1)
throw new Exception(string.Format("У списка {0} не найден элемент {1} среди дочерних\n", this, el));
return ind;
}
public void InsertAfter(expression el, expression newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
expressions.Insert(FindIndexInList(el) + 1, newel);
newel.Parent = this;
}
public void InsertAfter(expression el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
expressions.InsertRange(FindIndexInList(el) + 1, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public void InsertBefore(expression el, expression newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
expressions.Insert(FindIndexInList(el), newel);
newel.Parent = this;
}
public void InsertBefore(expression el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
expressions.InsertRange(FindIndexInList(el), newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public bool Remove(expression el)
{
return expressions.Remove(el);
}
public void ReplaceInList(expression el, expression newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
expressions[FindIndexInList(el)] = newel;
newel.Parent = this;
}
public void ReplaceInList(expression el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
var ind = FindIndexInList(el);
expressions.RemoveAt(ind);
expressions.InsertRange(ind, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public int RemoveAll(Predicate match)
{
return expressions.RemoveAll(match);
}
public expression Last()
{
if (expressions.Count > 0)
return expressions[expressions.Count - 1];
throw new InvalidOperationException("Список пуст");
}
public int Count
{
get { return expressions.Count; }
}
public void Insert(int pos, expression el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
expressions.Insert(pos,el);
if (el != null)
el.Parent = this;
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
expression_list copy = new expression_list();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (expressions != null)
{
foreach (expression elem in expressions)
{
if (elem != null)
{
copy.Add((expression)elem.Clone());
copy.Last().Parent = copy;
}
else
copy.Add(null);
}
}
return copy;
}
/// Получает копию данного узла корректного типа
public new expression_list TypedClone()
{
return Clone() as expression_list;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (expressions != null)
{
foreach (var child in expressions)
if (child != null)
child.Parent = this;
}
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
if (expressions != null)
{
foreach (var child in expressions)
child?.FillParentsInAllChilds();
}
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0 + (expressions == null ? 0 : expressions.Count);
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(expressions != null)
{
if(index_counter < expressions.Count)
{
return expressions[index_counter];
}
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(expressions != null)
{
if(index_counter < expressions.Count)
{
expressions[index_counter]= (expression)value;
return;
}
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class dereference : addressed_value_funcname
{
///
///Конструктор без параметров.
///
public dereference()
{
}
///
///Конструктор с параметрами.
///
public dereference(addressed_value _dereferencing_value)
{
this._dereferencing_value=_dereferencing_value;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public dereference(addressed_value _dereferencing_value,SourceContext sc)
{
this._dereferencing_value=_dereferencing_value;
source_context = sc;
FillParentsInDirectChilds();
}
protected addressed_value _dereferencing_value;
///
///
///
public addressed_value dereferencing_value
{
get
{
return _dereferencing_value;
}
set
{
_dereferencing_value=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
dereference copy = new dereference();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (dereferencing_value != null)
{
copy.dereferencing_value = (addressed_value)dereferencing_value.Clone();
copy.dereferencing_value.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new dereference TypedClone()
{
return Clone() as dereference;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (dereferencing_value != null)
dereferencing_value.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
dereferencing_value?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 1;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 1;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return dereferencing_value;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
dereferencing_value = (addressed_value)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Индекс или индексы
///
[Serializable]
public partial class indexer : dereference
{
///
///Конструктор без параметров.
///
public indexer()
{
}
///
///Конструктор с параметрами.
///
public indexer(expression_list _indexes)
{
this._indexes=_indexes;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public indexer(expression_list _indexes,SourceContext sc)
{
this._indexes=_indexes;
source_context = sc;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public indexer(addressed_value _dereferencing_value,expression_list _indexes)
{
this._dereferencing_value=_dereferencing_value;
this._indexes=_indexes;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public indexer(addressed_value _dereferencing_value,expression_list _indexes,SourceContext sc)
{
this._dereferencing_value=_dereferencing_value;
this._indexes=_indexes;
source_context = sc;
FillParentsInDirectChilds();
}
protected expression_list _indexes;
///
///Список индексов
///
public expression_list indexes
{
get
{
return _indexes;
}
set
{
_indexes=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
indexer copy = new indexer();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (dereferencing_value != null)
{
copy.dereferencing_value = (addressed_value)dereferencing_value.Clone();
copy.dereferencing_value.Parent = copy;
}
if (indexes != null)
{
copy.indexes = (expression_list)indexes.Clone();
copy.indexes.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new indexer TypedClone()
{
return Clone() as indexer;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (dereferencing_value != null)
dereferencing_value.Parent = this;
if (indexes != null)
indexes.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
dereferencing_value?.FillParentsInAllChilds();
indexes?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return dereferencing_value;
case 1:
return indexes;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
dereferencing_value = (addressed_value)value;
break;
case 1:
indexes = (expression_list)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Цикл for
///
[Serializable]
public partial class for_node : statement
{
///
///Конструктор без параметров.
///
public for_node()
{
}
///
///Конструктор с параметрами.
///
public for_node(ident _loop_variable,expression _initial_value,expression _finish_value,statement _statements,for_cycle_type _cycle_type,expression _increment_value,type_definition _type_name,bool _create_loop_variable)
{
this._loop_variable=_loop_variable;
this._initial_value=_initial_value;
this._finish_value=_finish_value;
this._statements=_statements;
this._cycle_type=_cycle_type;
this._increment_value=_increment_value;
this._type_name=_type_name;
this._create_loop_variable=_create_loop_variable;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public for_node(ident _loop_variable,expression _initial_value,expression _finish_value,statement _statements,for_cycle_type _cycle_type,expression _increment_value,type_definition _type_name,bool _create_loop_variable,SourceContext sc)
{
this._loop_variable=_loop_variable;
this._initial_value=_initial_value;
this._finish_value=_finish_value;
this._statements=_statements;
this._cycle_type=_cycle_type;
this._increment_value=_increment_value;
this._type_name=_type_name;
this._create_loop_variable=_create_loop_variable;
source_context = sc;
FillParentsInDirectChilds();
}
protected ident _loop_variable;
protected expression _initial_value;
protected expression _finish_value;
protected statement _statements;
protected for_cycle_type _cycle_type;
protected expression _increment_value;
protected type_definition _type_name;
protected bool _create_loop_variable;
///
///Переменная цикла for
///
public ident loop_variable
{
get
{
return _loop_variable;
}
set
{
_loop_variable=value;
}
}
///
///Начальное значение переменной цикла
///
public expression initial_value
{
get
{
return _initial_value;
}
set
{
_initial_value=value;
}
}
///
///Конечное значение переменной цикла
///
public expression finish_value
{
get
{
return _finish_value;
}
set
{
_finish_value=value;
}
}
///
///Тело цикла
///
public statement statements
{
get
{
return _statements;
}
set
{
_statements=value;
}
}
///
///
///
public for_cycle_type cycle_type
{
get
{
return _cycle_type;
}
set
{
_cycle_type=value;
}
}
///
///Шаг переменной цикла
///
public expression increment_value
{
get
{
return _increment_value;
}
set
{
_increment_value=value;
}
}
///
///
///
public type_definition type_name
{
get
{
return _type_name;
}
set
{
_type_name=value;
}
}
///
///
///
public bool create_loop_variable
{
get
{
return _create_loop_variable;
}
set
{
_create_loop_variable=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
for_node copy = new for_node();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (loop_variable != null)
{
copy.loop_variable = (ident)loop_variable.Clone();
copy.loop_variable.Parent = copy;
}
if (initial_value != null)
{
copy.initial_value = (expression)initial_value.Clone();
copy.initial_value.Parent = copy;
}
if (finish_value != null)
{
copy.finish_value = (expression)finish_value.Clone();
copy.finish_value.Parent = copy;
}
if (statements != null)
{
copy.statements = (statement)statements.Clone();
copy.statements.Parent = copy;
}
copy.cycle_type = cycle_type;
if (increment_value != null)
{
copy.increment_value = (expression)increment_value.Clone();
copy.increment_value.Parent = copy;
}
if (type_name != null)
{
copy.type_name = (type_definition)type_name.Clone();
copy.type_name.Parent = copy;
}
copy.create_loop_variable = create_loop_variable;
return copy;
}
/// Получает копию данного узла корректного типа
public new for_node TypedClone()
{
return Clone() as for_node;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (loop_variable != null)
loop_variable.Parent = this;
if (initial_value != null)
initial_value.Parent = this;
if (finish_value != null)
finish_value.Parent = this;
if (statements != null)
statements.Parent = this;
if (increment_value != null)
increment_value.Parent = this;
if (type_name != null)
type_name.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
loop_variable?.FillParentsInAllChilds();
initial_value?.FillParentsInAllChilds();
finish_value?.FillParentsInAllChilds();
statements?.FillParentsInAllChilds();
increment_value?.FillParentsInAllChilds();
type_name?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 6;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 6;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return loop_variable;
case 1:
return initial_value;
case 2:
return finish_value;
case 3:
return statements;
case 4:
return increment_value;
case 5:
return type_name;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
loop_variable = (ident)value;
break;
case 1:
initial_value = (expression)value;
break;
case 2:
finish_value = (expression)value;
break;
case 3:
statements = (statement)value;
break;
case 4:
increment_value = (expression)value;
break;
case 5:
type_name = (type_definition)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Цикл с постусловием (repeat)
///
[Serializable]
public partial class repeat_node : statement
{
///
///Конструктор без параметров.
///
public repeat_node()
{
}
///
///Конструктор с параметрами.
///
public repeat_node(statement _statements,expression _expr)
{
this._statements=_statements;
this._expr=_expr;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public repeat_node(statement _statements,expression _expr,SourceContext sc)
{
this._statements=_statements;
this._expr=_expr;
source_context = sc;
FillParentsInDirectChilds();
}
protected statement _statements;
protected expression _expr;
///
///Тело цикла
///
public statement statements
{
get
{
return _statements;
}
set
{
_statements=value;
}
}
///
///Условие завершения цикла
///
public expression expr
{
get
{
return _expr;
}
set
{
_expr=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
repeat_node copy = new repeat_node();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (statements != null)
{
copy.statements = (statement)statements.Clone();
copy.statements.Parent = copy;
}
if (expr != null)
{
copy.expr = (expression)expr.Clone();
copy.expr.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new repeat_node TypedClone()
{
return Clone() as repeat_node;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (statements != null)
statements.Parent = this;
if (expr != null)
expr.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
statements?.FillParentsInAllChilds();
expr?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return statements;
case 1:
return expr;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
statements = (statement)value;
break;
case 1:
expr = (expression)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Цикл ПОКА
///
[Serializable]
public partial class while_node : statement
{
///
///Конструктор без параметров.
///
public while_node()
{
}
///
///Конструктор с параметрами.
///
public while_node(expression _expr,statement _statements,WhileCycleType _CycleType)
{
this._expr=_expr;
this._statements=_statements;
this._CycleType=_CycleType;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public while_node(expression _expr,statement _statements,WhileCycleType _CycleType,SourceContext sc)
{
this._expr=_expr;
this._statements=_statements;
this._CycleType=_CycleType;
source_context = sc;
FillParentsInDirectChilds();
}
protected expression _expr;
protected statement _statements;
protected WhileCycleType _CycleType;
///
///Условие цикла
///
public expression expr
{
get
{
return _expr;
}
set
{
_expr=value;
}
}
///
///Тело цикла
///
public statement statements
{
get
{
return _statements;
}
set
{
_statements=value;
}
}
///
///Тип цикла ПОКА
///
public WhileCycleType CycleType
{
get
{
return _CycleType;
}
set
{
_CycleType=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
while_node copy = new while_node();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (expr != null)
{
copy.expr = (expression)expr.Clone();
copy.expr.Parent = copy;
}
if (statements != null)
{
copy.statements = (statement)statements.Clone();
copy.statements.Parent = copy;
}
copy.CycleType = CycleType;
return copy;
}
/// Получает копию данного узла корректного типа
public new while_node TypedClone()
{
return Clone() as while_node;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (expr != null)
expr.Parent = this;
if (statements != null)
statements.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
expr?.FillParentsInAllChilds();
statements?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return expr;
case 1:
return statements;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
expr = (expression)value;
break;
case 1:
statements = (statement)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Условный оператор
///
[Serializable]
public partial class if_node : statement
{
///
///Конструктор без параметров.
///
public if_node()
{
}
///
///Конструктор с параметрами.
///
public if_node(expression _condition,statement _then_body,statement _else_body)
{
this._condition=_condition;
this._then_body=_then_body;
this._else_body=_else_body;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public if_node(expression _condition,statement _then_body,statement _else_body,SourceContext sc)
{
this._condition=_condition;
this._then_body=_then_body;
this._else_body=_else_body;
source_context = sc;
FillParentsInDirectChilds();
}
protected expression _condition;
protected statement _then_body;
protected statement _else_body;
///
///Условие
///
public expression condition
{
get
{
return _condition;
}
set
{
_condition=value;
}
}
///
///Оператор по ветви then
///
public statement then_body
{
get
{
return _then_body;
}
set
{
_then_body=value;
}
}
///
///Оператор по ветви else
///
public statement else_body
{
get
{
return _else_body;
}
set
{
_else_body=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
if_node copy = new if_node();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (condition != null)
{
copy.condition = (expression)condition.Clone();
copy.condition.Parent = copy;
}
if (then_body != null)
{
copy.then_body = (statement)then_body.Clone();
copy.then_body.Parent = copy;
}
if (else_body != null)
{
copy.else_body = (statement)else_body.Clone();
copy.else_body.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new if_node TypedClone()
{
return Clone() as if_node;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (condition != null)
condition.Parent = this;
if (then_body != null)
then_body.Parent = this;
if (else_body != null)
else_body.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
condition?.FillParentsInAllChilds();
then_body?.FillParentsInAllChilds();
else_body?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 3;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 3;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return condition;
case 1:
return then_body;
case 2:
return else_body;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
condition = (expression)value;
break;
case 1:
then_body = (statement)value;
break;
case 2:
else_body = (statement)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class ref_type : type_definition
{
///
///Конструктор без параметров.
///
public ref_type()
{
}
///
///Конструктор с параметрами.
///
public ref_type(type_definition _pointed_to)
{
this._pointed_to=_pointed_to;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public ref_type(type_definition _pointed_to,SourceContext sc)
{
this._pointed_to=_pointed_to;
source_context = sc;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public ref_type(type_definition_attr_list _attr_list,type_definition _pointed_to)
{
this._attr_list=_attr_list;
this._pointed_to=_pointed_to;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public ref_type(type_definition_attr_list _attr_list,type_definition _pointed_to,SourceContext sc)
{
this._attr_list=_attr_list;
this._pointed_to=_pointed_to;
source_context = sc;
FillParentsInDirectChilds();
}
protected type_definition _pointed_to;
///
///
///
public type_definition pointed_to
{
get
{
return _pointed_to;
}
set
{
_pointed_to=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
ref_type copy = new ref_type();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (attr_list != null)
{
copy.attr_list = (type_definition_attr_list)attr_list.Clone();
copy.attr_list.Parent = copy;
}
if (pointed_to != null)
{
copy.pointed_to = (type_definition)pointed_to.Clone();
copy.pointed_to.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new ref_type TypedClone()
{
return Clone() as ref_type;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (attr_list != null)
attr_list.Parent = this;
if (pointed_to != null)
pointed_to.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
attr_list?.FillParentsInAllChilds();
pointed_to?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return attr_list;
case 1:
return pointed_to;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
attr_list = (type_definition_attr_list)value;
break;
case 1:
pointed_to = (type_definition)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Диапазон
///
[Serializable]
public partial class diapason : type_definition
{
///
///Конструктор без параметров.
///
public diapason()
{
}
///
///Конструктор с параметрами.
///
public diapason(expression _left,expression _right)
{
this._left=_left;
this._right=_right;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public diapason(expression _left,expression _right,SourceContext sc)
{
this._left=_left;
this._right=_right;
source_context = sc;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public diapason(type_definition_attr_list _attr_list,expression _left,expression _right)
{
this._attr_list=_attr_list;
this._left=_left;
this._right=_right;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public diapason(type_definition_attr_list _attr_list,expression _left,expression _right,SourceContext sc)
{
this._attr_list=_attr_list;
this._left=_left;
this._right=_right;
source_context = sc;
FillParentsInDirectChilds();
}
protected expression _left;
protected expression _right;
///
///Нижняя граница диапазона
///
public expression left
{
get
{
return _left;
}
set
{
_left=value;
}
}
///
///Верхняя граница диапазона
///
public expression right
{
get
{
return _right;
}
set
{
_right=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
diapason copy = new diapason();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (attr_list != null)
{
copy.attr_list = (type_definition_attr_list)attr_list.Clone();
copy.attr_list.Parent = copy;
}
if (left != null)
{
copy.left = (expression)left.Clone();
copy.left.Parent = copy;
}
if (right != null)
{
copy.right = (expression)right.Clone();
copy.right.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new diapason TypedClone()
{
return Clone() as diapason;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (attr_list != null)
attr_list.Parent = this;
if (left != null)
left.Parent = this;
if (right != null)
right.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
attr_list?.FillParentsInAllChilds();
left?.FillParentsInAllChilds();
right?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 3;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 3;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return attr_list;
case 1:
return left;
case 2:
return right;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
attr_list = (type_definition_attr_list)value;
break;
case 1:
left = (expression)value;
break;
case 2:
right = (expression)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Типы индексов
///
[Serializable]
public partial class indexers_types : type_definition
{
///
///Конструктор без параметров.
///
public indexers_types()
{
}
///
///Конструктор с параметрами.
///
public indexers_types(List _indexers)
{
this._indexers=_indexers;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public indexers_types(List _indexers,SourceContext sc)
{
this._indexers=_indexers;
source_context = sc;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public indexers_types(type_definition_attr_list _attr_list,List _indexers)
{
this._attr_list=_attr_list;
this._indexers=_indexers;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public indexers_types(type_definition_attr_list _attr_list,List _indexers,SourceContext sc)
{
this._attr_list=_attr_list;
this._indexers=_indexers;
source_context = sc;
FillParentsInDirectChilds();
}
public indexers_types(type_definition elem, SourceContext sc = null)
{
Add(elem, sc);
FillParentsInDirectChilds();
}
protected List _indexers=new List();
///
///Список типов индексов
///
public List indexers
{
get
{
return _indexers;
}
set
{
_indexers=value;
}
}
public indexers_types Add(type_definition elem, SourceContext sc = null)
{
indexers.Add(elem);
if (elem != null)
elem.Parent = this;
if (sc != null)
source_context = sc;
return this;
}
public void AddFirst(type_definition el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
indexers.Insert(0, el);
FillParentsInDirectChilds();
}
public void AddFirst(IEnumerable els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
indexers.InsertRange(0, els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
public void AddMany(params type_definition[] els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
indexers.AddRange(els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
private int FindIndexInList(type_definition el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
var ind = indexers.FindIndex(x => x == el);
if (ind == -1)
throw new Exception(string.Format("У списка {0} не найден элемент {1} среди дочерних\n", this, el));
return ind;
}
public void InsertAfter(type_definition el, type_definition newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
indexers.Insert(FindIndexInList(el) + 1, newel);
newel.Parent = this;
}
public void InsertAfter(type_definition el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
indexers.InsertRange(FindIndexInList(el) + 1, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public void InsertBefore(type_definition el, type_definition newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
indexers.Insert(FindIndexInList(el), newel);
newel.Parent = this;
}
public void InsertBefore(type_definition el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
indexers.InsertRange(FindIndexInList(el), newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public bool Remove(type_definition el)
{
return indexers.Remove(el);
}
public void ReplaceInList(type_definition el, type_definition newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
indexers[FindIndexInList(el)] = newel;
newel.Parent = this;
}
public void ReplaceInList(type_definition el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
var ind = FindIndexInList(el);
indexers.RemoveAt(ind);
indexers.InsertRange(ind, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public int RemoveAll(Predicate match)
{
return indexers.RemoveAll(match);
}
public type_definition Last()
{
if (indexers.Count > 0)
return indexers[indexers.Count - 1];
throw new InvalidOperationException("Список пуст");
}
public int Count
{
get { return indexers.Count; }
}
public void Insert(int pos, type_definition el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
indexers.Insert(pos,el);
if (el != null)
el.Parent = this;
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
indexers_types copy = new indexers_types();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (attr_list != null)
{
copy.attr_list = (type_definition_attr_list)attr_list.Clone();
copy.attr_list.Parent = copy;
}
if (indexers != null)
{
foreach (type_definition elem in indexers)
{
if (elem != null)
{
copy.Add((type_definition)elem.Clone());
copy.Last().Parent = copy;
}
else
copy.Add(null);
}
}
return copy;
}
/// Получает копию данного узла корректного типа
public new indexers_types TypedClone()
{
return Clone() as indexers_types;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (attr_list != null)
attr_list.Parent = this;
if (indexers != null)
{
foreach (var child in indexers)
if (child != null)
child.Parent = this;
}
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
attr_list?.FillParentsInAllChilds();
if (indexers != null)
{
foreach (var child in indexers)
child?.FillParentsInAllChilds();
}
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 1;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 1 + (indexers == null ? 0 : indexers.Count);
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return attr_list;
}
Int32 index_counter=ind - 1;
if(indexers != null)
{
if(index_counter < indexers.Count)
{
return indexers[index_counter];
}
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
attr_list = (type_definition_attr_list)value;
break;
}
Int32 index_counter=ind - 1;
if(indexers != null)
{
if(index_counter < indexers.Count)
{
indexers[index_counter]= (type_definition)value;
return;
}
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Тип массива
///
[Serializable]
public partial class array_type : type_definition
{
///
///Конструктор без параметров.
///
public array_type()
{
}
///
///Конструктор с параметрами.
///
public array_type(indexers_types _indexers,type_definition _elements_type)
{
this._indexers=_indexers;
this._elements_type=_elements_type;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public array_type(indexers_types _indexers,type_definition _elements_type,SourceContext sc)
{
this._indexers=_indexers;
this._elements_type=_elements_type;
source_context = sc;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public array_type(type_definition_attr_list _attr_list,indexers_types _indexers,type_definition _elements_type)
{
this._attr_list=_attr_list;
this._indexers=_indexers;
this._elements_type=_elements_type;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public array_type(type_definition_attr_list _attr_list,indexers_types _indexers,type_definition _elements_type,SourceContext sc)
{
this._attr_list=_attr_list;
this._indexers=_indexers;
this._elements_type=_elements_type;
source_context = sc;
FillParentsInDirectChilds();
}
protected indexers_types _indexers;
protected type_definition _elements_type;
///
///Типы индексов массива
///
public indexers_types indexers
{
get
{
return _indexers;
}
set
{
_indexers=value;
}
}
///
///Тип элементов массива
///
public type_definition elements_type
{
get
{
return _elements_type;
}
set
{
_elements_type=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
array_type copy = new array_type();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (attr_list != null)
{
copy.attr_list = (type_definition_attr_list)attr_list.Clone();
copy.attr_list.Parent = copy;
}
if (indexers != null)
{
copy.indexers = (indexers_types)indexers.Clone();
copy.indexers.Parent = copy;
}
if (elements_type != null)
{
copy.elements_type = (type_definition)elements_type.Clone();
copy.elements_type.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new array_type TypedClone()
{
return Clone() as array_type;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (attr_list != null)
attr_list.Parent = this;
if (indexers != null)
indexers.Parent = this;
if (elements_type != null)
elements_type.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
attr_list?.FillParentsInAllChilds();
indexers?.FillParentsInAllChilds();
elements_type?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 3;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 3;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return attr_list;
case 1:
return indexers;
case 2:
return elements_type;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
attr_list = (type_definition_attr_list)value;
break;
case 1:
indexers = (indexers_types)value;
break;
case 2:
elements_type = (type_definition)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Описание меток
///
[Serializable]
public partial class label_definitions : declaration
{
///
///Конструктор без параметров.
///
public label_definitions()
{
}
///
///Конструктор с параметрами.
///
public label_definitions(ident_list _labels)
{
this._labels=_labels;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public label_definitions(ident_list _labels,SourceContext sc)
{
this._labels=_labels;
source_context = sc;
FillParentsInDirectChilds();
}
protected ident_list _labels;
///
///Список меток
///
public ident_list labels
{
get
{
return _labels;
}
set
{
_labels=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
label_definitions copy = new label_definitions();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (labels != null)
{
copy.labels = (ident_list)labels.Clone();
copy.labels.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new label_definitions TypedClone()
{
return Clone() as label_definitions;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (labels != null)
labels.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
labels?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 1;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 1;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return labels;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
labels = (ident_list)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class procedure_attribute : ident
{
///
///Конструктор без параметров.
///
public procedure_attribute()
{
}
///
///Конструктор с параметрами.
///
public procedure_attribute(proc_attribute _attribute_type)
{
this._attribute_type=_attribute_type;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public procedure_attribute(proc_attribute _attribute_type,SourceContext sc)
{
this._attribute_type=_attribute_type;
source_context = sc;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public procedure_attribute(string _name,proc_attribute _attribute_type)
{
this._name=_name;
this._attribute_type=_attribute_type;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public procedure_attribute(string _name,proc_attribute _attribute_type,SourceContext sc)
{
this._name=_name;
this._attribute_type=_attribute_type;
source_context = sc;
FillParentsInDirectChilds();
}
protected proc_attribute _attribute_type;
///
///
///
public proc_attribute attribute_type
{
get
{
return _attribute_type;
}
set
{
_attribute_type=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
procedure_attribute copy = new procedure_attribute();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
copy.name = name;
copy.attribute_type = attribute_type;
return copy;
}
/// Получает копию данного узла корректного типа
public new procedure_attribute TypedClone()
{
return Clone() as procedure_attribute;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class typed_parameters : declaration
{
///
///Конструктор без параметров.
///
public typed_parameters()
{
}
///
///Конструктор с параметрами.
///
public typed_parameters(ident_list _idents,type_definition _vars_type,parametr_kind _param_kind,expression _inital_value)
{
this._idents=_idents;
this._vars_type=_vars_type;
this._param_kind=_param_kind;
this._inital_value=_inital_value;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public typed_parameters(ident_list _idents,type_definition _vars_type,parametr_kind _param_kind,expression _inital_value,SourceContext sc)
{
this._idents=_idents;
this._vars_type=_vars_type;
this._param_kind=_param_kind;
this._inital_value=_inital_value;
source_context = sc;
FillParentsInDirectChilds();
}
protected ident_list _idents;
protected type_definition _vars_type;
protected parametr_kind _param_kind;
protected expression _inital_value;
///
///
///
public ident_list idents
{
get
{
return _idents;
}
set
{
_idents=value;
}
}
///
///
///
public type_definition vars_type
{
get
{
return _vars_type;
}
set
{
_vars_type=value;
}
}
///
///
///
public parametr_kind param_kind
{
get
{
return _param_kind;
}
set
{
_param_kind=value;
}
}
///
///
///
public expression inital_value
{
get
{
return _inital_value;
}
set
{
_inital_value=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
typed_parameters copy = new typed_parameters();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (idents != null)
{
copy.idents = (ident_list)idents.Clone();
copy.idents.Parent = copy;
}
if (vars_type != null)
{
copy.vars_type = (type_definition)vars_type.Clone();
copy.vars_type.Parent = copy;
}
copy.param_kind = param_kind;
if (inital_value != null)
{
copy.inital_value = (expression)inital_value.Clone();
copy.inital_value.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new typed_parameters TypedClone()
{
return Clone() as typed_parameters;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (idents != null)
idents.Parent = this;
if (vars_type != null)
vars_type.Parent = this;
if (inital_value != null)
inital_value.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
idents?.FillParentsInAllChilds();
vars_type?.FillParentsInAllChilds();
inital_value?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 3;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 3;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return idents;
case 1:
return vars_type;
case 2:
return inital_value;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
idents = (ident_list)value;
break;
case 1:
vars_type = (type_definition)value;
break;
case 2:
inital_value = (expression)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class formal_parameters : syntax_tree_node
{
///
///Конструктор без параметров.
///
public formal_parameters()
{
}
///
///Конструктор с параметрами.
///
public formal_parameters(List _params_list)
{
this._params_list=_params_list;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public formal_parameters(List _params_list,SourceContext sc)
{
this._params_list=_params_list;
source_context = sc;
FillParentsInDirectChilds();
}
public formal_parameters(typed_parameters elem, SourceContext sc = null)
{
Add(elem, sc);
FillParentsInDirectChilds();
}
protected List _params_list=new List();
///
///
///
public List params_list
{
get
{
return _params_list;
}
set
{
_params_list=value;
}
}
public formal_parameters Add(typed_parameters elem, SourceContext sc = null)
{
params_list.Add(elem);
if (elem != null)
elem.Parent = this;
if (sc != null)
source_context = sc;
return this;
}
public void AddFirst(typed_parameters el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
params_list.Insert(0, el);
FillParentsInDirectChilds();
}
public void AddFirst(IEnumerable els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
params_list.InsertRange(0, els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
public void AddMany(params typed_parameters[] els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
params_list.AddRange(els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
private int FindIndexInList(typed_parameters el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
var ind = params_list.FindIndex(x => x == el);
if (ind == -1)
throw new Exception(string.Format("У списка {0} не найден элемент {1} среди дочерних\n", this, el));
return ind;
}
public void InsertAfter(typed_parameters el, typed_parameters newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
params_list.Insert(FindIndexInList(el) + 1, newel);
newel.Parent = this;
}
public void InsertAfter(typed_parameters el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
params_list.InsertRange(FindIndexInList(el) + 1, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public void InsertBefore(typed_parameters el, typed_parameters newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
params_list.Insert(FindIndexInList(el), newel);
newel.Parent = this;
}
public void InsertBefore(typed_parameters el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
params_list.InsertRange(FindIndexInList(el), newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public bool Remove(typed_parameters el)
{
return params_list.Remove(el);
}
public void ReplaceInList(typed_parameters el, typed_parameters newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
params_list[FindIndexInList(el)] = newel;
newel.Parent = this;
}
public void ReplaceInList(typed_parameters el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
var ind = FindIndexInList(el);
params_list.RemoveAt(ind);
params_list.InsertRange(ind, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public int RemoveAll(Predicate match)
{
return params_list.RemoveAll(match);
}
public typed_parameters Last()
{
if (params_list.Count > 0)
return params_list[params_list.Count - 1];
throw new InvalidOperationException("Список пуст");
}
public int Count
{
get { return params_list.Count; }
}
public void Insert(int pos, typed_parameters el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
params_list.Insert(pos,el);
if (el != null)
el.Parent = this;
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
formal_parameters copy = new formal_parameters();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (params_list != null)
{
foreach (typed_parameters elem in params_list)
{
if (elem != null)
{
copy.Add((typed_parameters)elem.Clone());
copy.Last().Parent = copy;
}
else
copy.Add(null);
}
}
return copy;
}
/// Получает копию данного узла корректного типа
public new formal_parameters TypedClone()
{
return Clone() as formal_parameters;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (params_list != null)
{
foreach (var child in params_list)
if (child != null)
child.Parent = this;
}
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
if (params_list != null)
{
foreach (var child in params_list)
child?.FillParentsInAllChilds();
}
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0 + (params_list == null ? 0 : params_list.Count);
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(params_list != null)
{
if(index_counter < params_list.Count)
{
return params_list[index_counter];
}
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(params_list != null)
{
if(index_counter < params_list.Count)
{
params_list[index_counter]= (typed_parameters)value;
return;
}
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class procedure_attributes_list : syntax_tree_node
{
///
///Конструктор без параметров.
///
public procedure_attributes_list()
{
}
///
///Конструктор с параметрами.
///
public procedure_attributes_list(List _proc_attributes)
{
this._proc_attributes=_proc_attributes;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public procedure_attributes_list(List _proc_attributes,SourceContext sc)
{
this._proc_attributes=_proc_attributes;
source_context = sc;
FillParentsInDirectChilds();
}
public procedure_attributes_list(procedure_attribute elem, SourceContext sc = null)
{
Add(elem, sc);
FillParentsInDirectChilds();
}
protected List _proc_attributes=new List();
///
///
///
public List proc_attributes
{
get
{
return _proc_attributes;
}
set
{
_proc_attributes=value;
}
}
public procedure_attributes_list Add(procedure_attribute elem, SourceContext sc = null)
{
proc_attributes.Add(elem);
if (elem != null)
elem.Parent = this;
if (sc != null)
source_context = sc;
return this;
}
public void AddFirst(procedure_attribute el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
proc_attributes.Insert(0, el);
FillParentsInDirectChilds();
}
public void AddFirst(IEnumerable els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
proc_attributes.InsertRange(0, els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
public void AddMany(params procedure_attribute[] els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
proc_attributes.AddRange(els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
private int FindIndexInList(procedure_attribute el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
var ind = proc_attributes.FindIndex(x => x == el);
if (ind == -1)
throw new Exception(string.Format("У списка {0} не найден элемент {1} среди дочерних\n", this, el));
return ind;
}
public void InsertAfter(procedure_attribute el, procedure_attribute newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
proc_attributes.Insert(FindIndexInList(el) + 1, newel);
newel.Parent = this;
}
public void InsertAfter(procedure_attribute el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
proc_attributes.InsertRange(FindIndexInList(el) + 1, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public void InsertBefore(procedure_attribute el, procedure_attribute newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
proc_attributes.Insert(FindIndexInList(el), newel);
newel.Parent = this;
}
public void InsertBefore(procedure_attribute el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
proc_attributes.InsertRange(FindIndexInList(el), newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public bool Remove(procedure_attribute el)
{
return proc_attributes.Remove(el);
}
public void ReplaceInList(procedure_attribute el, procedure_attribute newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
proc_attributes[FindIndexInList(el)] = newel;
newel.Parent = this;
}
public void ReplaceInList(procedure_attribute el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
var ind = FindIndexInList(el);
proc_attributes.RemoveAt(ind);
proc_attributes.InsertRange(ind, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public int RemoveAll(Predicate match)
{
return proc_attributes.RemoveAll(match);
}
public procedure_attribute Last()
{
if (proc_attributes.Count > 0)
return proc_attributes[proc_attributes.Count - 1];
throw new InvalidOperationException("Список пуст");
}
public int Count
{
get { return proc_attributes.Count; }
}
public void Insert(int pos, procedure_attribute el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
proc_attributes.Insert(pos,el);
if (el != null)
el.Parent = this;
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
procedure_attributes_list copy = new procedure_attributes_list();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (proc_attributes != null)
{
foreach (procedure_attribute elem in proc_attributes)
{
if (elem != null)
{
copy.Add((procedure_attribute)elem.Clone());
copy.Last().Parent = copy;
}
else
copy.Add(null);
}
}
return copy;
}
/// Получает копию данного узла корректного типа
public new procedure_attributes_list TypedClone()
{
return Clone() as procedure_attributes_list;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (proc_attributes != null)
{
foreach (var child in proc_attributes)
if (child != null)
child.Parent = this;
}
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
if (proc_attributes != null)
{
foreach (var child in proc_attributes)
child?.FillParentsInAllChilds();
}
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0 + (proc_attributes == null ? 0 : proc_attributes.Count);
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(proc_attributes != null)
{
if(index_counter < proc_attributes.Count)
{
return proc_attributes[index_counter];
}
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(proc_attributes != null)
{
if(index_counter < proc_attributes.Count)
{
proc_attributes[index_counter]= (procedure_attribute)value;
return;
}
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class procedure_header : type_definition
{
///
///Конструктор без параметров.
///
public procedure_header()
{
}
///
///Конструктор с параметрами.
///
public procedure_header(formal_parameters _parameters,procedure_attributes_list _proc_attributes,method_name _name,bool _of_object,bool _class_keyword,ident_list _template_args,where_definition_list _where_defs)
{
this._parameters=_parameters;
this._proc_attributes=_proc_attributes;
this._name=_name;
this._of_object=_of_object;
this._class_keyword=_class_keyword;
this._template_args=_template_args;
this._where_defs=_where_defs;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public procedure_header(formal_parameters _parameters,procedure_attributes_list _proc_attributes,method_name _name,bool _of_object,bool _class_keyword,ident_list _template_args,where_definition_list _where_defs,SourceContext sc)
{
this._parameters=_parameters;
this._proc_attributes=_proc_attributes;
this._name=_name;
this._of_object=_of_object;
this._class_keyword=_class_keyword;
this._template_args=_template_args;
this._where_defs=_where_defs;
source_context = sc;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public procedure_header(type_definition_attr_list _attr_list,formal_parameters _parameters,procedure_attributes_list _proc_attributes,method_name _name,bool _of_object,bool _class_keyword,ident_list _template_args,where_definition_list _where_defs)
{
this._attr_list=_attr_list;
this._parameters=_parameters;
this._proc_attributes=_proc_attributes;
this._name=_name;
this._of_object=_of_object;
this._class_keyword=_class_keyword;
this._template_args=_template_args;
this._where_defs=_where_defs;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public procedure_header(type_definition_attr_list _attr_list,formal_parameters _parameters,procedure_attributes_list _proc_attributes,method_name _name,bool _of_object,bool _class_keyword,ident_list _template_args,where_definition_list _where_defs,SourceContext sc)
{
this._attr_list=_attr_list;
this._parameters=_parameters;
this._proc_attributes=_proc_attributes;
this._name=_name;
this._of_object=_of_object;
this._class_keyword=_class_keyword;
this._template_args=_template_args;
this._where_defs=_where_defs;
source_context = sc;
FillParentsInDirectChilds();
}
protected formal_parameters _parameters;
protected procedure_attributes_list _proc_attributes;
protected method_name _name;
protected bool _of_object;
protected bool _class_keyword;
protected ident_list _template_args;
protected where_definition_list _where_defs;
///
///
///
public formal_parameters parameters
{
get
{
return _parameters;
}
set
{
_parameters=value;
}
}
///
///
///
public procedure_attributes_list proc_attributes
{
get
{
return _proc_attributes;
}
set
{
_proc_attributes=value;
}
}
///
///
///
public method_name name
{
get
{
return _name;
}
set
{
_name=value;
}
}
///
///
///
public bool of_object
{
get
{
return _of_object;
}
set
{
_of_object=value;
}
}
///
///class procedure...
///
public bool class_keyword
{
get
{
return _class_keyword;
}
set
{
_class_keyword=value;
}
}
///
///
///
public ident_list template_args
{
get
{
return _template_args;
}
set
{
_template_args=value;
}
}
///
///
///
public where_definition_list where_defs
{
get
{
return _where_defs;
}
set
{
_where_defs=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
procedure_header copy = new procedure_header();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (attr_list != null)
{
copy.attr_list = (type_definition_attr_list)attr_list.Clone();
copy.attr_list.Parent = copy;
}
if (parameters != null)
{
copy.parameters = (formal_parameters)parameters.Clone();
copy.parameters.Parent = copy;
}
if (proc_attributes != null)
{
copy.proc_attributes = (procedure_attributes_list)proc_attributes.Clone();
copy.proc_attributes.Parent = copy;
}
if (name != null)
{
copy.name = (method_name)name.Clone();
copy.name.Parent = copy;
}
copy.of_object = of_object;
copy.class_keyword = class_keyword;
if (template_args != null)
{
copy.template_args = (ident_list)template_args.Clone();
copy.template_args.Parent = copy;
}
if (where_defs != null)
{
copy.where_defs = (where_definition_list)where_defs.Clone();
copy.where_defs.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new procedure_header TypedClone()
{
return Clone() as procedure_header;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (attr_list != null)
attr_list.Parent = this;
if (parameters != null)
parameters.Parent = this;
if (proc_attributes != null)
proc_attributes.Parent = this;
if (name != null)
name.Parent = this;
if (template_args != null)
template_args.Parent = this;
if (where_defs != null)
where_defs.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
attr_list?.FillParentsInAllChilds();
parameters?.FillParentsInAllChilds();
proc_attributes?.FillParentsInAllChilds();
name?.FillParentsInAllChilds();
template_args?.FillParentsInAllChilds();
where_defs?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 6;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 6;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return attr_list;
case 1:
return parameters;
case 2:
return proc_attributes;
case 3:
return name;
case 4:
return template_args;
case 5:
return where_defs;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
attr_list = (type_definition_attr_list)value;
break;
case 1:
parameters = (formal_parameters)value;
break;
case 2:
proc_attributes = (procedure_attributes_list)value;
break;
case 3:
name = (method_name)value;
break;
case 4:
template_args = (ident_list)value;
break;
case 5:
where_defs = (where_definition_list)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class function_header : procedure_header
{
///
///Конструктор без параметров.
///
public function_header()
{
}
///
///Конструктор с параметрами.
///
public function_header(type_definition _return_type)
{
this._return_type=_return_type;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public function_header(type_definition _return_type,SourceContext sc)
{
this._return_type=_return_type;
source_context = sc;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public function_header(type_definition_attr_list _attr_list,formal_parameters _parameters,procedure_attributes_list _proc_attributes,method_name _name,bool _of_object,bool _class_keyword,ident_list _template_args,where_definition_list _where_defs,type_definition _return_type)
{
this._attr_list=_attr_list;
this._parameters=_parameters;
this._proc_attributes=_proc_attributes;
this._name=_name;
this._of_object=_of_object;
this._class_keyword=_class_keyword;
this._template_args=_template_args;
this._where_defs=_where_defs;
this._return_type=_return_type;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public function_header(type_definition_attr_list _attr_list,formal_parameters _parameters,procedure_attributes_list _proc_attributes,method_name _name,bool _of_object,bool _class_keyword,ident_list _template_args,where_definition_list _where_defs,type_definition _return_type,SourceContext sc)
{
this._attr_list=_attr_list;
this._parameters=_parameters;
this._proc_attributes=_proc_attributes;
this._name=_name;
this._of_object=_of_object;
this._class_keyword=_class_keyword;
this._template_args=_template_args;
this._where_defs=_where_defs;
this._return_type=_return_type;
source_context = sc;
FillParentsInDirectChilds();
}
protected type_definition _return_type;
///
///
///
public type_definition return_type
{
get
{
return _return_type;
}
set
{
_return_type=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
function_header copy = new function_header();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (attr_list != null)
{
copy.attr_list = (type_definition_attr_list)attr_list.Clone();
copy.attr_list.Parent = copy;
}
if (parameters != null)
{
copy.parameters = (formal_parameters)parameters.Clone();
copy.parameters.Parent = copy;
}
if (proc_attributes != null)
{
copy.proc_attributes = (procedure_attributes_list)proc_attributes.Clone();
copy.proc_attributes.Parent = copy;
}
if (name != null)
{
copy.name = (method_name)name.Clone();
copy.name.Parent = copy;
}
copy.of_object = of_object;
copy.class_keyword = class_keyword;
if (template_args != null)
{
copy.template_args = (ident_list)template_args.Clone();
copy.template_args.Parent = copy;
}
if (where_defs != null)
{
copy.where_defs = (where_definition_list)where_defs.Clone();
copy.where_defs.Parent = copy;
}
if (return_type != null)
{
copy.return_type = (type_definition)return_type.Clone();
copy.return_type.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new function_header TypedClone()
{
return Clone() as function_header;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (attr_list != null)
attr_list.Parent = this;
if (parameters != null)
parameters.Parent = this;
if (proc_attributes != null)
proc_attributes.Parent = this;
if (name != null)
name.Parent = this;
if (template_args != null)
template_args.Parent = this;
if (where_defs != null)
where_defs.Parent = this;
if (return_type != null)
return_type.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
attr_list?.FillParentsInAllChilds();
parameters?.FillParentsInAllChilds();
proc_attributes?.FillParentsInAllChilds();
name?.FillParentsInAllChilds();
template_args?.FillParentsInAllChilds();
where_defs?.FillParentsInAllChilds();
return_type?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 7;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 7;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return attr_list;
case 1:
return parameters;
case 2:
return proc_attributes;
case 3:
return name;
case 4:
return template_args;
case 5:
return where_defs;
case 6:
return return_type;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
attr_list = (type_definition_attr_list)value;
break;
case 1:
parameters = (formal_parameters)value;
break;
case 2:
proc_attributes = (procedure_attributes_list)value;
break;
case 3:
name = (method_name)value;
break;
case 4:
template_args = (ident_list)value;
break;
case 5:
where_defs = (where_definition_list)value;
break;
case 6:
return_type = (type_definition)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class procedure_definition : declaration
{
///
///Конструктор без параметров.
///
public procedure_definition()
{
}
///
///Конструктор с параметрами.
///
public procedure_definition(procedure_header _proc_header,proc_block _proc_body,bool _is_short_definition)
{
this._proc_header=_proc_header;
this._proc_body=_proc_body;
this._is_short_definition=_is_short_definition;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public procedure_definition(procedure_header _proc_header,proc_block _proc_body,bool _is_short_definition,SourceContext sc)
{
this._proc_header=_proc_header;
this._proc_body=_proc_body;
this._is_short_definition=_is_short_definition;
source_context = sc;
FillParentsInDirectChilds();
}
protected procedure_header _proc_header;
protected proc_block _proc_body;
protected bool _is_short_definition;
///
///
///
public procedure_header proc_header
{
get
{
return _proc_header;
}
set
{
_proc_header=value;
}
}
///
///
///
public proc_block proc_body
{
get
{
return _proc_body;
}
set
{
_proc_body=value;
}
}
///
///
///
public bool is_short_definition
{
get
{
return _is_short_definition;
}
set
{
_is_short_definition=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
procedure_definition copy = new procedure_definition();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (proc_header != null)
{
copy.proc_header = (procedure_header)proc_header.Clone();
copy.proc_header.Parent = copy;
}
if (proc_body != null)
{
copy.proc_body = (proc_block)proc_body.Clone();
copy.proc_body.Parent = copy;
}
copy.is_short_definition = is_short_definition;
return copy;
}
/// Получает копию данного узла корректного типа
public new procedure_definition TypedClone()
{
return Clone() as procedure_definition;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (proc_header != null)
proc_header.Parent = this;
if (proc_body != null)
proc_body.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
proc_header?.FillParentsInAllChilds();
proc_body?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return proc_header;
case 1:
return proc_body;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
proc_header = (procedure_header)value;
break;
case 1:
proc_body = (proc_block)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class type_declaration : declaration
{
///
///Конструктор без параметров.
///
public type_declaration()
{
}
///
///Конструктор с параметрами.
///
public type_declaration(ident _type_name,type_definition _type_def)
{
this._type_name=_type_name;
this._type_def=_type_def;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public type_declaration(ident _type_name,type_definition _type_def,SourceContext sc)
{
this._type_name=_type_name;
this._type_def=_type_def;
source_context = sc;
FillParentsInDirectChilds();
}
protected ident _type_name;
protected type_definition _type_def;
///
///
///
public ident type_name
{
get
{
return _type_name;
}
set
{
_type_name=value;
}
}
///
///
///
public type_definition type_def
{
get
{
return _type_def;
}
set
{
_type_def=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
type_declaration copy = new type_declaration();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (type_name != null)
{
copy.type_name = (ident)type_name.Clone();
copy.type_name.Parent = copy;
}
if (type_def != null)
{
copy.type_def = (type_definition)type_def.Clone();
copy.type_def.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new type_declaration TypedClone()
{
return Clone() as type_declaration;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (type_name != null)
type_name.Parent = this;
if (type_def != null)
type_def.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
type_name?.FillParentsInAllChilds();
type_def?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return type_name;
case 1:
return type_def;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
type_name = (ident)value;
break;
case 1:
type_def = (type_definition)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Список определений типов
///
[Serializable]
public partial class type_declarations : declaration
{
///
///Конструктор без параметров.
///
public type_declarations()
{
}
///
///Конструктор с параметрами.
///
public type_declarations(List _types_decl)
{
this._types_decl=_types_decl;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public type_declarations(List _types_decl,SourceContext sc)
{
this._types_decl=_types_decl;
source_context = sc;
FillParentsInDirectChilds();
}
public type_declarations(type_declaration elem, SourceContext sc = null)
{
Add(elem, sc);
FillParentsInDirectChilds();
}
protected List _types_decl=new List();
///
///
///
public List types_decl
{
get
{
return _types_decl;
}
set
{
_types_decl=value;
}
}
public type_declarations Add(type_declaration elem, SourceContext sc = null)
{
types_decl.Add(elem);
if (elem != null)
elem.Parent = this;
if (sc != null)
source_context = sc;
return this;
}
public void AddFirst(type_declaration el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
types_decl.Insert(0, el);
FillParentsInDirectChilds();
}
public void AddFirst(IEnumerable els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
types_decl.InsertRange(0, els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
public void AddMany(params type_declaration[] els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
types_decl.AddRange(els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
private int FindIndexInList(type_declaration el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
var ind = types_decl.FindIndex(x => x == el);
if (ind == -1)
throw new Exception(string.Format("У списка {0} не найден элемент {1} среди дочерних\n", this, el));
return ind;
}
public void InsertAfter(type_declaration el, type_declaration newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
types_decl.Insert(FindIndexInList(el) + 1, newel);
newel.Parent = this;
}
public void InsertAfter(type_declaration el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
types_decl.InsertRange(FindIndexInList(el) + 1, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public void InsertBefore(type_declaration el, type_declaration newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
types_decl.Insert(FindIndexInList(el), newel);
newel.Parent = this;
}
public void InsertBefore(type_declaration el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
types_decl.InsertRange(FindIndexInList(el), newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public bool Remove(type_declaration el)
{
return types_decl.Remove(el);
}
public void ReplaceInList(type_declaration el, type_declaration newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
types_decl[FindIndexInList(el)] = newel;
newel.Parent = this;
}
public void ReplaceInList(type_declaration el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
var ind = FindIndexInList(el);
types_decl.RemoveAt(ind);
types_decl.InsertRange(ind, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public int RemoveAll(Predicate match)
{
return types_decl.RemoveAll(match);
}
public type_declaration Last()
{
if (types_decl.Count > 0)
return types_decl[types_decl.Count - 1];
throw new InvalidOperationException("Список пуст");
}
public int Count
{
get { return types_decl.Count; }
}
public void Insert(int pos, type_declaration el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
types_decl.Insert(pos,el);
if (el != null)
el.Parent = this;
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
type_declarations copy = new type_declarations();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (types_decl != null)
{
foreach (type_declaration elem in types_decl)
{
if (elem != null)
{
copy.Add((type_declaration)elem.Clone());
copy.Last().Parent = copy;
}
else
copy.Add(null);
}
}
return copy;
}
/// Получает копию данного узла корректного типа
public new type_declarations TypedClone()
{
return Clone() as type_declarations;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (types_decl != null)
{
foreach (var child in types_decl)
if (child != null)
child.Parent = this;
}
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
if (types_decl != null)
{
foreach (var child in types_decl)
child?.FillParentsInAllChilds();
}
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0 + (types_decl == null ? 0 : types_decl.Count);
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(types_decl != null)
{
if(index_counter < types_decl.Count)
{
return types_decl[index_counter];
}
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(types_decl != null)
{
if(index_counter < types_decl.Count)
{
types_decl[index_counter]= (type_declaration)value;
return;
}
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class simple_const_definition : const_definition
{
///
///Конструктор без параметров.
///
public simple_const_definition()
{
}
///
///Конструктор с параметрами.
///
public simple_const_definition(ident _const_name,expression _const_value)
{
this._const_name=_const_name;
this._const_value=_const_value;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public simple_const_definition(ident _const_name,expression _const_value,SourceContext sc)
{
this._const_name=_const_name;
this._const_value=_const_value;
source_context = sc;
FillParentsInDirectChilds();
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
simple_const_definition copy = new simple_const_definition();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (const_name != null)
{
copy.const_name = (ident)const_name.Clone();
copy.const_name.Parent = copy;
}
if (const_value != null)
{
copy.const_value = (expression)const_value.Clone();
copy.const_value.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new simple_const_definition TypedClone()
{
return Clone() as simple_const_definition;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (const_name != null)
const_name.Parent = this;
if (const_value != null)
const_value.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
const_name?.FillParentsInAllChilds();
const_value?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return const_name;
case 1:
return const_value;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
const_name = (ident)value;
break;
case 1:
const_value = (expression)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class typed_const_definition : const_definition
{
///
///Конструктор без параметров.
///
public typed_const_definition()
{
}
///
///Конструктор с параметрами.
///
public typed_const_definition(type_definition _const_type)
{
this._const_type=_const_type;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public typed_const_definition(type_definition _const_type,SourceContext sc)
{
this._const_type=_const_type;
source_context = sc;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public typed_const_definition(ident _const_name,expression _const_value,type_definition _const_type)
{
this._const_name=_const_name;
this._const_value=_const_value;
this._const_type=_const_type;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public typed_const_definition(ident _const_name,expression _const_value,type_definition _const_type,SourceContext sc)
{
this._const_name=_const_name;
this._const_value=_const_value;
this._const_type=_const_type;
source_context = sc;
FillParentsInDirectChilds();
}
protected type_definition _const_type;
///
///
///
public type_definition const_type
{
get
{
return _const_type;
}
set
{
_const_type=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
typed_const_definition copy = new typed_const_definition();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (const_name != null)
{
copy.const_name = (ident)const_name.Clone();
copy.const_name.Parent = copy;
}
if (const_value != null)
{
copy.const_value = (expression)const_value.Clone();
copy.const_value.Parent = copy;
}
if (const_type != null)
{
copy.const_type = (type_definition)const_type.Clone();
copy.const_type.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new typed_const_definition TypedClone()
{
return Clone() as typed_const_definition;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (const_name != null)
const_name.Parent = this;
if (const_value != null)
const_value.Parent = this;
if (const_type != null)
const_type.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
const_name?.FillParentsInAllChilds();
const_value?.FillParentsInAllChilds();
const_type?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 3;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 3;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return const_name;
case 1:
return const_value;
case 2:
return const_type;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
const_name = (ident)value;
break;
case 1:
const_value = (expression)value;
break;
case 2:
const_type = (type_definition)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class const_definition : declaration
{
///
///Конструктор без параметров.
///
public const_definition()
{
}
///
///Конструктор с параметрами.
///
public const_definition(ident _const_name,expression _const_value)
{
this._const_name=_const_name;
this._const_value=_const_value;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public const_definition(ident _const_name,expression _const_value,SourceContext sc)
{
this._const_name=_const_name;
this._const_value=_const_value;
source_context = sc;
FillParentsInDirectChilds();
}
protected ident _const_name;
protected expression _const_value;
///
///
///
public ident const_name
{
get
{
return _const_name;
}
set
{
_const_name=value;
}
}
///
///
///
public expression const_value
{
get
{
return _const_value;
}
set
{
_const_value=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
const_definition copy = new const_definition();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (const_name != null)
{
copy.const_name = (ident)const_name.Clone();
copy.const_name.Parent = copy;
}
if (const_value != null)
{
copy.const_value = (expression)const_value.Clone();
copy.const_value.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new const_definition TypedClone()
{
return Clone() as const_definition;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (const_name != null)
const_name.Parent = this;
if (const_value != null)
const_value.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
const_name?.FillParentsInAllChilds();
const_value?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return const_name;
case 1:
return const_value;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
const_name = (ident)value;
break;
case 1:
const_value = (expression)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class consts_definitions_list : declaration
{
///
///Конструктор без параметров.
///
public consts_definitions_list()
{
}
///
///Конструктор с параметрами.
///
public consts_definitions_list(List _const_defs)
{
this._const_defs=_const_defs;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public consts_definitions_list(List _const_defs,SourceContext sc)
{
this._const_defs=_const_defs;
source_context = sc;
FillParentsInDirectChilds();
}
public consts_definitions_list(const_definition elem, SourceContext sc = null)
{
Add(elem, sc);
FillParentsInDirectChilds();
}
protected List _const_defs=new List();
///
///
///
public List const_defs
{
get
{
return _const_defs;
}
set
{
_const_defs=value;
}
}
public consts_definitions_list Add(const_definition elem, SourceContext sc = null)
{
const_defs.Add(elem);
if (elem != null)
elem.Parent = this;
if (sc != null)
source_context = sc;
return this;
}
public void AddFirst(const_definition el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
const_defs.Insert(0, el);
FillParentsInDirectChilds();
}
public void AddFirst(IEnumerable els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
const_defs.InsertRange(0, els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
public void AddMany(params const_definition[] els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
const_defs.AddRange(els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
private int FindIndexInList(const_definition el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
var ind = const_defs.FindIndex(x => x == el);
if (ind == -1)
throw new Exception(string.Format("У списка {0} не найден элемент {1} среди дочерних\n", this, el));
return ind;
}
public void InsertAfter(const_definition el, const_definition newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
const_defs.Insert(FindIndexInList(el) + 1, newel);
newel.Parent = this;
}
public void InsertAfter(const_definition el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
const_defs.InsertRange(FindIndexInList(el) + 1, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public void InsertBefore(const_definition el, const_definition newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
const_defs.Insert(FindIndexInList(el), newel);
newel.Parent = this;
}
public void InsertBefore(const_definition el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
const_defs.InsertRange(FindIndexInList(el), newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public bool Remove(const_definition el)
{
return const_defs.Remove(el);
}
public void ReplaceInList(const_definition el, const_definition newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
const_defs[FindIndexInList(el)] = newel;
newel.Parent = this;
}
public void ReplaceInList(const_definition el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
var ind = FindIndexInList(el);
const_defs.RemoveAt(ind);
const_defs.InsertRange(ind, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public int RemoveAll(Predicate match)
{
return const_defs.RemoveAll(match);
}
public const_definition Last()
{
if (const_defs.Count > 0)
return const_defs[const_defs.Count - 1];
throw new InvalidOperationException("Список пуст");
}
public int Count
{
get { return const_defs.Count; }
}
public void Insert(int pos, const_definition el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
const_defs.Insert(pos,el);
if (el != null)
el.Parent = this;
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
consts_definitions_list copy = new consts_definitions_list();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (const_defs != null)
{
foreach (const_definition elem in const_defs)
{
if (elem != null)
{
copy.Add((const_definition)elem.Clone());
copy.Last().Parent = copy;
}
else
copy.Add(null);
}
}
return copy;
}
/// Получает копию данного узла корректного типа
public new consts_definitions_list TypedClone()
{
return Clone() as consts_definitions_list;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (const_defs != null)
{
foreach (var child in const_defs)
if (child != null)
child.Parent = this;
}
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
if (const_defs != null)
{
foreach (var child in const_defs)
child?.FillParentsInAllChilds();
}
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0 + (const_defs == null ? 0 : const_defs.Count);
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(const_defs != null)
{
if(index_counter < const_defs.Count)
{
return const_defs[index_counter];
}
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(const_defs != null)
{
if(index_counter < const_defs.Count)
{
const_defs[index_counter]= (const_definition)value;
return;
}
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class unit_name : syntax_tree_node
{
///
///Конструктор без параметров.
///
public unit_name()
{
}
///
///Конструктор с параметрами.
///
public unit_name(ident _idunit_name,UnitHeaderKeyword _HeaderKeyword)
{
this._idunit_name=_idunit_name;
this._HeaderKeyword=_HeaderKeyword;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public unit_name(ident _idunit_name,UnitHeaderKeyword _HeaderKeyword,SourceContext sc)
{
this._idunit_name=_idunit_name;
this._HeaderKeyword=_HeaderKeyword;
source_context = sc;
FillParentsInDirectChilds();
}
protected ident _idunit_name;
protected UnitHeaderKeyword _HeaderKeyword;
///
///
///
public ident idunit_name
{
get
{
return _idunit_name;
}
set
{
_idunit_name=value;
}
}
///
///
///
public UnitHeaderKeyword HeaderKeyword
{
get
{
return _HeaderKeyword;
}
set
{
_HeaderKeyword=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
unit_name copy = new unit_name();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (idunit_name != null)
{
copy.idunit_name = (ident)idunit_name.Clone();
copy.idunit_name.Parent = copy;
}
copy.HeaderKeyword = HeaderKeyword;
return copy;
}
/// Получает копию данного узла корректного типа
public new unit_name TypedClone()
{
return Clone() as unit_name;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (idunit_name != null)
idunit_name.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
idunit_name?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 1;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 1;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return idunit_name;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
idunit_name = (ident)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class unit_or_namespace : syntax_tree_node
{
///
///Конструктор без параметров.
///
public unit_or_namespace()
{
}
///
///Конструктор с параметрами.
///
public unit_or_namespace(ident_list _name)
{
this._name=_name;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public unit_or_namespace(ident_list _name,SourceContext sc)
{
this._name=_name;
source_context = sc;
FillParentsInDirectChilds();
}
protected ident_list _name;
///
///
///
public ident_list name
{
get
{
return _name;
}
set
{
_name=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
unit_or_namespace copy = new unit_or_namespace();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (name != null)
{
copy.name = (ident_list)name.Clone();
copy.name.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new unit_or_namespace TypedClone()
{
return Clone() as unit_or_namespace;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (name != null)
name.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
name?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 1;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 1;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return name;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
name = (ident_list)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class uses_unit_in : unit_or_namespace
{
///
///Конструктор без параметров.
///
public uses_unit_in()
{
}
///
///Конструктор с параметрами.
///
public uses_unit_in(string_const _in_file)
{
this._in_file=_in_file;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public uses_unit_in(string_const _in_file,SourceContext sc)
{
this._in_file=_in_file;
source_context = sc;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public uses_unit_in(ident_list _name,string_const _in_file)
{
this._name=_name;
this._in_file=_in_file;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public uses_unit_in(ident_list _name,string_const _in_file,SourceContext sc)
{
this._name=_name;
this._in_file=_in_file;
source_context = sc;
FillParentsInDirectChilds();
}
protected string_const _in_file;
///
///
///
public string_const in_file
{
get
{
return _in_file;
}
set
{
_in_file=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
uses_unit_in copy = new uses_unit_in();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (name != null)
{
copy.name = (ident_list)name.Clone();
copy.name.Parent = copy;
}
if (in_file != null)
{
copy.in_file = (string_const)in_file.Clone();
copy.in_file.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new uses_unit_in TypedClone()
{
return Clone() as uses_unit_in;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (name != null)
name.Parent = this;
if (in_file != null)
in_file.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
name?.FillParentsInAllChilds();
in_file?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return name;
case 1:
return in_file;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
name = (ident_list)value;
break;
case 1:
in_file = (string_const)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class uses_list : syntax_tree_node
{
///
///Конструктор без параметров.
///
public uses_list()
{
}
///
///Конструктор с параметрами.
///
public uses_list(List _units)
{
this._units=_units;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public uses_list(List _units,SourceContext sc)
{
this._units=_units;
source_context = sc;
FillParentsInDirectChilds();
}
public uses_list(unit_or_namespace elem, SourceContext sc = null)
{
Add(elem, sc);
FillParentsInDirectChilds();
}
protected List _units=new List();
///
///
///
public List units
{
get
{
return _units;
}
set
{
_units=value;
}
}
public uses_list Add(unit_or_namespace elem, SourceContext sc = null)
{
units.Add(elem);
if (elem != null)
elem.Parent = this;
if (sc != null)
source_context = sc;
return this;
}
public void AddFirst(unit_or_namespace el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
units.Insert(0, el);
FillParentsInDirectChilds();
}
public void AddFirst(IEnumerable els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
units.InsertRange(0, els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
public void AddMany(params unit_or_namespace[] els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
units.AddRange(els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
private int FindIndexInList(unit_or_namespace el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
var ind = units.FindIndex(x => x == el);
if (ind == -1)
throw new Exception(string.Format("У списка {0} не найден элемент {1} среди дочерних\n", this, el));
return ind;
}
public void InsertAfter(unit_or_namespace el, unit_or_namespace newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
units.Insert(FindIndexInList(el) + 1, newel);
newel.Parent = this;
}
public void InsertAfter(unit_or_namespace el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
units.InsertRange(FindIndexInList(el) + 1, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public void InsertBefore(unit_or_namespace el, unit_or_namespace newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
units.Insert(FindIndexInList(el), newel);
newel.Parent = this;
}
public void InsertBefore(unit_or_namespace el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
units.InsertRange(FindIndexInList(el), newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public bool Remove(unit_or_namespace el)
{
return units.Remove(el);
}
public void ReplaceInList(unit_or_namespace el, unit_or_namespace newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
units[FindIndexInList(el)] = newel;
newel.Parent = this;
}
public void ReplaceInList(unit_or_namespace el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
var ind = FindIndexInList(el);
units.RemoveAt(ind);
units.InsertRange(ind, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public int RemoveAll(Predicate match)
{
return units.RemoveAll(match);
}
public unit_or_namespace Last()
{
if (units.Count > 0)
return units[units.Count - 1];
throw new InvalidOperationException("Список пуст");
}
public int Count
{
get { return units.Count; }
}
public void Insert(int pos, unit_or_namespace el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
units.Insert(pos,el);
if (el != null)
el.Parent = this;
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
uses_list copy = new uses_list();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (units != null)
{
foreach (unit_or_namespace elem in units)
{
if (elem != null)
{
copy.Add((unit_or_namespace)elem.Clone());
copy.Last().Parent = copy;
}
else
copy.Add(null);
}
}
return copy;
}
/// Получает копию данного узла корректного типа
public new uses_list TypedClone()
{
return Clone() as uses_list;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (units != null)
{
foreach (var child in units)
if (child != null)
child.Parent = this;
}
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
if (units != null)
{
foreach (var child in units)
child?.FillParentsInAllChilds();
}
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0 + (units == null ? 0 : units.Count);
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(units != null)
{
if(index_counter < units.Count)
{
return units[index_counter];
}
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(units != null)
{
if(index_counter < units.Count)
{
units[index_counter]= (unit_or_namespace)value;
return;
}
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class program_body : syntax_tree_node
{
///
///Конструктор без параметров.
///
public program_body()
{
}
///
///Конструктор с параметрами.
///
public program_body(uses_list _used_units,declarations _program_definitions,statement_list _program_code,using_list _using_list)
{
this._used_units=_used_units;
this._program_definitions=_program_definitions;
this._program_code=_program_code;
this._using_list=_using_list;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public program_body(uses_list _used_units,declarations _program_definitions,statement_list _program_code,using_list _using_list,SourceContext sc)
{
this._used_units=_used_units;
this._program_definitions=_program_definitions;
this._program_code=_program_code;
this._using_list=_using_list;
source_context = sc;
FillParentsInDirectChilds();
}
protected uses_list _used_units;
protected declarations _program_definitions;
protected statement_list _program_code;
protected using_list _using_list;
///
///
///
public uses_list used_units
{
get
{
return _used_units;
}
set
{
_used_units=value;
}
}
///
///
///
public declarations program_definitions
{
get
{
return _program_definitions;
}
set
{
_program_definitions=value;
}
}
///
///
///
public statement_list program_code
{
get
{
return _program_code;
}
set
{
_program_code=value;
}
}
///
///
///
public using_list using_list
{
get
{
return _using_list;
}
set
{
_using_list=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
program_body copy = new program_body();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (used_units != null)
{
copy.used_units = (uses_list)used_units.Clone();
copy.used_units.Parent = copy;
}
if (program_definitions != null)
{
copy.program_definitions = (declarations)program_definitions.Clone();
copy.program_definitions.Parent = copy;
}
if (program_code != null)
{
copy.program_code = (statement_list)program_code.Clone();
copy.program_code.Parent = copy;
}
if (using_list != null)
{
copy.using_list = (using_list)using_list.Clone();
copy.using_list.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new program_body TypedClone()
{
return Clone() as program_body;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (used_units != null)
used_units.Parent = this;
if (program_definitions != null)
program_definitions.Parent = this;
if (program_code != null)
program_code.Parent = this;
if (using_list != null)
using_list.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
used_units?.FillParentsInAllChilds();
program_definitions?.FillParentsInAllChilds();
program_code?.FillParentsInAllChilds();
using_list?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 4;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 4;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return used_units;
case 1:
return program_definitions;
case 2:
return program_code;
case 3:
return using_list;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
used_units = (uses_list)value;
break;
case 1:
program_definitions = (declarations)value;
break;
case 2:
program_code = (statement_list)value;
break;
case 3:
using_list = (using_list)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class compilation_unit : syntax_tree_node
{
///
///Конструктор без параметров.
///
public compilation_unit()
{
}
///
///Конструктор с параметрами.
///
public compilation_unit(string _file_name,List _compiler_directives,LanguageId _Language)
{
this._file_name=_file_name;
this._compiler_directives=_compiler_directives;
this._Language=_Language;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public compilation_unit(string _file_name,List _compiler_directives,LanguageId _Language,SourceContext sc)
{
this._file_name=_file_name;
this._compiler_directives=_compiler_directives;
this._Language=_Language;
source_context = sc;
FillParentsInDirectChilds();
}
public compilation_unit(compiler_directive elem, SourceContext sc = null)
{
Add(elem, sc);
FillParentsInDirectChilds();
}
protected string _file_name;
protected List _compiler_directives=new List();
protected LanguageId _Language;
///
///
///
public string file_name
{
get
{
return _file_name;
}
set
{
_file_name=value;
}
}
///
///
///
public List compiler_directives
{
get
{
return _compiler_directives;
}
set
{
_compiler_directives=value;
}
}
///
///
///
public LanguageId Language
{
get
{
return _Language;
}
set
{
_Language=value;
}
}
public compilation_unit Add(compiler_directive elem, SourceContext sc = null)
{
compiler_directives.Add(elem);
if (elem != null)
elem.Parent = this;
if (sc != null)
source_context = sc;
return this;
}
public void AddFirst(compiler_directive el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
compiler_directives.Insert(0, el);
FillParentsInDirectChilds();
}
public void AddFirst(IEnumerable els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
compiler_directives.InsertRange(0, els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
public void AddMany(params compiler_directive[] els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
compiler_directives.AddRange(els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
private int FindIndexInList(compiler_directive el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
var ind = compiler_directives.FindIndex(x => x == el);
if (ind == -1)
throw new Exception(string.Format("У списка {0} не найден элемент {1} среди дочерних\n", this, el));
return ind;
}
public void InsertAfter(compiler_directive el, compiler_directive newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
compiler_directives.Insert(FindIndexInList(el) + 1, newel);
newel.Parent = this;
}
public void InsertAfter(compiler_directive el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
compiler_directives.InsertRange(FindIndexInList(el) + 1, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public void InsertBefore(compiler_directive el, compiler_directive newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
compiler_directives.Insert(FindIndexInList(el), newel);
newel.Parent = this;
}
public void InsertBefore(compiler_directive el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
compiler_directives.InsertRange(FindIndexInList(el), newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public bool Remove(compiler_directive el)
{
return compiler_directives.Remove(el);
}
public void ReplaceInList(compiler_directive el, compiler_directive newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
compiler_directives[FindIndexInList(el)] = newel;
newel.Parent = this;
}
public void ReplaceInList(compiler_directive el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
var ind = FindIndexInList(el);
compiler_directives.RemoveAt(ind);
compiler_directives.InsertRange(ind, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public int RemoveAll(Predicate match)
{
return compiler_directives.RemoveAll(match);
}
public compiler_directive Last()
{
if (compiler_directives.Count > 0)
return compiler_directives[compiler_directives.Count - 1];
throw new InvalidOperationException("Список пуст");
}
public int Count
{
get { return compiler_directives.Count; }
}
public void Insert(int pos, compiler_directive el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
compiler_directives.Insert(pos,el);
if (el != null)
el.Parent = this;
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
compilation_unit copy = new compilation_unit();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
copy.file_name = file_name;
if (compiler_directives != null)
{
foreach (compiler_directive elem in compiler_directives)
{
if (elem != null)
{
copy.Add((compiler_directive)elem.Clone());
copy.Last().Parent = copy;
}
else
copy.Add(null);
}
}
copy.Language = Language;
return copy;
}
/// Получает копию данного узла корректного типа
public new compilation_unit TypedClone()
{
return Clone() as compilation_unit;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (compiler_directives != null)
{
foreach (var child in compiler_directives)
if (child != null)
child.Parent = this;
}
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
if (compiler_directives != null)
{
foreach (var child in compiler_directives)
child?.FillParentsInAllChilds();
}
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0 + (compiler_directives == null ? 0 : compiler_directives.Count);
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(compiler_directives != null)
{
if(index_counter < compiler_directives.Count)
{
return compiler_directives[index_counter];
}
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(compiler_directives != null)
{
if(index_counter < compiler_directives.Count)
{
compiler_directives[index_counter]= (compiler_directive)value;
return;
}
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class unit_module : compilation_unit
{
///
///Конструктор без параметров.
///
public unit_module()
{
}
///
///Конструктор с параметрами.
///
public unit_module(unit_name _unit_name,interface_node _interface_part,implementation_node _implementation_part,statement_list _initialization_part,statement_list _finalization_part,attribute_list _attributes)
{
this._unit_name=_unit_name;
this._interface_part=_interface_part;
this._implementation_part=_implementation_part;
this._initialization_part=_initialization_part;
this._finalization_part=_finalization_part;
this._attributes=_attributes;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public unit_module(unit_name _unit_name,interface_node _interface_part,implementation_node _implementation_part,statement_list _initialization_part,statement_list _finalization_part,attribute_list _attributes,SourceContext sc)
{
this._unit_name=_unit_name;
this._interface_part=_interface_part;
this._implementation_part=_implementation_part;
this._initialization_part=_initialization_part;
this._finalization_part=_finalization_part;
this._attributes=_attributes;
source_context = sc;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public unit_module(string _file_name,List _compiler_directives,LanguageId _Language,unit_name _unit_name,interface_node _interface_part,implementation_node _implementation_part,statement_list _initialization_part,statement_list _finalization_part,attribute_list _attributes)
{
this._file_name=_file_name;
this._compiler_directives=_compiler_directives;
this._Language=_Language;
this._unit_name=_unit_name;
this._interface_part=_interface_part;
this._implementation_part=_implementation_part;
this._initialization_part=_initialization_part;
this._finalization_part=_finalization_part;
this._attributes=_attributes;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public unit_module(string _file_name,List _compiler_directives,LanguageId _Language,unit_name _unit_name,interface_node _interface_part,implementation_node _implementation_part,statement_list _initialization_part,statement_list _finalization_part,attribute_list _attributes,SourceContext sc)
{
this._file_name=_file_name;
this._compiler_directives=_compiler_directives;
this._Language=_Language;
this._unit_name=_unit_name;
this._interface_part=_interface_part;
this._implementation_part=_implementation_part;
this._initialization_part=_initialization_part;
this._finalization_part=_finalization_part;
this._attributes=_attributes;
source_context = sc;
FillParentsInDirectChilds();
}
protected unit_name _unit_name;
protected interface_node _interface_part;
protected implementation_node _implementation_part;
protected statement_list _initialization_part;
protected statement_list _finalization_part;
protected attribute_list _attributes;
///
///
///
public unit_name unit_name
{
get
{
return _unit_name;
}
set
{
_unit_name=value;
}
}
///
///
///
public interface_node interface_part
{
get
{
return _interface_part;
}
set
{
_interface_part=value;
}
}
///
///
///
public implementation_node implementation_part
{
get
{
return _implementation_part;
}
set
{
_implementation_part=value;
}
}
///
///
///
public statement_list initialization_part
{
get
{
return _initialization_part;
}
set
{
_initialization_part=value;
}
}
///
///
///
public statement_list finalization_part
{
get
{
return _finalization_part;
}
set
{
_finalization_part=value;
}
}
///
///
///
public attribute_list attributes
{
get
{
return _attributes;
}
set
{
_attributes=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
unit_module copy = new unit_module();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
copy.file_name = file_name;
if (compiler_directives != null)
{
foreach (compiler_directive elem in compiler_directives)
{
if (elem != null)
{
copy.Add((compiler_directive)elem.Clone());
copy.Last().Parent = copy;
}
else
copy.Add(null);
}
}
copy.Language = Language;
if (unit_name != null)
{
copy.unit_name = (unit_name)unit_name.Clone();
copy.unit_name.Parent = copy;
}
if (interface_part != null)
{
copy.interface_part = (interface_node)interface_part.Clone();
copy.interface_part.Parent = copy;
}
if (implementation_part != null)
{
copy.implementation_part = (implementation_node)implementation_part.Clone();
copy.implementation_part.Parent = copy;
}
if (initialization_part != null)
{
copy.initialization_part = (statement_list)initialization_part.Clone();
copy.initialization_part.Parent = copy;
}
if (finalization_part != null)
{
copy.finalization_part = (statement_list)finalization_part.Clone();
copy.finalization_part.Parent = copy;
}
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new unit_module TypedClone()
{
return Clone() as unit_module;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (compiler_directives != null)
{
foreach (var child in compiler_directives)
if (child != null)
child.Parent = this;
}
if (unit_name != null)
unit_name.Parent = this;
if (interface_part != null)
interface_part.Parent = this;
if (implementation_part != null)
implementation_part.Parent = this;
if (initialization_part != null)
initialization_part.Parent = this;
if (finalization_part != null)
finalization_part.Parent = this;
if (attributes != null)
attributes.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
if (compiler_directives != null)
{
foreach (var child in compiler_directives)
child?.FillParentsInAllChilds();
}
unit_name?.FillParentsInAllChilds();
interface_part?.FillParentsInAllChilds();
implementation_part?.FillParentsInAllChilds();
initialization_part?.FillParentsInAllChilds();
finalization_part?.FillParentsInAllChilds();
attributes?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 6;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 6 + (compiler_directives == null ? 0 : compiler_directives.Count);
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return unit_name;
case 1:
return interface_part;
case 2:
return implementation_part;
case 3:
return initialization_part;
case 4:
return finalization_part;
case 5:
return attributes;
}
Int32 index_counter=ind - 6;
if(compiler_directives != null)
{
if(index_counter < compiler_directives.Count)
{
return compiler_directives[index_counter];
}
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
unit_name = (unit_name)value;
break;
case 1:
interface_part = (interface_node)value;
break;
case 2:
implementation_part = (implementation_node)value;
break;
case 3:
initialization_part = (statement_list)value;
break;
case 4:
finalization_part = (statement_list)value;
break;
case 5:
attributes = (attribute_list)value;
break;
}
Int32 index_counter=ind - 6;
if(compiler_directives != null)
{
if(index_counter < compiler_directives.Count)
{
compiler_directives[index_counter]= (compiler_directive)value;
return;
}
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class program_module : compilation_unit
{
///
///Конструктор без параметров.
///
public program_module()
{
}
///
///Конструктор с параметрами.
///
public program_module(program_name _program_name,uses_list _used_units,block _program_block,using_list _using_namespaces)
{
this._program_name=_program_name;
this._used_units=_used_units;
this._program_block=_program_block;
this._using_namespaces=_using_namespaces;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public program_module(program_name _program_name,uses_list _used_units,block _program_block,using_list _using_namespaces,SourceContext sc)
{
this._program_name=_program_name;
this._used_units=_used_units;
this._program_block=_program_block;
this._using_namespaces=_using_namespaces;
source_context = sc;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public program_module(string _file_name,List _compiler_directives,LanguageId _Language,program_name _program_name,uses_list _used_units,block _program_block,using_list _using_namespaces)
{
this._file_name=_file_name;
this._compiler_directives=_compiler_directives;
this._Language=_Language;
this._program_name=_program_name;
this._used_units=_used_units;
this._program_block=_program_block;
this._using_namespaces=_using_namespaces;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public program_module(string _file_name,List _compiler_directives,LanguageId _Language,program_name _program_name,uses_list _used_units,block _program_block,using_list _using_namespaces,SourceContext sc)
{
this._file_name=_file_name;
this._compiler_directives=_compiler_directives;
this._Language=_Language;
this._program_name=_program_name;
this._used_units=_used_units;
this._program_block=_program_block;
this._using_namespaces=_using_namespaces;
source_context = sc;
FillParentsInDirectChilds();
}
protected program_name _program_name;
protected uses_list _used_units;
protected block _program_block;
protected using_list _using_namespaces;
///
///
///
public program_name program_name
{
get
{
return _program_name;
}
set
{
_program_name=value;
}
}
///
///
///
public uses_list used_units
{
get
{
return _used_units;
}
set
{
_used_units=value;
}
}
///
///
///
public block program_block
{
get
{
return _program_block;
}
set
{
_program_block=value;
}
}
///
///
///
public using_list using_namespaces
{
get
{
return _using_namespaces;
}
set
{
_using_namespaces=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
program_module copy = new program_module();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
copy.file_name = file_name;
if (compiler_directives != null)
{
foreach (compiler_directive elem in compiler_directives)
{
if (elem != null)
{
copy.Add((compiler_directive)elem.Clone());
copy.Last().Parent = copy;
}
else
copy.Add(null);
}
}
copy.Language = Language;
if (program_name != null)
{
copy.program_name = (program_name)program_name.Clone();
copy.program_name.Parent = copy;
}
if (used_units != null)
{
copy.used_units = (uses_list)used_units.Clone();
copy.used_units.Parent = copy;
}
if (program_block != null)
{
copy.program_block = (block)program_block.Clone();
copy.program_block.Parent = copy;
}
if (using_namespaces != null)
{
copy.using_namespaces = (using_list)using_namespaces.Clone();
copy.using_namespaces.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new program_module TypedClone()
{
return Clone() as program_module;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (compiler_directives != null)
{
foreach (var child in compiler_directives)
if (child != null)
child.Parent = this;
}
if (program_name != null)
program_name.Parent = this;
if (used_units != null)
used_units.Parent = this;
if (program_block != null)
program_block.Parent = this;
if (using_namespaces != null)
using_namespaces.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
if (compiler_directives != null)
{
foreach (var child in compiler_directives)
child?.FillParentsInAllChilds();
}
program_name?.FillParentsInAllChilds();
used_units?.FillParentsInAllChilds();
program_block?.FillParentsInAllChilds();
using_namespaces?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 4;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 4 + (compiler_directives == null ? 0 : compiler_directives.Count);
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return program_name;
case 1:
return used_units;
case 2:
return program_block;
case 3:
return using_namespaces;
}
Int32 index_counter=ind - 4;
if(compiler_directives != null)
{
if(index_counter < compiler_directives.Count)
{
return compiler_directives[index_counter];
}
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
program_name = (program_name)value;
break;
case 1:
used_units = (uses_list)value;
break;
case 2:
program_block = (block)value;
break;
case 3:
using_namespaces = (using_list)value;
break;
}
Int32 index_counter=ind - 4;
if(compiler_directives != null)
{
if(index_counter < compiler_directives.Count)
{
compiler_directives[index_counter]= (compiler_directive)value;
return;
}
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class hex_constant : int64_const
{
///
///Конструктор без параметров.
///
public hex_constant()
{
}
///
///Конструктор с параметрами.
///
public hex_constant(Int64 _val)
{
this._val=_val;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public hex_constant(Int64 _val,SourceContext sc)
{
this._val=_val;
source_context = sc;
FillParentsInDirectChilds();
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
hex_constant copy = new hex_constant();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
copy.val = val;
return copy;
}
/// Получает копию данного узла корректного типа
public new hex_constant TypedClone()
{
return Clone() as hex_constant;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class get_address : addressed_value_funcname
{
///
///Конструктор без параметров.
///
public get_address()
{
}
///
///Конструктор с параметрами.
///
public get_address(addressed_value _address_of)
{
this._address_of=_address_of;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public get_address(addressed_value _address_of,SourceContext sc)
{
this._address_of=_address_of;
source_context = sc;
FillParentsInDirectChilds();
}
protected addressed_value _address_of;
///
///
///
public addressed_value address_of
{
get
{
return _address_of;
}
set
{
_address_of=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
get_address copy = new get_address();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (address_of != null)
{
copy.address_of = (addressed_value)address_of.Clone();
copy.address_of.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new get_address TypedClone()
{
return Clone() as get_address;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (address_of != null)
address_of.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
address_of?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 1;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 1;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return address_of;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
address_of = (addressed_value)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class case_variant : statement
{
///
///Конструктор без параметров.
///
public case_variant()
{
}
///
///Конструктор с параметрами.
///
public case_variant(expression_list _conditions,statement _exec_if_true)
{
this._conditions=_conditions;
this._exec_if_true=_exec_if_true;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public case_variant(expression_list _conditions,statement _exec_if_true,SourceContext sc)
{
this._conditions=_conditions;
this._exec_if_true=_exec_if_true;
source_context = sc;
FillParentsInDirectChilds();
}
protected expression_list _conditions;
protected statement _exec_if_true;
///
///
///
public expression_list conditions
{
get
{
return _conditions;
}
set
{
_conditions=value;
}
}
///
///
///
public statement exec_if_true
{
get
{
return _exec_if_true;
}
set
{
_exec_if_true=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
case_variant copy = new case_variant();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (conditions != null)
{
copy.conditions = (expression_list)conditions.Clone();
copy.conditions.Parent = copy;
}
if (exec_if_true != null)
{
copy.exec_if_true = (statement)exec_if_true.Clone();
copy.exec_if_true.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new case_variant TypedClone()
{
return Clone() as case_variant;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (conditions != null)
conditions.Parent = this;
if (exec_if_true != null)
exec_if_true.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
conditions?.FillParentsInAllChilds();
exec_if_true?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return conditions;
case 1:
return exec_if_true;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
conditions = (expression_list)value;
break;
case 1:
exec_if_true = (statement)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class case_node : statement
{
///
///Конструктор без параметров.
///
public case_node()
{
}
///
///Конструктор с параметрами.
///
public case_node(expression _param,case_variants _conditions,statement _else_statement)
{
this._param=_param;
this._conditions=_conditions;
this._else_statement=_else_statement;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public case_node(expression _param,case_variants _conditions,statement _else_statement,SourceContext sc)
{
this._param=_param;
this._conditions=_conditions;
this._else_statement=_else_statement;
source_context = sc;
FillParentsInDirectChilds();
}
protected expression _param;
protected case_variants _conditions;
protected statement _else_statement;
///
///
///
public expression param
{
get
{
return _param;
}
set
{
_param=value;
}
}
///
///
///
public case_variants conditions
{
get
{
return _conditions;
}
set
{
_conditions=value;
}
}
///
///
///
public statement else_statement
{
get
{
return _else_statement;
}
set
{
_else_statement=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
case_node copy = new case_node();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (param != null)
{
copy.param = (expression)param.Clone();
copy.param.Parent = copy;
}
if (conditions != null)
{
copy.conditions = (case_variants)conditions.Clone();
copy.conditions.Parent = copy;
}
if (else_statement != null)
{
copy.else_statement = (statement)else_statement.Clone();
copy.else_statement.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new case_node TypedClone()
{
return Clone() as case_node;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (param != null)
param.Parent = this;
if (conditions != null)
conditions.Parent = this;
if (else_statement != null)
else_statement.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
param?.FillParentsInAllChilds();
conditions?.FillParentsInAllChilds();
else_statement?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 3;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 3;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return param;
case 1:
return conditions;
case 2:
return else_statement;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
param = (expression)value;
break;
case 1:
conditions = (case_variants)value;
break;
case 2:
else_statement = (statement)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class method_name : syntax_tree_node
{
///
///Конструктор без параметров.
///
public method_name()
{
}
///
///Конструктор с параметрами.
///
public method_name(List _ln,ident _class_name,ident _meth_name,ident _explicit_interface_name)
{
this._ln=_ln;
this._class_name=_class_name;
this._meth_name=_meth_name;
this._explicit_interface_name=_explicit_interface_name;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public method_name(List _ln,ident _class_name,ident _meth_name,ident _explicit_interface_name,SourceContext sc)
{
this._ln=_ln;
this._class_name=_class_name;
this._meth_name=_meth_name;
this._explicit_interface_name=_explicit_interface_name;
source_context = sc;
FillParentsInDirectChilds();
}
public method_name(ident elem, SourceContext sc = null)
{
Add(elem, sc);
FillParentsInDirectChilds();
}
protected List _ln;
protected ident _class_name;
protected ident _meth_name;
protected ident _explicit_interface_name;
///
///
///
public List ln
{
get
{
return _ln;
}
set
{
_ln=value;
}
}
///
///
///
public ident class_name
{
get
{
return _class_name;
}
set
{
_class_name=value;
}
}
///
///
///
public ident meth_name
{
get
{
return _meth_name;
}
set
{
_meth_name=value;
}
}
///
///
///
public ident explicit_interface_name
{
get
{
return _explicit_interface_name;
}
set
{
_explicit_interface_name=value;
}
}
public method_name Add(ident elem, SourceContext sc = null)
{
ln.Add(elem);
if (elem != null)
elem.Parent = this;
if (sc != null)
source_context = sc;
return this;
}
public void AddFirst(ident el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
ln.Insert(0, el);
FillParentsInDirectChilds();
}
public void AddFirst(IEnumerable els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
ln.InsertRange(0, els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
public void AddMany(params ident[] els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
ln.AddRange(els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
private int FindIndexInList(ident el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
var ind = ln.FindIndex(x => x == el);
if (ind == -1)
throw new Exception(string.Format("У списка {0} не найден элемент {1} среди дочерних\n", this, el));
return ind;
}
public void InsertAfter(ident el, ident newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
ln.Insert(FindIndexInList(el) + 1, newel);
newel.Parent = this;
}
public void InsertAfter(ident el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
ln.InsertRange(FindIndexInList(el) + 1, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public void InsertBefore(ident el, ident newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
ln.Insert(FindIndexInList(el), newel);
newel.Parent = this;
}
public void InsertBefore(ident el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
ln.InsertRange(FindIndexInList(el), newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public bool Remove(ident el)
{
return ln.Remove(el);
}
public void ReplaceInList(ident el, ident newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
ln[FindIndexInList(el)] = newel;
newel.Parent = this;
}
public void ReplaceInList(ident el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
var ind = FindIndexInList(el);
ln.RemoveAt(ind);
ln.InsertRange(ind, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public int RemoveAll(Predicate match)
{
return ln.RemoveAll(match);
}
public ident Last()
{
if (ln.Count > 0)
return ln[ln.Count - 1];
throw new InvalidOperationException("Список пуст");
}
public int Count
{
get { return ln.Count; }
}
public void Insert(int pos, ident el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
ln.Insert(pos,el);
if (el != null)
el.Parent = this;
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
method_name copy = new method_name();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (ln != null)
{
foreach (ident elem in ln)
{
if (elem != null)
{
copy.Add((ident)elem.Clone());
copy.Last().Parent = copy;
}
else
copy.Add(null);
}
}
if (class_name != null)
{
copy.class_name = (ident)class_name.Clone();
copy.class_name.Parent = copy;
}
if (meth_name != null)
{
copy.meth_name = (ident)meth_name.Clone();
copy.meth_name.Parent = copy;
}
if (explicit_interface_name != null)
{
copy.explicit_interface_name = (ident)explicit_interface_name.Clone();
copy.explicit_interface_name.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new method_name TypedClone()
{
return Clone() as method_name;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (ln != null)
{
foreach (var child in ln)
if (child != null)
child.Parent = this;
}
if (class_name != null)
class_name.Parent = this;
if (meth_name != null)
meth_name.Parent = this;
if (explicit_interface_name != null)
explicit_interface_name.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
if (ln != null)
{
foreach (var child in ln)
child?.FillParentsInAllChilds();
}
class_name?.FillParentsInAllChilds();
meth_name?.FillParentsInAllChilds();
explicit_interface_name?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 3;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 3 + (ln == null ? 0 : ln.Count);
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return class_name;
case 1:
return meth_name;
case 2:
return explicit_interface_name;
}
Int32 index_counter=ind - 3;
if(ln != null)
{
if(index_counter < ln.Count)
{
return ln[index_counter];
}
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
class_name = (ident)value;
break;
case 1:
meth_name = (ident)value;
break;
case 2:
explicit_interface_name = (ident)value;
break;
}
Int32 index_counter=ind - 3;
if(ln != null)
{
if(index_counter < ln.Count)
{
ln[index_counter]= (ident)value;
return;
}
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class dot_node : addressed_value_funcname
{
///
///Конструктор без параметров.
///
public dot_node()
{
}
///
///Конструктор с параметрами.
///
public dot_node(addressed_value _left,addressed_value _right)
{
this._left=_left;
this._right=_right;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public dot_node(addressed_value _left,addressed_value _right,SourceContext sc)
{
this._left=_left;
this._right=_right;
source_context = sc;
FillParentsInDirectChilds();
}
protected addressed_value _left;
protected addressed_value _right;
///
///
///
public addressed_value left
{
get
{
return _left;
}
set
{
_left=value;
}
}
///
///
///
public addressed_value right
{
get
{
return _right;
}
set
{
_right=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
dot_node copy = new dot_node();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (left != null)
{
copy.left = (addressed_value)left.Clone();
copy.left.Parent = copy;
}
if (right != null)
{
copy.right = (addressed_value)right.Clone();
copy.right.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new dot_node TypedClone()
{
return Clone() as dot_node;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (left != null)
left.Parent = this;
if (right != null)
right.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
left?.FillParentsInAllChilds();
right?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return left;
case 1:
return right;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
left = (addressed_value)value;
break;
case 1:
right = (addressed_value)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class empty_statement : statement
{
///
///Конструктор без параметров.
///
public empty_statement()
{
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
empty_statement copy = new empty_statement();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new empty_statement TypedClone()
{
return Clone() as empty_statement;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class goto_statement : statement
{
///
///Конструктор без параметров.
///
public goto_statement()
{
}
///
///Конструктор с параметрами.
///
public goto_statement(ident _label)
{
this._label=_label;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public goto_statement(ident _label,SourceContext sc)
{
this._label=_label;
source_context = sc;
FillParentsInDirectChilds();
}
protected ident _label;
///
///
///
public ident label
{
get
{
return _label;
}
set
{
_label=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
goto_statement copy = new goto_statement();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (label != null)
{
copy.label = (ident)label.Clone();
copy.label.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new goto_statement TypedClone()
{
return Clone() as goto_statement;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (label != null)
label.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
label?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 1;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 1;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return label;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
label = (ident)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class labeled_statement : statement
{
///
///Конструктор без параметров.
///
public labeled_statement()
{
}
///
///Конструктор с параметрами.
///
public labeled_statement(ident _label_name,statement _to_statement)
{
this._label_name=_label_name;
this._to_statement=_to_statement;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public labeled_statement(ident _label_name,statement _to_statement,SourceContext sc)
{
this._label_name=_label_name;
this._to_statement=_to_statement;
source_context = sc;
FillParentsInDirectChilds();
}
protected ident _label_name;
protected statement _to_statement;
///
///
///
public ident label_name
{
get
{
return _label_name;
}
set
{
_label_name=value;
}
}
///
///
///
public statement to_statement
{
get
{
return _to_statement;
}
set
{
_to_statement=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
labeled_statement copy = new labeled_statement();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (label_name != null)
{
copy.label_name = (ident)label_name.Clone();
copy.label_name.Parent = copy;
}
if (to_statement != null)
{
copy.to_statement = (statement)to_statement.Clone();
copy.to_statement.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new labeled_statement TypedClone()
{
return Clone() as labeled_statement;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (label_name != null)
label_name.Parent = this;
if (to_statement != null)
to_statement.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
label_name?.FillParentsInAllChilds();
to_statement?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return label_name;
case 1:
return to_statement;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
label_name = (ident)value;
break;
case 1:
to_statement = (statement)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Представление оператора with в синтаксическом дереве.
///
[Serializable]
public partial class with_statement : statement
{
///
///Конструктор без параметров.
///
public with_statement()
{
}
///
///Конструктор с параметрами.
///
public with_statement(statement _what_do,expression_list _do_with)
{
this._what_do=_what_do;
this._do_with=_do_with;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public with_statement(statement _what_do,expression_list _do_with,SourceContext sc)
{
this._what_do=_what_do;
this._do_with=_do_with;
source_context = sc;
FillParentsInDirectChilds();
}
protected statement _what_do;
protected expression_list _do_with;
///
///Что делать.
///
public statement what_do
{
get
{
return _what_do;
}
set
{
_what_do=value;
}
}
///
///Список объектов, с которыми производить действия.
///
public expression_list do_with
{
get
{
return _do_with;
}
set
{
_do_with=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
with_statement copy = new with_statement();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (what_do != null)
{
copy.what_do = (statement)what_do.Clone();
copy.what_do.Parent = copy;
}
if (do_with != null)
{
copy.do_with = (expression_list)do_with.Clone();
copy.do_with.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new with_statement TypedClone()
{
return Clone() as with_statement;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (what_do != null)
what_do.Parent = this;
if (do_with != null)
do_with.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
what_do?.FillParentsInAllChilds();
do_with?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return what_do;
case 1:
return do_with;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
what_do = (statement)value;
break;
case 1:
do_with = (expression_list)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class method_call : dereference
{
///
///Конструктор без параметров.
///
public method_call()
{
}
///
///Конструктор с параметрами.
///
public method_call(expression_list _parameters)
{
this._parameters=_parameters;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public method_call(expression_list _parameters,SourceContext sc)
{
this._parameters=_parameters;
source_context = sc;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public method_call(addressed_value _dereferencing_value,expression_list _parameters)
{
this._dereferencing_value=_dereferencing_value;
this._parameters=_parameters;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public method_call(addressed_value _dereferencing_value,expression_list _parameters,SourceContext sc)
{
this._dereferencing_value=_dereferencing_value;
this._parameters=_parameters;
source_context = sc;
FillParentsInDirectChilds();
}
protected expression_list _parameters;
///
///
///
public expression_list parameters
{
get
{
return _parameters;
}
set
{
_parameters=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
method_call copy = new method_call();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (dereferencing_value != null)
{
copy.dereferencing_value = (addressed_value)dereferencing_value.Clone();
copy.dereferencing_value.Parent = copy;
}
if (parameters != null)
{
copy.parameters = (expression_list)parameters.Clone();
copy.parameters.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new method_call TypedClone()
{
return Clone() as method_call;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (dereferencing_value != null)
dereferencing_value.Parent = this;
if (parameters != null)
parameters.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
dereferencing_value?.FillParentsInAllChilds();
parameters?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return dereferencing_value;
case 1:
return parameters;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
dereferencing_value = (addressed_value)value;
break;
case 1:
parameters = (expression_list)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Выражение-константа множество
///
[Serializable]
public partial class pascal_set_constant : addressed_value
{
///
///Конструктор без параметров.
///
public pascal_set_constant()
{
}
///
///Конструктор с параметрами.
///
public pascal_set_constant(expression_list _values)
{
this._values=_values;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public pascal_set_constant(expression_list _values,SourceContext sc)
{
this._values=_values;
source_context = sc;
FillParentsInDirectChilds();
}
protected expression_list _values;
///
///
///
public expression_list values
{
get
{
return _values;
}
set
{
_values=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
pascal_set_constant copy = new pascal_set_constant();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (values != null)
{
copy.values = (expression_list)values.Clone();
copy.values.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new pascal_set_constant TypedClone()
{
return Clone() as pascal_set_constant;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (values != null)
values.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
values?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 1;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 1;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return values;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
values = (expression_list)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class array_const : expression
{
///
///Конструктор без параметров.
///
public array_const()
{
}
///
///Конструктор с параметрами.
///
public array_const(expression_list _elements)
{
this._elements=_elements;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public array_const(expression_list _elements,SourceContext sc)
{
this._elements=_elements;
source_context = sc;
FillParentsInDirectChilds();
}
protected expression_list _elements;
///
///
///
public expression_list elements
{
get
{
return _elements;
}
set
{
_elements=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
array_const copy = new array_const();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (elements != null)
{
copy.elements = (expression_list)elements.Clone();
copy.elements.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new array_const TypedClone()
{
return Clone() as array_const;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (elements != null)
elements.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
elements?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 1;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 1;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return elements;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
elements = (expression_list)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class write_accessor_name : syntax_tree_node
{
///
///Конструктор без параметров.
///
public write_accessor_name()
{
}
///
///Конструктор с параметрами.
///
public write_accessor_name(ident _accessor_name)
{
this._accessor_name=_accessor_name;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public write_accessor_name(ident _accessor_name,SourceContext sc)
{
this._accessor_name=_accessor_name;
source_context = sc;
FillParentsInDirectChilds();
}
protected ident _accessor_name;
///
///
///
public ident accessor_name
{
get
{
return _accessor_name;
}
set
{
_accessor_name=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
write_accessor_name copy = new write_accessor_name();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (accessor_name != null)
{
copy.accessor_name = (ident)accessor_name.Clone();
copy.accessor_name.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new write_accessor_name TypedClone()
{
return Clone() as write_accessor_name;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (accessor_name != null)
accessor_name.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
accessor_name?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 1;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 1;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return accessor_name;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
accessor_name = (ident)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class read_accessor_name : syntax_tree_node
{
///
///Конструктор без параметров.
///
public read_accessor_name()
{
}
///
///Конструктор с параметрами.
///
public read_accessor_name(ident _accessor_name)
{
this._accessor_name=_accessor_name;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public read_accessor_name(ident _accessor_name,SourceContext sc)
{
this._accessor_name=_accessor_name;
source_context = sc;
FillParentsInDirectChilds();
}
protected ident _accessor_name;
///
///
///
public ident accessor_name
{
get
{
return _accessor_name;
}
set
{
_accessor_name=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
read_accessor_name copy = new read_accessor_name();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (accessor_name != null)
{
copy.accessor_name = (ident)accessor_name.Clone();
copy.accessor_name.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new read_accessor_name TypedClone()
{
return Clone() as read_accessor_name;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (accessor_name != null)
accessor_name.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
accessor_name?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 1;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 1;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return accessor_name;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
accessor_name = (ident)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class property_accessors : syntax_tree_node
{
///
///Конструктор без параметров.
///
public property_accessors()
{
}
///
///Конструктор с параметрами.
///
public property_accessors(read_accessor_name _read_accessor,write_accessor_name _write_accessor)
{
this._read_accessor=_read_accessor;
this._write_accessor=_write_accessor;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public property_accessors(read_accessor_name _read_accessor,write_accessor_name _write_accessor,SourceContext sc)
{
this._read_accessor=_read_accessor;
this._write_accessor=_write_accessor;
source_context = sc;
FillParentsInDirectChilds();
}
protected read_accessor_name _read_accessor;
protected write_accessor_name _write_accessor;
///
///
///
public read_accessor_name read_accessor
{
get
{
return _read_accessor;
}
set
{
_read_accessor=value;
}
}
///
///
///
public write_accessor_name write_accessor
{
get
{
return _write_accessor;
}
set
{
_write_accessor=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
property_accessors copy = new property_accessors();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (read_accessor != null)
{
copy.read_accessor = (read_accessor_name)read_accessor.Clone();
copy.read_accessor.Parent = copy;
}
if (write_accessor != null)
{
copy.write_accessor = (write_accessor_name)write_accessor.Clone();
copy.write_accessor.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new property_accessors TypedClone()
{
return Clone() as property_accessors;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (read_accessor != null)
read_accessor.Parent = this;
if (write_accessor != null)
write_accessor.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
read_accessor?.FillParentsInAllChilds();
write_accessor?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return read_accessor;
case 1:
return write_accessor;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
read_accessor = (read_accessor_name)value;
break;
case 1:
write_accessor = (write_accessor_name)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///property property_name[parameter_list]:property_type index index_expression accessors; [virtual;] array_default;
///
[Serializable]
public partial class simple_property : declaration
{
///
///Конструктор без параметров.
///
public simple_property()
{
}
///
///Конструктор с параметрами.
///
public simple_property(ident _property_name,type_definition _property_type,expression _index_expression,property_accessors _accessors,property_array_default _array_default,property_parameter_list _parameter_list,definition_attribute _attr,proc_attribute _virt_over_none_attr)
{
this._property_name=_property_name;
this._property_type=_property_type;
this._index_expression=_index_expression;
this._accessors=_accessors;
this._array_default=_array_default;
this._parameter_list=_parameter_list;
this._attr=_attr;
this._virt_over_none_attr=_virt_over_none_attr;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public simple_property(ident _property_name,type_definition _property_type,expression _index_expression,property_accessors _accessors,property_array_default _array_default,property_parameter_list _parameter_list,definition_attribute _attr,proc_attribute _virt_over_none_attr,SourceContext sc)
{
this._property_name=_property_name;
this._property_type=_property_type;
this._index_expression=_index_expression;
this._accessors=_accessors;
this._array_default=_array_default;
this._parameter_list=_parameter_list;
this._attr=_attr;
this._virt_over_none_attr=_virt_over_none_attr;
source_context = sc;
FillParentsInDirectChilds();
}
protected ident _property_name;
protected type_definition _property_type;
protected expression _index_expression;
protected property_accessors _accessors;
protected property_array_default _array_default;
protected property_parameter_list _parameter_list;
protected definition_attribute _attr;
protected proc_attribute _virt_over_none_attr;
///
///
///
public ident property_name
{
get
{
return _property_name;
}
set
{
_property_name=value;
}
}
///
///
///
public type_definition property_type
{
get
{
return _property_type;
}
set
{
_property_type=value;
}
}
///
///
///
public expression index_expression
{
get
{
return _index_expression;
}
set
{
_index_expression=value;
}
}
///
///
///
public property_accessors accessors
{
get
{
return _accessors;
}
set
{
_accessors=value;
}
}
///
///
///
public property_array_default array_default
{
get
{
return _array_default;
}
set
{
_array_default=value;
}
}
///
///
///
public property_parameter_list parameter_list
{
get
{
return _parameter_list;
}
set
{
_parameter_list=value;
}
}
///
///
///
public definition_attribute attr
{
get
{
return _attr;
}
set
{
_attr=value;
}
}
///
///
///
public proc_attribute virt_over_none_attr
{
get
{
return _virt_over_none_attr;
}
set
{
_virt_over_none_attr=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
simple_property copy = new simple_property();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (property_name != null)
{
copy.property_name = (ident)property_name.Clone();
copy.property_name.Parent = copy;
}
if (property_type != null)
{
copy.property_type = (type_definition)property_type.Clone();
copy.property_type.Parent = copy;
}
if (index_expression != null)
{
copy.index_expression = (expression)index_expression.Clone();
copy.index_expression.Parent = copy;
}
if (accessors != null)
{
copy.accessors = (property_accessors)accessors.Clone();
copy.accessors.Parent = copy;
}
if (array_default != null)
{
copy.array_default = (property_array_default)array_default.Clone();
copy.array_default.Parent = copy;
}
if (parameter_list != null)
{
copy.parameter_list = (property_parameter_list)parameter_list.Clone();
copy.parameter_list.Parent = copy;
}
copy.attr = attr;
copy.virt_over_none_attr = virt_over_none_attr;
return copy;
}
/// Получает копию данного узла корректного типа
public new simple_property TypedClone()
{
return Clone() as simple_property;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (property_name != null)
property_name.Parent = this;
if (property_type != null)
property_type.Parent = this;
if (index_expression != null)
index_expression.Parent = this;
if (accessors != null)
accessors.Parent = this;
if (array_default != null)
array_default.Parent = this;
if (parameter_list != null)
parameter_list.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
property_name?.FillParentsInAllChilds();
property_type?.FillParentsInAllChilds();
index_expression?.FillParentsInAllChilds();
accessors?.FillParentsInAllChilds();
array_default?.FillParentsInAllChilds();
parameter_list?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 6;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 6;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return property_name;
case 1:
return property_type;
case 2:
return index_expression;
case 3:
return accessors;
case 4:
return array_default;
case 5:
return parameter_list;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
property_name = (ident)value;
break;
case 1:
property_type = (type_definition)value;
break;
case 2:
index_expression = (expression)value;
break;
case 3:
accessors = (property_accessors)value;
break;
case 4:
array_default = (property_array_default)value;
break;
case 5:
parameter_list = (property_parameter_list)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class index_property : simple_property
{
///
///Конструктор без параметров.
///
public index_property()
{
}
///
///Конструктор с параметрами.
///
public index_property(formal_parameters _property_parametres,default_indexer_property_node _is_default)
{
this._property_parametres=_property_parametres;
this._is_default=_is_default;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public index_property(formal_parameters _property_parametres,default_indexer_property_node _is_default,SourceContext sc)
{
this._property_parametres=_property_parametres;
this._is_default=_is_default;
source_context = sc;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public index_property(ident _property_name,type_definition _property_type,expression _index_expression,property_accessors _accessors,property_array_default _array_default,property_parameter_list _parameter_list,definition_attribute _attr,proc_attribute _virt_over_none_attr,formal_parameters _property_parametres,default_indexer_property_node _is_default)
{
this._property_name=_property_name;
this._property_type=_property_type;
this._index_expression=_index_expression;
this._accessors=_accessors;
this._array_default=_array_default;
this._parameter_list=_parameter_list;
this._attr=_attr;
this._virt_over_none_attr=_virt_over_none_attr;
this._property_parametres=_property_parametres;
this._is_default=_is_default;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public index_property(ident _property_name,type_definition _property_type,expression _index_expression,property_accessors _accessors,property_array_default _array_default,property_parameter_list _parameter_list,definition_attribute _attr,proc_attribute _virt_over_none_attr,formal_parameters _property_parametres,default_indexer_property_node _is_default,SourceContext sc)
{
this._property_name=_property_name;
this._property_type=_property_type;
this._index_expression=_index_expression;
this._accessors=_accessors;
this._array_default=_array_default;
this._parameter_list=_parameter_list;
this._attr=_attr;
this._virt_over_none_attr=_virt_over_none_attr;
this._property_parametres=_property_parametres;
this._is_default=_is_default;
source_context = sc;
FillParentsInDirectChilds();
}
protected formal_parameters _property_parametres;
protected default_indexer_property_node _is_default;
///
///
///
public formal_parameters property_parametres
{
get
{
return _property_parametres;
}
set
{
_property_parametres=value;
}
}
///
///
///
public default_indexer_property_node is_default
{
get
{
return _is_default;
}
set
{
_is_default=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
index_property copy = new index_property();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (property_name != null)
{
copy.property_name = (ident)property_name.Clone();
copy.property_name.Parent = copy;
}
if (property_type != null)
{
copy.property_type = (type_definition)property_type.Clone();
copy.property_type.Parent = copy;
}
if (index_expression != null)
{
copy.index_expression = (expression)index_expression.Clone();
copy.index_expression.Parent = copy;
}
if (accessors != null)
{
copy.accessors = (property_accessors)accessors.Clone();
copy.accessors.Parent = copy;
}
if (array_default != null)
{
copy.array_default = (property_array_default)array_default.Clone();
copy.array_default.Parent = copy;
}
if (parameter_list != null)
{
copy.parameter_list = (property_parameter_list)parameter_list.Clone();
copy.parameter_list.Parent = copy;
}
copy.attr = attr;
copy.virt_over_none_attr = virt_over_none_attr;
if (property_parametres != null)
{
copy.property_parametres = (formal_parameters)property_parametres.Clone();
copy.property_parametres.Parent = copy;
}
if (is_default != null)
{
copy.is_default = (default_indexer_property_node)is_default.Clone();
copy.is_default.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new index_property TypedClone()
{
return Clone() as index_property;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (property_name != null)
property_name.Parent = this;
if (property_type != null)
property_type.Parent = this;
if (index_expression != null)
index_expression.Parent = this;
if (accessors != null)
accessors.Parent = this;
if (array_default != null)
array_default.Parent = this;
if (parameter_list != null)
parameter_list.Parent = this;
if (property_parametres != null)
property_parametres.Parent = this;
if (is_default != null)
is_default.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
property_name?.FillParentsInAllChilds();
property_type?.FillParentsInAllChilds();
index_expression?.FillParentsInAllChilds();
accessors?.FillParentsInAllChilds();
array_default?.FillParentsInAllChilds();
parameter_list?.FillParentsInAllChilds();
property_parametres?.FillParentsInAllChilds();
is_default?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 8;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 8;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return property_name;
case 1:
return property_type;
case 2:
return index_expression;
case 3:
return accessors;
case 4:
return array_default;
case 5:
return parameter_list;
case 6:
return property_parametres;
case 7:
return is_default;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
property_name = (ident)value;
break;
case 1:
property_type = (type_definition)value;
break;
case 2:
index_expression = (expression)value;
break;
case 3:
accessors = (property_accessors)value;
break;
case 4:
array_default = (property_array_default)value;
break;
case 5:
parameter_list = (property_parameter_list)value;
break;
case 6:
property_parametres = (formal_parameters)value;
break;
case 7:
is_default = (default_indexer_property_node)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class class_members : syntax_tree_node
{
///
///Конструктор без параметров.
///
public class_members()
{
}
///
///Конструктор с параметрами.
///
public class_members(List _members,access_modifer_node _access_mod)
{
this._members=_members;
this._access_mod=_access_mod;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public class_members(List _members,access_modifer_node _access_mod,SourceContext sc)
{
this._members=_members;
this._access_mod=_access_mod;
source_context = sc;
FillParentsInDirectChilds();
}
public class_members(declaration elem, SourceContext sc = null)
{
Add(elem, sc);
FillParentsInDirectChilds();
}
protected List _members=new List();
protected access_modifer_node _access_mod;
///
///
///
public List members
{
get
{
return _members;
}
set
{
_members=value;
}
}
///
///
///
public access_modifer_node access_mod
{
get
{
return _access_mod;
}
set
{
_access_mod=value;
}
}
public class_members Add(declaration elem, SourceContext sc = null)
{
members.Add(elem);
if (elem != null)
elem.Parent = this;
if (sc != null)
source_context = sc;
return this;
}
public void AddFirst(declaration el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
members.Insert(0, el);
FillParentsInDirectChilds();
}
public void AddFirst(IEnumerable els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
members.InsertRange(0, els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
public void AddMany(params declaration[] els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
members.AddRange(els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
private int FindIndexInList(declaration el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
var ind = members.FindIndex(x => x == el);
if (ind == -1)
throw new Exception(string.Format("У списка {0} не найден элемент {1} среди дочерних\n", this, el));
return ind;
}
public void InsertAfter(declaration el, declaration newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
members.Insert(FindIndexInList(el) + 1, newel);
newel.Parent = this;
}
public void InsertAfter(declaration el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
members.InsertRange(FindIndexInList(el) + 1, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public void InsertBefore(declaration el, declaration newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
members.Insert(FindIndexInList(el), newel);
newel.Parent = this;
}
public void InsertBefore(declaration el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
members.InsertRange(FindIndexInList(el), newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public bool Remove(declaration el)
{
return members.Remove(el);
}
public void ReplaceInList(declaration el, declaration newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
members[FindIndexInList(el)] = newel;
newel.Parent = this;
}
public void ReplaceInList(declaration el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
var ind = FindIndexInList(el);
members.RemoveAt(ind);
members.InsertRange(ind, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public int RemoveAll(Predicate match)
{
return members.RemoveAll(match);
}
public declaration Last()
{
if (members.Count > 0)
return members[members.Count - 1];
throw new InvalidOperationException("Список пуст");
}
public int Count
{
get { return members.Count; }
}
public void Insert(int pos, declaration el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
members.Insert(pos,el);
if (el != null)
el.Parent = this;
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
class_members copy = new class_members();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (members != null)
{
foreach (declaration elem in members)
{
if (elem != null)
{
copy.Add((declaration)elem.Clone());
copy.Last().Parent = copy;
}
else
copy.Add(null);
}
}
if (access_mod != null)
{
copy.access_mod = (access_modifer_node)access_mod.Clone();
copy.access_mod.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new class_members TypedClone()
{
return Clone() as class_members;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (members != null)
{
foreach (var child in members)
if (child != null)
child.Parent = this;
}
if (access_mod != null)
access_mod.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
if (members != null)
{
foreach (var child in members)
child?.FillParentsInAllChilds();
}
access_mod?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 1;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 1 + (members == null ? 0 : members.Count);
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return access_mod;
}
Int32 index_counter=ind - 1;
if(members != null)
{
if(index_counter < members.Count)
{
return members[index_counter];
}
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
access_mod = (access_modifer_node)value;
break;
}
Int32 index_counter=ind - 1;
if(members != null)
{
if(index_counter < members.Count)
{
members[index_counter]= (declaration)value;
return;
}
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class access_modifer_node : syntax_tree_node
{
///
///Конструктор без параметров.
///
public access_modifer_node()
{
}
///
///Конструктор с параметрами.
///
public access_modifer_node(access_modifer _access_level)
{
this._access_level=_access_level;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public access_modifer_node(access_modifer _access_level,SourceContext sc)
{
this._access_level=_access_level;
source_context = sc;
FillParentsInDirectChilds();
}
protected access_modifer _access_level;
///
///
///
public access_modifer access_level
{
get
{
return _access_level;
}
set
{
_access_level=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
access_modifer_node copy = new access_modifer_node();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
copy.access_level = access_level;
return copy;
}
/// Получает копию данного узла корректного типа
public new access_modifer_node TypedClone()
{
return Clone() as access_modifer_node;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class class_body_list : syntax_tree_node
{
///
///Конструктор без параметров.
///
public class_body_list()
{
}
///
///Конструктор с параметрами.
///
public class_body_list(List _class_def_blocks)
{
this._class_def_blocks=_class_def_blocks;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public class_body_list(List _class_def_blocks,SourceContext sc)
{
this._class_def_blocks=_class_def_blocks;
source_context = sc;
FillParentsInDirectChilds();
}
public class_body_list(class_members elem, SourceContext sc = null)
{
Add(elem, sc);
FillParentsInDirectChilds();
}
protected List _class_def_blocks=new List();
///
///
///
public List class_def_blocks
{
get
{
return _class_def_blocks;
}
set
{
_class_def_blocks=value;
}
}
public class_body_list Add(class_members elem, SourceContext sc = null)
{
class_def_blocks.Add(elem);
if (elem != null)
elem.Parent = this;
if (sc != null)
source_context = sc;
return this;
}
public void AddFirst(class_members el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
class_def_blocks.Insert(0, el);
FillParentsInDirectChilds();
}
public void AddFirst(IEnumerable els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
class_def_blocks.InsertRange(0, els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
public void AddMany(params class_members[] els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
class_def_blocks.AddRange(els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
private int FindIndexInList(class_members el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
var ind = class_def_blocks.FindIndex(x => x == el);
if (ind == -1)
throw new Exception(string.Format("У списка {0} не найден элемент {1} среди дочерних\n", this, el));
return ind;
}
public void InsertAfter(class_members el, class_members newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
class_def_blocks.Insert(FindIndexInList(el) + 1, newel);
newel.Parent = this;
}
public void InsertAfter(class_members el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
class_def_blocks.InsertRange(FindIndexInList(el) + 1, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public void InsertBefore(class_members el, class_members newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
class_def_blocks.Insert(FindIndexInList(el), newel);
newel.Parent = this;
}
public void InsertBefore(class_members el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
class_def_blocks.InsertRange(FindIndexInList(el), newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public bool Remove(class_members el)
{
return class_def_blocks.Remove(el);
}
public void ReplaceInList(class_members el, class_members newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
class_def_blocks[FindIndexInList(el)] = newel;
newel.Parent = this;
}
public void ReplaceInList(class_members el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
var ind = FindIndexInList(el);
class_def_blocks.RemoveAt(ind);
class_def_blocks.InsertRange(ind, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public int RemoveAll(Predicate match)
{
return class_def_blocks.RemoveAll(match);
}
public class_members Last()
{
if (class_def_blocks.Count > 0)
return class_def_blocks[class_def_blocks.Count - 1];
throw new InvalidOperationException("Список пуст");
}
public int Count
{
get { return class_def_blocks.Count; }
}
public void Insert(int pos, class_members el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
class_def_blocks.Insert(pos,el);
if (el != null)
el.Parent = this;
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
class_body_list copy = new class_body_list();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (class_def_blocks != null)
{
foreach (class_members elem in class_def_blocks)
{
if (elem != null)
{
copy.Add((class_members)elem.Clone());
copy.Last().Parent = copy;
}
else
copy.Add(null);
}
}
return copy;
}
/// Получает копию данного узла корректного типа
public new class_body_list TypedClone()
{
return Clone() as class_body_list;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (class_def_blocks != null)
{
foreach (var child in class_def_blocks)
if (child != null)
child.Parent = this;
}
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
if (class_def_blocks != null)
{
foreach (var child in class_def_blocks)
child?.FillParentsInAllChilds();
}
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0 + (class_def_blocks == null ? 0 : class_def_blocks.Count);
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(class_def_blocks != null)
{
if(index_counter < class_def_blocks.Count)
{
return class_def_blocks[index_counter];
}
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(class_def_blocks != null)
{
if(index_counter < class_def_blocks.Count)
{
class_def_blocks[index_counter]= (class_members)value;
return;
}
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class class_definition : type_definition
{
///
///Конструктор без параметров.
///
public class_definition()
{
}
///
///Конструктор с параметрами.
///
public class_definition(named_type_reference_list _class_parents,class_body_list _body,class_keyword _keyword,ident_list _template_args,where_definition_list _where_section,class_attribute _attribute,bool _is_auto)
{
this._class_parents=_class_parents;
this._body=_body;
this._keyword=_keyword;
this._template_args=_template_args;
this._where_section=_where_section;
this._attribute=_attribute;
this._is_auto=_is_auto;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public class_definition(named_type_reference_list _class_parents,class_body_list _body,class_keyword _keyword,ident_list _template_args,where_definition_list _where_section,class_attribute _attribute,bool _is_auto,SourceContext sc)
{
this._class_parents=_class_parents;
this._body=_body;
this._keyword=_keyword;
this._template_args=_template_args;
this._where_section=_where_section;
this._attribute=_attribute;
this._is_auto=_is_auto;
source_context = sc;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public class_definition(type_definition_attr_list _attr_list,named_type_reference_list _class_parents,class_body_list _body,class_keyword _keyword,ident_list _template_args,where_definition_list _where_section,class_attribute _attribute,bool _is_auto)
{
this._attr_list=_attr_list;
this._class_parents=_class_parents;
this._body=_body;
this._keyword=_keyword;
this._template_args=_template_args;
this._where_section=_where_section;
this._attribute=_attribute;
this._is_auto=_is_auto;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public class_definition(type_definition_attr_list _attr_list,named_type_reference_list _class_parents,class_body_list _body,class_keyword _keyword,ident_list _template_args,where_definition_list _where_section,class_attribute _attribute,bool _is_auto,SourceContext sc)
{
this._attr_list=_attr_list;
this._class_parents=_class_parents;
this._body=_body;
this._keyword=_keyword;
this._template_args=_template_args;
this._where_section=_where_section;
this._attribute=_attribute;
this._is_auto=_is_auto;
source_context = sc;
FillParentsInDirectChilds();
}
protected named_type_reference_list _class_parents;
protected class_body_list _body;
protected class_keyword _keyword;
protected ident_list _template_args;
protected where_definition_list _where_section;
protected class_attribute _attribute;
protected bool _is_auto;
///
///
///
public named_type_reference_list class_parents
{
get
{
return _class_parents;
}
set
{
_class_parents=value;
}
}
///
///
///
public class_body_list body
{
get
{
return _body;
}
set
{
_body=value;
}
}
///
///
///
public class_keyword keyword
{
get
{
return _keyword;
}
set
{
_keyword=value;
}
}
///
///
///
public ident_list template_args
{
get
{
return _template_args;
}
set
{
_template_args=value;
}
}
///
///
///
public where_definition_list where_section
{
get
{
return _where_section;
}
set
{
_where_section=value;
}
}
///
///
///
public class_attribute attribute
{
get
{
return _attribute;
}
set
{
_attribute=value;
}
}
///
///
///
public bool is_auto
{
get
{
return _is_auto;
}
set
{
_is_auto=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
class_definition copy = new class_definition();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (attr_list != null)
{
copy.attr_list = (type_definition_attr_list)attr_list.Clone();
copy.attr_list.Parent = copy;
}
if (class_parents != null)
{
copy.class_parents = (named_type_reference_list)class_parents.Clone();
copy.class_parents.Parent = copy;
}
if (body != null)
{
copy.body = (class_body_list)body.Clone();
copy.body.Parent = copy;
}
copy.keyword = keyword;
if (template_args != null)
{
copy.template_args = (ident_list)template_args.Clone();
copy.template_args.Parent = copy;
}
if (where_section != null)
{
copy.where_section = (where_definition_list)where_section.Clone();
copy.where_section.Parent = copy;
}
copy.attribute = attribute;
copy.is_auto = is_auto;
return copy;
}
/// Получает копию данного узла корректного типа
public new class_definition TypedClone()
{
return Clone() as class_definition;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (attr_list != null)
attr_list.Parent = this;
if (class_parents != null)
class_parents.Parent = this;
if (body != null)
body.Parent = this;
if (template_args != null)
template_args.Parent = this;
if (where_section != null)
where_section.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
attr_list?.FillParentsInAllChilds();
class_parents?.FillParentsInAllChilds();
body?.FillParentsInAllChilds();
template_args?.FillParentsInAllChilds();
where_section?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 5;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 5;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return attr_list;
case 1:
return class_parents;
case 2:
return body;
case 3:
return template_args;
case 4:
return where_section;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
attr_list = (type_definition_attr_list)value;
break;
case 1:
class_parents = (named_type_reference_list)value;
break;
case 2:
body = (class_body_list)value;
break;
case 3:
template_args = (ident_list)value;
break;
case 4:
where_section = (where_definition_list)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class default_indexer_property_node : syntax_tree_node
{
///
///Конструктор без параметров.
///
public default_indexer_property_node()
{
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
default_indexer_property_node copy = new default_indexer_property_node();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
return copy;
}
/// Получает копию данного узла корректного типа
public new default_indexer_property_node TypedClone()
{
return Clone() as default_indexer_property_node;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class known_type_definition : type_definition
{
///
///Конструктор без параметров.
///
public known_type_definition()
{
}
///
///Конструктор с параметрами.
///
public known_type_definition(known_type _tp,ident _unit_name)
{
this._tp=_tp;
this._unit_name=_unit_name;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public known_type_definition(known_type _tp,ident _unit_name,SourceContext sc)
{
this._tp=_tp;
this._unit_name=_unit_name;
source_context = sc;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public known_type_definition(type_definition_attr_list _attr_list,known_type _tp,ident _unit_name)
{
this._attr_list=_attr_list;
this._tp=_tp;
this._unit_name=_unit_name;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public known_type_definition(type_definition_attr_list _attr_list,known_type _tp,ident _unit_name,SourceContext sc)
{
this._attr_list=_attr_list;
this._tp=_tp;
this._unit_name=_unit_name;
source_context = sc;
FillParentsInDirectChilds();
}
protected known_type _tp;
protected ident _unit_name;
///
///
///
public known_type tp
{
get
{
return _tp;
}
set
{
_tp=value;
}
}
///
///
///
public ident unit_name
{
get
{
return _unit_name;
}
set
{
_unit_name=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
known_type_definition copy = new known_type_definition();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (attr_list != null)
{
copy.attr_list = (type_definition_attr_list)attr_list.Clone();
copy.attr_list.Parent = copy;
}
copy.tp = tp;
if (unit_name != null)
{
copy.unit_name = (ident)unit_name.Clone();
copy.unit_name.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new known_type_definition TypedClone()
{
return Clone() as known_type_definition;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (attr_list != null)
attr_list.Parent = this;
if (unit_name != null)
unit_name.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
attr_list?.FillParentsInAllChilds();
unit_name?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return attr_list;
case 1:
return unit_name;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
attr_list = (type_definition_attr_list)value;
break;
case 1:
unit_name = (ident)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class set_type_definition : type_definition
{
///
///Конструктор без параметров.
///
public set_type_definition()
{
}
///
///Конструктор с параметрами.
///
public set_type_definition(type_definition _of_type)
{
this._of_type=_of_type;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public set_type_definition(type_definition _of_type,SourceContext sc)
{
this._of_type=_of_type;
source_context = sc;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public set_type_definition(type_definition_attr_list _attr_list,type_definition _of_type)
{
this._attr_list=_attr_list;
this._of_type=_of_type;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public set_type_definition(type_definition_attr_list _attr_list,type_definition _of_type,SourceContext sc)
{
this._attr_list=_attr_list;
this._of_type=_of_type;
source_context = sc;
FillParentsInDirectChilds();
}
protected type_definition _of_type;
///
///
///
public type_definition of_type
{
get
{
return _of_type;
}
set
{
_of_type=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
set_type_definition copy = new set_type_definition();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (attr_list != null)
{
copy.attr_list = (type_definition_attr_list)attr_list.Clone();
copy.attr_list.Parent = copy;
}
if (of_type != null)
{
copy.of_type = (type_definition)of_type.Clone();
copy.of_type.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new set_type_definition TypedClone()
{
return Clone() as set_type_definition;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (attr_list != null)
attr_list.Parent = this;
if (of_type != null)
of_type.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
attr_list?.FillParentsInAllChilds();
of_type?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return attr_list;
case 1:
return of_type;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
attr_list = (type_definition_attr_list)value;
break;
case 1:
of_type = (type_definition)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class record_const_definition : statement
{
///
///Конструктор без параметров.
///
public record_const_definition()
{
}
///
///Конструктор с параметрами.
///
public record_const_definition(ident _name,expression _val)
{
this._name=_name;
this._val=_val;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public record_const_definition(ident _name,expression _val,SourceContext sc)
{
this._name=_name;
this._val=_val;
source_context = sc;
FillParentsInDirectChilds();
}
protected ident _name;
protected expression _val;
///
///
///
public ident name
{
get
{
return _name;
}
set
{
_name=value;
}
}
///
///
///
public expression val
{
get
{
return _val;
}
set
{
_val=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
record_const_definition copy = new record_const_definition();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (name != null)
{
copy.name = (ident)name.Clone();
copy.name.Parent = copy;
}
if (val != null)
{
copy.val = (expression)val.Clone();
copy.val.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new record_const_definition TypedClone()
{
return Clone() as record_const_definition;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (name != null)
name.Parent = this;
if (val != null)
val.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
name?.FillParentsInAllChilds();
val?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return name;
case 1:
return val;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
name = (ident)value;
break;
case 1:
val = (expression)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class record_const : expression
{
///
///Конструктор без параметров.
///
public record_const()
{
}
///
///Конструктор с параметрами.
///
public record_const(List _rec_consts)
{
this._rec_consts=_rec_consts;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public record_const(List _rec_consts,SourceContext sc)
{
this._rec_consts=_rec_consts;
source_context = sc;
FillParentsInDirectChilds();
}
public record_const(record_const_definition elem, SourceContext sc = null)
{
Add(elem, sc);
FillParentsInDirectChilds();
}
protected List _rec_consts=new List();
///
///
///
public List rec_consts
{
get
{
return _rec_consts;
}
set
{
_rec_consts=value;
}
}
public record_const Add(record_const_definition elem, SourceContext sc = null)
{
rec_consts.Add(elem);
if (elem != null)
elem.Parent = this;
if (sc != null)
source_context = sc;
return this;
}
public void AddFirst(record_const_definition el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
rec_consts.Insert(0, el);
FillParentsInDirectChilds();
}
public void AddFirst(IEnumerable els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
rec_consts.InsertRange(0, els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
public void AddMany(params record_const_definition[] els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
rec_consts.AddRange(els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
private int FindIndexInList(record_const_definition el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
var ind = rec_consts.FindIndex(x => x == el);
if (ind == -1)
throw new Exception(string.Format("У списка {0} не найден элемент {1} среди дочерних\n", this, el));
return ind;
}
public void InsertAfter(record_const_definition el, record_const_definition newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
rec_consts.Insert(FindIndexInList(el) + 1, newel);
newel.Parent = this;
}
public void InsertAfter(record_const_definition el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
rec_consts.InsertRange(FindIndexInList(el) + 1, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public void InsertBefore(record_const_definition el, record_const_definition newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
rec_consts.Insert(FindIndexInList(el), newel);
newel.Parent = this;
}
public void InsertBefore(record_const_definition el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
rec_consts.InsertRange(FindIndexInList(el), newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public bool Remove(record_const_definition el)
{
return rec_consts.Remove(el);
}
public void ReplaceInList(record_const_definition el, record_const_definition newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
rec_consts[FindIndexInList(el)] = newel;
newel.Parent = this;
}
public void ReplaceInList(record_const_definition el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
var ind = FindIndexInList(el);
rec_consts.RemoveAt(ind);
rec_consts.InsertRange(ind, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public int RemoveAll(Predicate match)
{
return rec_consts.RemoveAll(match);
}
public record_const_definition Last()
{
if (rec_consts.Count > 0)
return rec_consts[rec_consts.Count - 1];
throw new InvalidOperationException("Список пуст");
}
public int Count
{
get { return rec_consts.Count; }
}
public void Insert(int pos, record_const_definition el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
rec_consts.Insert(pos,el);
if (el != null)
el.Parent = this;
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
record_const copy = new record_const();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (rec_consts != null)
{
foreach (record_const_definition elem in rec_consts)
{
if (elem != null)
{
copy.Add((record_const_definition)elem.Clone());
copy.Last().Parent = copy;
}
else
copy.Add(null);
}
}
return copy;
}
/// Получает копию данного узла корректного типа
public new record_const TypedClone()
{
return Clone() as record_const;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (rec_consts != null)
{
foreach (var child in rec_consts)
if (child != null)
child.Parent = this;
}
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
if (rec_consts != null)
{
foreach (var child in rec_consts)
child?.FillParentsInAllChilds();
}
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0 + (rec_consts == null ? 0 : rec_consts.Count);
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(rec_consts != null)
{
if(index_counter < rec_consts.Count)
{
return rec_consts[index_counter];
}
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(rec_consts != null)
{
if(index_counter < rec_consts.Count)
{
rec_consts[index_counter]= (record_const_definition)value;
return;
}
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class record_type : type_definition
{
///
///Конструктор без параметров.
///
public record_type()
{
}
///
///Конструктор с параметрами.
///
public record_type(record_type_parts _parts,type_definition _base_type)
{
this._parts=_parts;
this._base_type=_base_type;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public record_type(record_type_parts _parts,type_definition _base_type,SourceContext sc)
{
this._parts=_parts;
this._base_type=_base_type;
source_context = sc;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public record_type(type_definition_attr_list _attr_list,record_type_parts _parts,type_definition _base_type)
{
this._attr_list=_attr_list;
this._parts=_parts;
this._base_type=_base_type;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public record_type(type_definition_attr_list _attr_list,record_type_parts _parts,type_definition _base_type,SourceContext sc)
{
this._attr_list=_attr_list;
this._parts=_parts;
this._base_type=_base_type;
source_context = sc;
FillParentsInDirectChilds();
}
protected record_type_parts _parts;
protected type_definition _base_type;
///
///
///
public record_type_parts parts
{
get
{
return _parts;
}
set
{
_parts=value;
}
}
///
///in oberon2
///
public type_definition base_type
{
get
{
return _base_type;
}
set
{
_base_type=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
record_type copy = new record_type();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (attr_list != null)
{
copy.attr_list = (type_definition_attr_list)attr_list.Clone();
copy.attr_list.Parent = copy;
}
if (parts != null)
{
copy.parts = (record_type_parts)parts.Clone();
copy.parts.Parent = copy;
}
if (base_type != null)
{
copy.base_type = (type_definition)base_type.Clone();
copy.base_type.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new record_type TypedClone()
{
return Clone() as record_type;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (attr_list != null)
attr_list.Parent = this;
if (parts != null)
parts.Parent = this;
if (base_type != null)
base_type.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
attr_list?.FillParentsInAllChilds();
parts?.FillParentsInAllChilds();
base_type?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 3;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 3;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return attr_list;
case 1:
return parts;
case 2:
return base_type;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
attr_list = (type_definition_attr_list)value;
break;
case 1:
parts = (record_type_parts)value;
break;
case 2:
base_type = (type_definition)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class enum_type_definition : type_definition
{
///
///Конструктор без параметров.
///
public enum_type_definition()
{
}
///
///Конструктор с параметрами.
///
public enum_type_definition(enumerator_list _enumerators)
{
this._enumerators=_enumerators;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public enum_type_definition(enumerator_list _enumerators,SourceContext sc)
{
this._enumerators=_enumerators;
source_context = sc;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public enum_type_definition(type_definition_attr_list _attr_list,enumerator_list _enumerators)
{
this._attr_list=_attr_list;
this._enumerators=_enumerators;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public enum_type_definition(type_definition_attr_list _attr_list,enumerator_list _enumerators,SourceContext sc)
{
this._attr_list=_attr_list;
this._enumerators=_enumerators;
source_context = sc;
FillParentsInDirectChilds();
}
protected enumerator_list _enumerators;
///
///
///
public enumerator_list enumerators
{
get
{
return _enumerators;
}
set
{
_enumerators=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
enum_type_definition copy = new enum_type_definition();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (attr_list != null)
{
copy.attr_list = (type_definition_attr_list)attr_list.Clone();
copy.attr_list.Parent = copy;
}
if (enumerators != null)
{
copy.enumerators = (enumerator_list)enumerators.Clone();
copy.enumerators.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new enum_type_definition TypedClone()
{
return Clone() as enum_type_definition;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (attr_list != null)
attr_list.Parent = this;
if (enumerators != null)
enumerators.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
attr_list?.FillParentsInAllChilds();
enumerators?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return attr_list;
case 1:
return enumerators;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
attr_list = (type_definition_attr_list)value;
break;
case 1:
enumerators = (enumerator_list)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Класс, представляющий символьную константу в синтаксическом дереве программы.
///
[Serializable]
public partial class char_const : literal
{
///
///Конструктор без параметров.
///
public char_const()
{
}
///
///Конструктор с параметрами.
///
public char_const(char _cconst)
{
this._cconst=_cconst;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public char_const(char _cconst,SourceContext sc)
{
this._cconst=_cconst;
source_context = sc;
FillParentsInDirectChilds();
}
protected char _cconst;
///
///
///
public char cconst
{
get
{
return _cconst;
}
set
{
_cconst=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
char_const copy = new char_const();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
copy.cconst = cconst;
return copy;
}
/// Получает копию данного узла корректного типа
public new char_const TypedClone()
{
return Clone() as char_const;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Выкидывание исключения.
///
[Serializable]
public partial class raise_statement : statement
{
///
///Конструктор без параметров.
///
public raise_statement()
{
}
///
///Конструктор с параметрами.
///
public raise_statement(expression _excep)
{
this._excep=_excep;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public raise_statement(expression _excep,SourceContext sc)
{
this._excep=_excep;
source_context = sc;
FillParentsInDirectChilds();
}
protected expression _excep;
///
///Выкидываемое исключение.
///
public expression excep
{
get
{
return _excep;
}
set
{
_excep=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
raise_statement copy = new raise_statement();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (excep != null)
{
copy.excep = (expression)excep.Clone();
copy.excep.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new raise_statement TypedClone()
{
return Clone() as raise_statement;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (excep != null)
excep.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
excep?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 1;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 1;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return excep;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
excep = (expression)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Представление в синтаксичеком дереве символьной константы вида #100.
///
[Serializable]
public partial class sharp_char_const : literal
{
///
///Конструктор без параметров.
///
public sharp_char_const()
{
}
///
///Конструктор с параметрами.
///
public sharp_char_const(int _char_num)
{
this._char_num=_char_num;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public sharp_char_const(int _char_num,SourceContext sc)
{
this._char_num=_char_num;
source_context = sc;
FillParentsInDirectChilds();
}
protected int _char_num;
///
///
///
public int char_num
{
get
{
return _char_num;
}
set
{
_char_num=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
sharp_char_const copy = new sharp_char_const();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
copy.char_num = char_num;
return copy;
}
/// Получает копию данного узла корректного типа
public new sharp_char_const TypedClone()
{
return Clone() as sharp_char_const;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Представляет в синтаксическом дереве строку вида #123'abc'#124#125.
///
[Serializable]
public partial class literal_const_line : literal
{
///
///Конструктор без параметров.
///
public literal_const_line()
{
}
///
///Конструктор с параметрами.
///
public literal_const_line(List _literals)
{
this._literals=_literals;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public literal_const_line(List _literals,SourceContext sc)
{
this._literals=_literals;
source_context = sc;
FillParentsInDirectChilds();
}
public literal_const_line(literal elem, SourceContext sc = null)
{
Add(elem, sc);
FillParentsInDirectChilds();
}
protected List _literals=new List();
///
///
///
public List literals
{
get
{
return _literals;
}
set
{
_literals=value;
}
}
public literal_const_line Add(literal elem, SourceContext sc = null)
{
literals.Add(elem);
if (elem != null)
elem.Parent = this;
if (sc != null)
source_context = sc;
return this;
}
public void AddFirst(literal el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
literals.Insert(0, el);
FillParentsInDirectChilds();
}
public void AddFirst(IEnumerable els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
literals.InsertRange(0, els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
public void AddMany(params literal[] els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
literals.AddRange(els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
private int FindIndexInList(literal el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
var ind = literals.FindIndex(x => x == el);
if (ind == -1)
throw new Exception(string.Format("У списка {0} не найден элемент {1} среди дочерних\n", this, el));
return ind;
}
public void InsertAfter(literal el, literal newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
literals.Insert(FindIndexInList(el) + 1, newel);
newel.Parent = this;
}
public void InsertAfter(literal el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
literals.InsertRange(FindIndexInList(el) + 1, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public void InsertBefore(literal el, literal newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
literals.Insert(FindIndexInList(el), newel);
newel.Parent = this;
}
public void InsertBefore(literal el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
literals.InsertRange(FindIndexInList(el), newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public bool Remove(literal el)
{
return literals.Remove(el);
}
public void ReplaceInList(literal el, literal newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
literals[FindIndexInList(el)] = newel;
newel.Parent = this;
}
public void ReplaceInList(literal el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
var ind = FindIndexInList(el);
literals.RemoveAt(ind);
literals.InsertRange(ind, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public int RemoveAll(Predicate match)
{
return literals.RemoveAll(match);
}
public literal Last()
{
if (literals.Count > 0)
return literals[literals.Count - 1];
throw new InvalidOperationException("Список пуст");
}
public int Count
{
get { return literals.Count; }
}
public void Insert(int pos, literal el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
literals.Insert(pos,el);
if (el != null)
el.Parent = this;
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
literal_const_line copy = new literal_const_line();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (literals != null)
{
foreach (literal elem in literals)
{
if (elem != null)
{
copy.Add((literal)elem.Clone());
copy.Last().Parent = copy;
}
else
copy.Add(null);
}
}
return copy;
}
/// Получает копию данного узла корректного типа
public new literal_const_line TypedClone()
{
return Clone() as literal_const_line;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (literals != null)
{
foreach (var child in literals)
if (child != null)
child.Parent = this;
}
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
if (literals != null)
{
foreach (var child in literals)
child?.FillParentsInAllChilds();
}
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0 + (literals == null ? 0 : literals.Count);
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(literals != null)
{
if(index_counter < literals.Count)
{
return literals[index_counter];
}
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(literals != null)
{
if(index_counter < literals.Count)
{
literals[index_counter]= (literal)value;
return;
}
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///Представление для класса строки вида string[256].
///
[Serializable]
public partial class string_num_definition : type_definition
{
///
///Конструктор без параметров.
///
public string_num_definition()
{
}
///
///Конструктор с параметрами.
///
public string_num_definition(expression _num_of_symbols,ident _name)
{
this._num_of_symbols=_num_of_symbols;
this._name=_name;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public string_num_definition(expression _num_of_symbols,ident _name,SourceContext sc)
{
this._num_of_symbols=_num_of_symbols;
this._name=_name;
source_context = sc;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public string_num_definition(type_definition_attr_list _attr_list,expression _num_of_symbols,ident _name)
{
this._attr_list=_attr_list;
this._num_of_symbols=_num_of_symbols;
this._name=_name;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public string_num_definition(type_definition_attr_list _attr_list,expression _num_of_symbols,ident _name,SourceContext sc)
{
this._attr_list=_attr_list;
this._num_of_symbols=_num_of_symbols;
this._name=_name;
source_context = sc;
FillParentsInDirectChilds();
}
protected expression _num_of_symbols;
protected ident _name;
///
///Число символов в строке вида string[256].
///
public expression num_of_symbols
{
get
{
return _num_of_symbols;
}
set
{
_num_of_symbols=value;
}
}
///
///
///
public ident name
{
get
{
return _name;
}
set
{
_name=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
string_num_definition copy = new string_num_definition();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (attr_list != null)
{
copy.attr_list = (type_definition_attr_list)attr_list.Clone();
copy.attr_list.Parent = copy;
}
if (num_of_symbols != null)
{
copy.num_of_symbols = (expression)num_of_symbols.Clone();
copy.num_of_symbols.Parent = copy;
}
if (name != null)
{
copy.name = (ident)name.Clone();
copy.name.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new string_num_definition TypedClone()
{
return Clone() as string_num_definition;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (attr_list != null)
attr_list.Parent = this;
if (num_of_symbols != null)
num_of_symbols.Parent = this;
if (name != null)
name.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
attr_list?.FillParentsInAllChilds();
num_of_symbols?.FillParentsInAllChilds();
name?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 3;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 3;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return attr_list;
case 1:
return num_of_symbols;
case 2:
return name;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
attr_list = (type_definition_attr_list)value;
break;
case 1:
num_of_symbols = (expression)value;
break;
case 2:
name = (ident)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class variant : syntax_tree_node
{
///
///Конструктор без параметров.
///
public variant()
{
}
///
///Конструктор с параметрами.
///
public variant(ident_list _vars,type_definition _vars_type)
{
this._vars=_vars;
this._vars_type=_vars_type;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public variant(ident_list _vars,type_definition _vars_type,SourceContext sc)
{
this._vars=_vars;
this._vars_type=_vars_type;
source_context = sc;
FillParentsInDirectChilds();
}
protected ident_list _vars;
protected type_definition _vars_type;
///
///
///
public ident_list vars
{
get
{
return _vars;
}
set
{
_vars=value;
}
}
///
///
///
public type_definition vars_type
{
get
{
return _vars_type;
}
set
{
_vars_type=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
variant copy = new variant();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (vars != null)
{
copy.vars = (ident_list)vars.Clone();
copy.vars.Parent = copy;
}
if (vars_type != null)
{
copy.vars_type = (type_definition)vars_type.Clone();
copy.vars_type.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new variant TypedClone()
{
return Clone() as variant;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (vars != null)
vars.Parent = this;
if (vars_type != null)
vars_type.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
vars?.FillParentsInAllChilds();
vars_type?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return vars;
case 1:
return vars_type;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
vars = (ident_list)value;
break;
case 1:
vars_type = (type_definition)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class variant_list : syntax_tree_node
{
///
///Конструктор без параметров.
///
public variant_list()
{
}
///
///Конструктор с параметрами.
///
public variant_list(List _vars)
{
this._vars=_vars;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public variant_list(List _vars,SourceContext sc)
{
this._vars=_vars;
source_context = sc;
FillParentsInDirectChilds();
}
public variant_list(variant elem, SourceContext sc = null)
{
Add(elem, sc);
FillParentsInDirectChilds();
}
protected List _vars=new List();
///
///
///
public List vars
{
get
{
return _vars;
}
set
{
_vars=value;
}
}
public variant_list Add(variant elem, SourceContext sc = null)
{
vars.Add(elem);
if (elem != null)
elem.Parent = this;
if (sc != null)
source_context = sc;
return this;
}
public void AddFirst(variant el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
vars.Insert(0, el);
FillParentsInDirectChilds();
}
public void AddFirst(IEnumerable els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
vars.InsertRange(0, els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
public void AddMany(params variant[] els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
vars.AddRange(els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
private int FindIndexInList(variant el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
var ind = vars.FindIndex(x => x == el);
if (ind == -1)
throw new Exception(string.Format("У списка {0} не найден элемент {1} среди дочерних\n", this, el));
return ind;
}
public void InsertAfter(variant el, variant newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
vars.Insert(FindIndexInList(el) + 1, newel);
newel.Parent = this;
}
public void InsertAfter(variant el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
vars.InsertRange(FindIndexInList(el) + 1, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public void InsertBefore(variant el, variant newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
vars.Insert(FindIndexInList(el), newel);
newel.Parent = this;
}
public void InsertBefore(variant el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
vars.InsertRange(FindIndexInList(el), newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public bool Remove(variant el)
{
return vars.Remove(el);
}
public void ReplaceInList(variant el, variant newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
vars[FindIndexInList(el)] = newel;
newel.Parent = this;
}
public void ReplaceInList(variant el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
var ind = FindIndexInList(el);
vars.RemoveAt(ind);
vars.InsertRange(ind, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public int RemoveAll(Predicate match)
{
return vars.RemoveAll(match);
}
public variant Last()
{
if (vars.Count > 0)
return vars[vars.Count - 1];
throw new InvalidOperationException("Список пуст");
}
public int Count
{
get { return vars.Count; }
}
public void Insert(int pos, variant el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
vars.Insert(pos,el);
if (el != null)
el.Parent = this;
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
variant_list copy = new variant_list();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (vars != null)
{
foreach (variant elem in vars)
{
if (elem != null)
{
copy.Add((variant)elem.Clone());
copy.Last().Parent = copy;
}
else
copy.Add(null);
}
}
return copy;
}
/// Получает копию данного узла корректного типа
public new variant_list TypedClone()
{
return Clone() as variant_list;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (vars != null)
{
foreach (var child in vars)
if (child != null)
child.Parent = this;
}
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
if (vars != null)
{
foreach (var child in vars)
child?.FillParentsInAllChilds();
}
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0 + (vars == null ? 0 : vars.Count);
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(vars != null)
{
if(index_counter < vars.Count)
{
return vars[index_counter];
}
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(vars != null)
{
if(index_counter < vars.Count)
{
vars[index_counter]= (variant)value;
return;
}
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class variant_type : syntax_tree_node
{
///
///Конструктор без параметров.
///
public variant_type()
{
}
///
///Конструктор с параметрами.
///
public variant_type(expression_list _case_exprs,record_type_parts _parts)
{
this._case_exprs=_case_exprs;
this._parts=_parts;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public variant_type(expression_list _case_exprs,record_type_parts _parts,SourceContext sc)
{
this._case_exprs=_case_exprs;
this._parts=_parts;
source_context = sc;
FillParentsInDirectChilds();
}
protected expression_list _case_exprs;
protected record_type_parts _parts;
///
///
///
public expression_list case_exprs
{
get
{
return _case_exprs;
}
set
{
_case_exprs=value;
}
}
///
///
///
public record_type_parts parts
{
get
{
return _parts;
}
set
{
_parts=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
variant_type copy = new variant_type();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (case_exprs != null)
{
copy.case_exprs = (expression_list)case_exprs.Clone();
copy.case_exprs.Parent = copy;
}
if (parts != null)
{
copy.parts = (record_type_parts)parts.Clone();
copy.parts.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new variant_type TypedClone()
{
return Clone() as variant_type;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (case_exprs != null)
case_exprs.Parent = this;
if (parts != null)
parts.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
case_exprs?.FillParentsInAllChilds();
parts?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return case_exprs;
case 1:
return parts;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
case_exprs = (expression_list)value;
break;
case 1:
parts = (record_type_parts)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class variant_types : syntax_tree_node
{
///
///Конструктор без параметров.
///
public variant_types()
{
}
///
///Конструктор с параметрами.
///
public variant_types(List _vars)
{
this._vars=_vars;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public variant_types(List _vars,SourceContext sc)
{
this._vars=_vars;
source_context = sc;
FillParentsInDirectChilds();
}
public variant_types(variant_type elem, SourceContext sc = null)
{
Add(elem, sc);
FillParentsInDirectChilds();
}
protected List _vars=new List();
///
///
///
public List vars
{
get
{
return _vars;
}
set
{
_vars=value;
}
}
public variant_types Add(variant_type elem, SourceContext sc = null)
{
vars.Add(elem);
if (elem != null)
elem.Parent = this;
if (sc != null)
source_context = sc;
return this;
}
public void AddFirst(variant_type el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
vars.Insert(0, el);
FillParentsInDirectChilds();
}
public void AddFirst(IEnumerable els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
vars.InsertRange(0, els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
public void AddMany(params variant_type[] els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
vars.AddRange(els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
private int FindIndexInList(variant_type el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
var ind = vars.FindIndex(x => x == el);
if (ind == -1)
throw new Exception(string.Format("У списка {0} не найден элемент {1} среди дочерних\n", this, el));
return ind;
}
public void InsertAfter(variant_type el, variant_type newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
vars.Insert(FindIndexInList(el) + 1, newel);
newel.Parent = this;
}
public void InsertAfter(variant_type el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
vars.InsertRange(FindIndexInList(el) + 1, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public void InsertBefore(variant_type el, variant_type newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
vars.Insert(FindIndexInList(el), newel);
newel.Parent = this;
}
public void InsertBefore(variant_type el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
vars.InsertRange(FindIndexInList(el), newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public bool Remove(variant_type el)
{
return vars.Remove(el);
}
public void ReplaceInList(variant_type el, variant_type newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
vars[FindIndexInList(el)] = newel;
newel.Parent = this;
}
public void ReplaceInList(variant_type el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
var ind = FindIndexInList(el);
vars.RemoveAt(ind);
vars.InsertRange(ind, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public int RemoveAll(Predicate match)
{
return vars.RemoveAll(match);
}
public variant_type Last()
{
if (vars.Count > 0)
return vars[vars.Count - 1];
throw new InvalidOperationException("Список пуст");
}
public int Count
{
get { return vars.Count; }
}
public void Insert(int pos, variant_type el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
vars.Insert(pos,el);
if (el != null)
el.Parent = this;
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
variant_types copy = new variant_types();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (vars != null)
{
foreach (variant_type elem in vars)
{
if (elem != null)
{
copy.Add((variant_type)elem.Clone());
copy.Last().Parent = copy;
}
else
copy.Add(null);
}
}
return copy;
}
/// Получает копию данного узла корректного типа
public new variant_types TypedClone()
{
return Clone() as variant_types;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (vars != null)
{
foreach (var child in vars)
if (child != null)
child.Parent = this;
}
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
if (vars != null)
{
foreach (var child in vars)
child?.FillParentsInAllChilds();
}
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0 + (vars == null ? 0 : vars.Count);
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(vars != null)
{
if(index_counter < vars.Count)
{
return vars[index_counter];
}
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(vars != null)
{
if(index_counter < vars.Count)
{
vars[index_counter]= (variant_type)value;
return;
}
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class variant_record_type : syntax_tree_node
{
///
///Конструктор без параметров.
///
public variant_record_type()
{
}
///
///Конструктор с параметрами.
///
public variant_record_type(ident _var_name,type_definition _var_type,variant_types _vars)
{
this._var_name=_var_name;
this._var_type=_var_type;
this._vars=_vars;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public variant_record_type(ident _var_name,type_definition _var_type,variant_types _vars,SourceContext sc)
{
this._var_name=_var_name;
this._var_type=_var_type;
this._vars=_vars;
source_context = sc;
FillParentsInDirectChilds();
}
protected ident _var_name;
protected type_definition _var_type;
protected variant_types _vars;
///
///
///
public ident var_name
{
get
{
return _var_name;
}
set
{
_var_name=value;
}
}
///
///
///
public type_definition var_type
{
get
{
return _var_type;
}
set
{
_var_type=value;
}
}
///
///
///
public variant_types vars
{
get
{
return _vars;
}
set
{
_vars=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
variant_record_type copy = new variant_record_type();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (var_name != null)
{
copy.var_name = (ident)var_name.Clone();
copy.var_name.Parent = copy;
}
if (var_type != null)
{
copy.var_type = (type_definition)var_type.Clone();
copy.var_type.Parent = copy;
}
if (vars != null)
{
copy.vars = (variant_types)vars.Clone();
copy.vars.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new variant_record_type TypedClone()
{
return Clone() as variant_record_type;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (var_name != null)
var_name.Parent = this;
if (var_type != null)
var_type.Parent = this;
if (vars != null)
vars.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
var_name?.FillParentsInAllChilds();
var_type?.FillParentsInAllChilds();
vars?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 3;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 3;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return var_name;
case 1:
return var_type;
case 2:
return vars;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
var_name = (ident)value;
break;
case 1:
var_type = (type_definition)value;
break;
case 2:
vars = (variant_types)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class procedure_call : statement
{
///
///Конструктор без параметров.
///
public procedure_call()
{
}
///
///Конструктор с параметрами.
///
public procedure_call(addressed_value _func_name)
{
this._func_name=_func_name;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public procedure_call(addressed_value _func_name,SourceContext sc)
{
this._func_name=_func_name;
source_context = sc;
FillParentsInDirectChilds();
}
protected addressed_value _func_name;
///
///
///
public addressed_value func_name
{
get
{
return _func_name;
}
set
{
_func_name=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
procedure_call copy = new procedure_call();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (func_name != null)
{
copy.func_name = (addressed_value)func_name.Clone();
copy.func_name.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new procedure_call TypedClone()
{
return Clone() as procedure_call;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (func_name != null)
func_name.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
func_name?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 1;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 1;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return func_name;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
func_name = (addressed_value)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class class_predefinition : type_declaration
{
///
///Конструктор без параметров.
///
public class_predefinition()
{
}
///
///Конструктор с параметрами.
///
public class_predefinition(ident _class_name)
{
this._class_name=_class_name;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public class_predefinition(ident _class_name,SourceContext sc)
{
this._class_name=_class_name;
source_context = sc;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public class_predefinition(ident _type_name,type_definition _type_def,ident _class_name)
{
this._type_name=_type_name;
this._type_def=_type_def;
this._class_name=_class_name;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public class_predefinition(ident _type_name,type_definition _type_def,ident _class_name,SourceContext sc)
{
this._type_name=_type_name;
this._type_def=_type_def;
this._class_name=_class_name;
source_context = sc;
FillParentsInDirectChilds();
}
protected ident _class_name;
///
///
///
public ident class_name
{
get
{
return _class_name;
}
set
{
_class_name=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
class_predefinition copy = new class_predefinition();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (type_name != null)
{
copy.type_name = (ident)type_name.Clone();
copy.type_name.Parent = copy;
}
if (type_def != null)
{
copy.type_def = (type_definition)type_def.Clone();
copy.type_def.Parent = copy;
}
if (class_name != null)
{
copy.class_name = (ident)class_name.Clone();
copy.class_name.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new class_predefinition TypedClone()
{
return Clone() as class_predefinition;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (type_name != null)
type_name.Parent = this;
if (type_def != null)
type_def.Parent = this;
if (class_name != null)
class_name.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
type_name?.FillParentsInAllChilds();
type_def?.FillParentsInAllChilds();
class_name?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 3;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 3;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return type_name;
case 1:
return type_def;
case 2:
return class_name;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
type_name = (ident)value;
break;
case 1:
type_def = (type_definition)value;
break;
case 2:
class_name = (ident)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class nil_const : const_node
{
///
///Конструктор без параметров.
///
public nil_const()
{
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
nil_const copy = new nil_const();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new nil_const TypedClone()
{
return Clone() as nil_const;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class file_type_definition : type_definition
{
///
///Конструктор без параметров.
///
public file_type_definition()
{
}
///
///Конструктор с параметрами.
///
public file_type_definition(type_definition _elem_type)
{
this._elem_type=_elem_type;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public file_type_definition(type_definition _elem_type,SourceContext sc)
{
this._elem_type=_elem_type;
source_context = sc;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public file_type_definition(type_definition_attr_list _attr_list,type_definition _elem_type)
{
this._attr_list=_attr_list;
this._elem_type=_elem_type;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public file_type_definition(type_definition_attr_list _attr_list,type_definition _elem_type,SourceContext sc)
{
this._attr_list=_attr_list;
this._elem_type=_elem_type;
source_context = sc;
FillParentsInDirectChilds();
}
protected type_definition _elem_type;
///
///
///
public type_definition elem_type
{
get
{
return _elem_type;
}
set
{
_elem_type=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
file_type_definition copy = new file_type_definition();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (attr_list != null)
{
copy.attr_list = (type_definition_attr_list)attr_list.Clone();
copy.attr_list.Parent = copy;
}
if (elem_type != null)
{
copy.elem_type = (type_definition)elem_type.Clone();
copy.elem_type.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new file_type_definition TypedClone()
{
return Clone() as file_type_definition;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (attr_list != null)
attr_list.Parent = this;
if (elem_type != null)
elem_type.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
attr_list?.FillParentsInAllChilds();
elem_type?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return attr_list;
case 1:
return elem_type;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
attr_list = (type_definition_attr_list)value;
break;
case 1:
elem_type = (type_definition)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class constructor : procedure_header
{
///
///Конструктор без параметров.
///
public constructor()
{
}
///
///Конструктор с параметрами.
///
public constructor(type_definition_attr_list _attr_list,formal_parameters _parameters,procedure_attributes_list _proc_attributes,method_name _name,bool _of_object,bool _class_keyword,ident_list _template_args,where_definition_list _where_defs)
{
this._attr_list=_attr_list;
this._parameters=_parameters;
this._proc_attributes=_proc_attributes;
this._name=_name;
this._of_object=_of_object;
this._class_keyword=_class_keyword;
this._template_args=_template_args;
this._where_defs=_where_defs;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public constructor(type_definition_attr_list _attr_list,formal_parameters _parameters,procedure_attributes_list _proc_attributes,method_name _name,bool _of_object,bool _class_keyword,ident_list _template_args,where_definition_list _where_defs,SourceContext sc)
{
this._attr_list=_attr_list;
this._parameters=_parameters;
this._proc_attributes=_proc_attributes;
this._name=_name;
this._of_object=_of_object;
this._class_keyword=_class_keyword;
this._template_args=_template_args;
this._where_defs=_where_defs;
source_context = sc;
FillParentsInDirectChilds();
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
constructor copy = new constructor();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (attr_list != null)
{
copy.attr_list = (type_definition_attr_list)attr_list.Clone();
copy.attr_list.Parent = copy;
}
if (parameters != null)
{
copy.parameters = (formal_parameters)parameters.Clone();
copy.parameters.Parent = copy;
}
if (proc_attributes != null)
{
copy.proc_attributes = (procedure_attributes_list)proc_attributes.Clone();
copy.proc_attributes.Parent = copy;
}
if (name != null)
{
copy.name = (method_name)name.Clone();
copy.name.Parent = copy;
}
copy.of_object = of_object;
copy.class_keyword = class_keyword;
if (template_args != null)
{
copy.template_args = (ident_list)template_args.Clone();
copy.template_args.Parent = copy;
}
if (where_defs != null)
{
copy.where_defs = (where_definition_list)where_defs.Clone();
copy.where_defs.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new constructor TypedClone()
{
return Clone() as constructor;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (attr_list != null)
attr_list.Parent = this;
if (parameters != null)
parameters.Parent = this;
if (proc_attributes != null)
proc_attributes.Parent = this;
if (name != null)
name.Parent = this;
if (template_args != null)
template_args.Parent = this;
if (where_defs != null)
where_defs.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
attr_list?.FillParentsInAllChilds();
parameters?.FillParentsInAllChilds();
proc_attributes?.FillParentsInAllChilds();
name?.FillParentsInAllChilds();
template_args?.FillParentsInAllChilds();
where_defs?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 6;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 6;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return attr_list;
case 1:
return parameters;
case 2:
return proc_attributes;
case 3:
return name;
case 4:
return template_args;
case 5:
return where_defs;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
attr_list = (type_definition_attr_list)value;
break;
case 1:
parameters = (formal_parameters)value;
break;
case 2:
proc_attributes = (procedure_attributes_list)value;
break;
case 3:
name = (method_name)value;
break;
case 4:
template_args = (ident_list)value;
break;
case 5:
where_defs = (where_definition_list)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class destructor : procedure_header
{
///
///Конструктор без параметров.
///
public destructor()
{
}
///
///Конструктор с параметрами.
///
public destructor(type_definition_attr_list _attr_list,formal_parameters _parameters,procedure_attributes_list _proc_attributes,method_name _name,bool _of_object,bool _class_keyword,ident_list _template_args,where_definition_list _where_defs)
{
this._attr_list=_attr_list;
this._parameters=_parameters;
this._proc_attributes=_proc_attributes;
this._name=_name;
this._of_object=_of_object;
this._class_keyword=_class_keyword;
this._template_args=_template_args;
this._where_defs=_where_defs;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public destructor(type_definition_attr_list _attr_list,formal_parameters _parameters,procedure_attributes_list _proc_attributes,method_name _name,bool _of_object,bool _class_keyword,ident_list _template_args,where_definition_list _where_defs,SourceContext sc)
{
this._attr_list=_attr_list;
this._parameters=_parameters;
this._proc_attributes=_proc_attributes;
this._name=_name;
this._of_object=_of_object;
this._class_keyword=_class_keyword;
this._template_args=_template_args;
this._where_defs=_where_defs;
source_context = sc;
FillParentsInDirectChilds();
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
destructor copy = new destructor();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (attr_list != null)
{
copy.attr_list = (type_definition_attr_list)attr_list.Clone();
copy.attr_list.Parent = copy;
}
if (parameters != null)
{
copy.parameters = (formal_parameters)parameters.Clone();
copy.parameters.Parent = copy;
}
if (proc_attributes != null)
{
copy.proc_attributes = (procedure_attributes_list)proc_attributes.Clone();
copy.proc_attributes.Parent = copy;
}
if (name != null)
{
copy.name = (method_name)name.Clone();
copy.name.Parent = copy;
}
copy.of_object = of_object;
copy.class_keyword = class_keyword;
if (template_args != null)
{
copy.template_args = (ident_list)template_args.Clone();
copy.template_args.Parent = copy;
}
if (where_defs != null)
{
copy.where_defs = (where_definition_list)where_defs.Clone();
copy.where_defs.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new destructor TypedClone()
{
return Clone() as destructor;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (attr_list != null)
attr_list.Parent = this;
if (parameters != null)
parameters.Parent = this;
if (proc_attributes != null)
proc_attributes.Parent = this;
if (name != null)
name.Parent = this;
if (template_args != null)
template_args.Parent = this;
if (where_defs != null)
where_defs.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
attr_list?.FillParentsInAllChilds();
parameters?.FillParentsInAllChilds();
proc_attributes?.FillParentsInAllChilds();
name?.FillParentsInAllChilds();
template_args?.FillParentsInAllChilds();
where_defs?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 6;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 6;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return attr_list;
case 1:
return parameters;
case 2:
return proc_attributes;
case 3:
return name;
case 4:
return template_args;
case 5:
return where_defs;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
attr_list = (type_definition_attr_list)value;
break;
case 1:
parameters = (formal_parameters)value;
break;
case 2:
proc_attributes = (procedure_attributes_list)value;
break;
case 3:
name = (method_name)value;
break;
case 4:
template_args = (ident_list)value;
break;
case 5:
where_defs = (where_definition_list)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class inherited_method_call : statement
{
///
///Конструктор без параметров.
///
public inherited_method_call()
{
}
///
///Конструктор с параметрами.
///
public inherited_method_call(ident _method_name,expression_list _exprs)
{
this._method_name=_method_name;
this._exprs=_exprs;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public inherited_method_call(ident _method_name,expression_list _exprs,SourceContext sc)
{
this._method_name=_method_name;
this._exprs=_exprs;
source_context = sc;
FillParentsInDirectChilds();
}
protected ident _method_name;
protected expression_list _exprs;
///
///
///
public ident method_name
{
get
{
return _method_name;
}
set
{
_method_name=value;
}
}
///
///
///
public expression_list exprs
{
get
{
return _exprs;
}
set
{
_exprs=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
inherited_method_call copy = new inherited_method_call();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (method_name != null)
{
copy.method_name = (ident)method_name.Clone();
copy.method_name.Parent = copy;
}
if (exprs != null)
{
copy.exprs = (expression_list)exprs.Clone();
copy.exprs.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new inherited_method_call TypedClone()
{
return Clone() as inherited_method_call;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (method_name != null)
method_name.Parent = this;
if (exprs != null)
exprs.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
method_name?.FillParentsInAllChilds();
exprs?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return method_name;
case 1:
return exprs;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
method_name = (ident)value;
break;
case 1:
exprs = (expression_list)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class typecast_node : addressed_value
{
///
///Конструктор без параметров.
///
public typecast_node()
{
}
///
///Конструктор с параметрами.
///
public typecast_node(addressed_value _expr,type_definition _type_def,op_typecast _cast_op)
{
this._expr=_expr;
this._type_def=_type_def;
this._cast_op=_cast_op;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public typecast_node(addressed_value _expr,type_definition _type_def,op_typecast _cast_op,SourceContext sc)
{
this._expr=_expr;
this._type_def=_type_def;
this._cast_op=_cast_op;
source_context = sc;
FillParentsInDirectChilds();
}
protected addressed_value _expr;
protected type_definition _type_def;
protected op_typecast _cast_op;
///
///
///
public addressed_value expr
{
get
{
return _expr;
}
set
{
_expr=value;
}
}
///
///
///
public type_definition type_def
{
get
{
return _type_def;
}
set
{
_type_def=value;
}
}
///
///
///
public op_typecast cast_op
{
get
{
return _cast_op;
}
set
{
_cast_op=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
typecast_node copy = new typecast_node();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (expr != null)
{
copy.expr = (addressed_value)expr.Clone();
copy.expr.Parent = copy;
}
if (type_def != null)
{
copy.type_def = (type_definition)type_def.Clone();
copy.type_def.Parent = copy;
}
copy.cast_op = cast_op;
return copy;
}
/// Получает копию данного узла корректного типа
public new typecast_node TypedClone()
{
return Clone() as typecast_node;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (expr != null)
expr.Parent = this;
if (type_def != null)
type_def.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
expr?.FillParentsInAllChilds();
type_def?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return expr;
case 1:
return type_def;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
expr = (addressed_value)value;
break;
case 1:
type_def = (type_definition)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class interface_node : syntax_tree_node
{
///
///Конструктор без параметров.
///
public interface_node()
{
}
///
///Конструктор с параметрами.
///
public interface_node(declarations _interface_definitions,uses_list _uses_modules,using_list _using_namespaces)
{
this._interface_definitions=_interface_definitions;
this._uses_modules=_uses_modules;
this._using_namespaces=_using_namespaces;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public interface_node(declarations _interface_definitions,uses_list _uses_modules,using_list _using_namespaces,SourceContext sc)
{
this._interface_definitions=_interface_definitions;
this._uses_modules=_uses_modules;
this._using_namespaces=_using_namespaces;
source_context = sc;
FillParentsInDirectChilds();
}
protected declarations _interface_definitions;
protected uses_list _uses_modules;
protected using_list _using_namespaces;
///
///
///
public declarations interface_definitions
{
get
{
return _interface_definitions;
}
set
{
_interface_definitions=value;
}
}
///
///
///
public uses_list uses_modules
{
get
{
return _uses_modules;
}
set
{
_uses_modules=value;
}
}
///
///
///
public using_list using_namespaces
{
get
{
return _using_namespaces;
}
set
{
_using_namespaces=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
interface_node copy = new interface_node();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (interface_definitions != null)
{
copy.interface_definitions = (declarations)interface_definitions.Clone();
copy.interface_definitions.Parent = copy;
}
if (uses_modules != null)
{
copy.uses_modules = (uses_list)uses_modules.Clone();
copy.uses_modules.Parent = copy;
}
if (using_namespaces != null)
{
copy.using_namespaces = (using_list)using_namespaces.Clone();
copy.using_namespaces.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new interface_node TypedClone()
{
return Clone() as interface_node;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (interface_definitions != null)
interface_definitions.Parent = this;
if (uses_modules != null)
uses_modules.Parent = this;
if (using_namespaces != null)
using_namespaces.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
interface_definitions?.FillParentsInAllChilds();
uses_modules?.FillParentsInAllChilds();
using_namespaces?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 3;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 3;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return interface_definitions;
case 1:
return uses_modules;
case 2:
return using_namespaces;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
interface_definitions = (declarations)value;
break;
case 1:
uses_modules = (uses_list)value;
break;
case 2:
using_namespaces = (using_list)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class implementation_node : syntax_tree_node
{
///
///Конструктор без параметров.
///
public implementation_node()
{
}
///
///Конструктор с параметрами.
///
public implementation_node(uses_list _uses_modules,declarations _implementation_definitions,using_list _using_namespaces)
{
this._uses_modules=_uses_modules;
this._implementation_definitions=_implementation_definitions;
this._using_namespaces=_using_namespaces;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public implementation_node(uses_list _uses_modules,declarations _implementation_definitions,using_list _using_namespaces,SourceContext sc)
{
this._uses_modules=_uses_modules;
this._implementation_definitions=_implementation_definitions;
this._using_namespaces=_using_namespaces;
source_context = sc;
FillParentsInDirectChilds();
}
protected uses_list _uses_modules;
protected declarations _implementation_definitions;
protected using_list _using_namespaces;
///
///
///
public uses_list uses_modules
{
get
{
return _uses_modules;
}
set
{
_uses_modules=value;
}
}
///
///
///
public declarations implementation_definitions
{
get
{
return _implementation_definitions;
}
set
{
_implementation_definitions=value;
}
}
///
///
///
public using_list using_namespaces
{
get
{
return _using_namespaces;
}
set
{
_using_namespaces=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
implementation_node copy = new implementation_node();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (uses_modules != null)
{
copy.uses_modules = (uses_list)uses_modules.Clone();
copy.uses_modules.Parent = copy;
}
if (implementation_definitions != null)
{
copy.implementation_definitions = (declarations)implementation_definitions.Clone();
copy.implementation_definitions.Parent = copy;
}
if (using_namespaces != null)
{
copy.using_namespaces = (using_list)using_namespaces.Clone();
copy.using_namespaces.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new implementation_node TypedClone()
{
return Clone() as implementation_node;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (uses_modules != null)
uses_modules.Parent = this;
if (implementation_definitions != null)
implementation_definitions.Parent = this;
if (using_namespaces != null)
using_namespaces.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
uses_modules?.FillParentsInAllChilds();
implementation_definitions?.FillParentsInAllChilds();
using_namespaces?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 3;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 3;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return uses_modules;
case 1:
return implementation_definitions;
case 2:
return using_namespaces;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
uses_modules = (uses_list)value;
break;
case 1:
implementation_definitions = (declarations)value;
break;
case 2:
using_namespaces = (using_list)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class diap_expr : expression
{
///
///Конструктор без параметров.
///
public diap_expr()
{
}
///
///Конструктор с параметрами.
///
public diap_expr(expression _left,expression _right)
{
this._left=_left;
this._right=_right;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public diap_expr(expression _left,expression _right,SourceContext sc)
{
this._left=_left;
this._right=_right;
source_context = sc;
FillParentsInDirectChilds();
}
protected expression _left;
protected expression _right;
///
///
///
public expression left
{
get
{
return _left;
}
set
{
_left=value;
}
}
///
///
///
public expression right
{
get
{
return _right;
}
set
{
_right=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
diap_expr copy = new diap_expr();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (left != null)
{
copy.left = (expression)left.Clone();
copy.left.Parent = copy;
}
if (right != null)
{
copy.right = (expression)right.Clone();
copy.right.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new diap_expr TypedClone()
{
return Clone() as diap_expr;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (left != null)
left.Parent = this;
if (right != null)
right.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
left?.FillParentsInAllChilds();
right?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return left;
case 1:
return right;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
left = (expression)value;
break;
case 1:
right = (expression)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class block : proc_block
{
///
///Конструктор без параметров.
///
public block()
{
}
///
///Конструктор с параметрами.
///
public block(declarations _defs,statement_list _program_code)
{
this._defs=_defs;
this._program_code=_program_code;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public block(declarations _defs,statement_list _program_code,SourceContext sc)
{
this._defs=_defs;
this._program_code=_program_code;
source_context = sc;
FillParentsInDirectChilds();
}
protected declarations _defs;
protected statement_list _program_code;
///
///
///
public declarations defs
{
get
{
return _defs;
}
set
{
_defs=value;
}
}
///
///
///
public statement_list program_code
{
get
{
return _program_code;
}
set
{
_program_code=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
block copy = new block();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (defs != null)
{
copy.defs = (declarations)defs.Clone();
copy.defs.Parent = copy;
}
if (program_code != null)
{
copy.program_code = (statement_list)program_code.Clone();
copy.program_code.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new block TypedClone()
{
return Clone() as block;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (defs != null)
defs.Parent = this;
if (program_code != null)
program_code.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
defs?.FillParentsInAllChilds();
program_code?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return defs;
case 1:
return program_code;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
defs = (declarations)value;
break;
case 1:
program_code = (statement_list)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class proc_block : syntax_tree_node
{
///
///Конструктор без параметров.
///
public proc_block()
{
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
proc_block copy = new proc_block();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
return copy;
}
/// Получает копию данного узла корректного типа
public new proc_block TypedClone()
{
return Clone() as proc_block;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///array of type_name
///
[Serializable]
public partial class array_of_named_type_definition : type_definition
{
///
///Конструктор без параметров.
///
public array_of_named_type_definition()
{
}
///
///Конструктор с параметрами.
///
public array_of_named_type_definition(named_type_reference _type_name)
{
this._type_name=_type_name;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public array_of_named_type_definition(named_type_reference _type_name,SourceContext sc)
{
this._type_name=_type_name;
source_context = sc;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public array_of_named_type_definition(type_definition_attr_list _attr_list,named_type_reference _type_name)
{
this._attr_list=_attr_list;
this._type_name=_type_name;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public array_of_named_type_definition(type_definition_attr_list _attr_list,named_type_reference _type_name,SourceContext sc)
{
this._attr_list=_attr_list;
this._type_name=_type_name;
source_context = sc;
FillParentsInDirectChilds();
}
protected named_type_reference _type_name;
///
///
///
public named_type_reference type_name
{
get
{
return _type_name;
}
set
{
_type_name=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
array_of_named_type_definition copy = new array_of_named_type_definition();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (attr_list != null)
{
copy.attr_list = (type_definition_attr_list)attr_list.Clone();
copy.attr_list.Parent = copy;
}
if (type_name != null)
{
copy.type_name = (named_type_reference)type_name.Clone();
copy.type_name.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new array_of_named_type_definition TypedClone()
{
return Clone() as array_of_named_type_definition;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (attr_list != null)
attr_list.Parent = this;
if (type_name != null)
type_name.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
attr_list?.FillParentsInAllChilds();
type_name?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return attr_list;
case 1:
return type_name;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
attr_list = (type_definition_attr_list)value;
break;
case 1:
type_name = (named_type_reference)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///array of const
///
[Serializable]
public partial class array_of_const_type_definition : type_definition
{
///
///Конструктор без параметров.
///
public array_of_const_type_definition()
{
}
///
///Конструктор с параметрами.
///
public array_of_const_type_definition(type_definition_attr_list _attr_list)
{
this._attr_list=_attr_list;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public array_of_const_type_definition(type_definition_attr_list _attr_list,SourceContext sc)
{
this._attr_list=_attr_list;
source_context = sc;
FillParentsInDirectChilds();
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
array_of_const_type_definition copy = new array_of_const_type_definition();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (attr_list != null)
{
copy.attr_list = (type_definition_attr_list)attr_list.Clone();
copy.attr_list.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new array_of_const_type_definition TypedClone()
{
return Clone() as array_of_const_type_definition;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (attr_list != null)
attr_list.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
attr_list?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 1;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 1;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return attr_list;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
attr_list = (type_definition_attr_list)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///#12 либо 'abc'
///
[Serializable]
public partial class literal : const_node
{
///
///Конструктор без параметров.
///
public literal()
{
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
literal copy = new literal();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new literal TypedClone()
{
return Clone() as literal;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class case_variants : syntax_tree_node
{
///
///Конструктор без параметров.
///
public case_variants()
{
}
///
///Конструктор с параметрами.
///
public case_variants(List _variants)
{
this._variants=_variants;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public case_variants(List _variants,SourceContext sc)
{
this._variants=_variants;
source_context = sc;
FillParentsInDirectChilds();
}
public case_variants(case_variant elem, SourceContext sc = null)
{
Add(elem, sc);
FillParentsInDirectChilds();
}
protected List _variants=new List();
///
///
///
public List variants
{
get
{
return _variants;
}
set
{
_variants=value;
}
}
public case_variants Add(case_variant elem, SourceContext sc = null)
{
variants.Add(elem);
if (elem != null)
elem.Parent = this;
if (sc != null)
source_context = sc;
return this;
}
public void AddFirst(case_variant el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
variants.Insert(0, el);
FillParentsInDirectChilds();
}
public void AddFirst(IEnumerable els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
variants.InsertRange(0, els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
public void AddMany(params case_variant[] els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
variants.AddRange(els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
private int FindIndexInList(case_variant el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
var ind = variants.FindIndex(x => x == el);
if (ind == -1)
throw new Exception(string.Format("У списка {0} не найден элемент {1} среди дочерних\n", this, el));
return ind;
}
public void InsertAfter(case_variant el, case_variant newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
variants.Insert(FindIndexInList(el) + 1, newel);
newel.Parent = this;
}
public void InsertAfter(case_variant el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
variants.InsertRange(FindIndexInList(el) + 1, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public void InsertBefore(case_variant el, case_variant newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
variants.Insert(FindIndexInList(el), newel);
newel.Parent = this;
}
public void InsertBefore(case_variant el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
variants.InsertRange(FindIndexInList(el), newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public bool Remove(case_variant el)
{
return variants.Remove(el);
}
public void ReplaceInList(case_variant el, case_variant newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
variants[FindIndexInList(el)] = newel;
newel.Parent = this;
}
public void ReplaceInList(case_variant el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
var ind = FindIndexInList(el);
variants.RemoveAt(ind);
variants.InsertRange(ind, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public int RemoveAll(Predicate match)
{
return variants.RemoveAll(match);
}
public case_variant Last()
{
if (variants.Count > 0)
return variants[variants.Count - 1];
throw new InvalidOperationException("Список пуст");
}
public int Count
{
get { return variants.Count; }
}
public void Insert(int pos, case_variant el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
variants.Insert(pos,el);
if (el != null)
el.Parent = this;
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
case_variants copy = new case_variants();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (variants != null)
{
foreach (case_variant elem in variants)
{
if (elem != null)
{
copy.Add((case_variant)elem.Clone());
copy.Last().Parent = copy;
}
else
copy.Add(null);
}
}
return copy;
}
/// Получает копию данного узла корректного типа
public new case_variants TypedClone()
{
return Clone() as case_variants;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (variants != null)
{
foreach (var child in variants)
if (child != null)
child.Parent = this;
}
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
if (variants != null)
{
foreach (var child in variants)
child?.FillParentsInAllChilds();
}
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0 + (variants == null ? 0 : variants.Count);
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(variants != null)
{
if(index_counter < variants.Count)
{
return variants[index_counter];
}
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(variants != null)
{
if(index_counter < variants.Count)
{
variants[index_counter]= (case_variant)value;
return;
}
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class diapason_expr : expression
{
///
///Конструктор без параметров.
///
public diapason_expr()
{
}
///
///Конструктор с параметрами.
///
public diapason_expr(expression _left,expression _right)
{
this._left=_left;
this._right=_right;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public diapason_expr(expression _left,expression _right,SourceContext sc)
{
this._left=_left;
this._right=_right;
source_context = sc;
FillParentsInDirectChilds();
}
protected expression _left;
protected expression _right;
///
///
///
public expression left
{
get
{
return _left;
}
set
{
_left=value;
}
}
///
///
///
public expression right
{
get
{
return _right;
}
set
{
_right=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
diapason_expr copy = new diapason_expr();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (left != null)
{
copy.left = (expression)left.Clone();
copy.left.Parent = copy;
}
if (right != null)
{
copy.right = (expression)right.Clone();
copy.right.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new diapason_expr TypedClone()
{
return Clone() as diapason_expr;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (left != null)
left.Parent = this;
if (right != null)
right.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
left?.FillParentsInAllChilds();
right?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return left;
case 1:
return right;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
left = (expression)value;
break;
case 1:
right = (expression)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class var_def_list_for_record : syntax_tree_node
{
///
///Конструктор без параметров.
///
public var_def_list_for_record()
{
}
///
///Конструктор с параметрами.
///
public var_def_list_for_record(List _vars)
{
this._vars=_vars;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public var_def_list_for_record(List _vars,SourceContext sc)
{
this._vars=_vars;
source_context = sc;
FillParentsInDirectChilds();
}
public var_def_list_for_record(var_def_statement elem, SourceContext sc = null)
{
Add(elem, sc);
FillParentsInDirectChilds();
}
protected List _vars=new List();
///
///
///
public List vars
{
get
{
return _vars;
}
set
{
_vars=value;
}
}
public var_def_list_for_record Add(var_def_statement elem, SourceContext sc = null)
{
vars.Add(elem);
if (elem != null)
elem.Parent = this;
if (sc != null)
source_context = sc;
return this;
}
public void AddFirst(var_def_statement el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
vars.Insert(0, el);
FillParentsInDirectChilds();
}
public void AddFirst(IEnumerable els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
vars.InsertRange(0, els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
public void AddMany(params var_def_statement[] els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
vars.AddRange(els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
private int FindIndexInList(var_def_statement el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
var ind = vars.FindIndex(x => x == el);
if (ind == -1)
throw new Exception(string.Format("У списка {0} не найден элемент {1} среди дочерних\n", this, el));
return ind;
}
public void InsertAfter(var_def_statement el, var_def_statement newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
vars.Insert(FindIndexInList(el) + 1, newel);
newel.Parent = this;
}
public void InsertAfter(var_def_statement el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
vars.InsertRange(FindIndexInList(el) + 1, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public void InsertBefore(var_def_statement el, var_def_statement newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
vars.Insert(FindIndexInList(el), newel);
newel.Parent = this;
}
public void InsertBefore(var_def_statement el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
vars.InsertRange(FindIndexInList(el), newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public bool Remove(var_def_statement el)
{
return vars.Remove(el);
}
public void ReplaceInList(var_def_statement el, var_def_statement newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
vars[FindIndexInList(el)] = newel;
newel.Parent = this;
}
public void ReplaceInList(var_def_statement el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
var ind = FindIndexInList(el);
vars.RemoveAt(ind);
vars.InsertRange(ind, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public int RemoveAll(Predicate match)
{
return vars.RemoveAll(match);
}
public var_def_statement Last()
{
if (vars.Count > 0)
return vars[vars.Count - 1];
throw new InvalidOperationException("Список пуст");
}
public int Count
{
get { return vars.Count; }
}
public void Insert(int pos, var_def_statement el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
vars.Insert(pos,el);
if (el != null)
el.Parent = this;
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
var_def_list_for_record copy = new var_def_list_for_record();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (vars != null)
{
foreach (var_def_statement elem in vars)
{
if (elem != null)
{
copy.Add((var_def_statement)elem.Clone());
copy.Last().Parent = copy;
}
else
copy.Add(null);
}
}
return copy;
}
/// Получает копию данного узла корректного типа
public new var_def_list_for_record TypedClone()
{
return Clone() as var_def_list_for_record;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (vars != null)
{
foreach (var child in vars)
if (child != null)
child.Parent = this;
}
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
if (vars != null)
{
foreach (var child in vars)
child?.FillParentsInAllChilds();
}
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0 + (vars == null ? 0 : vars.Count);
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(vars != null)
{
if(index_counter < vars.Count)
{
return vars[index_counter];
}
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(vars != null)
{
if(index_counter < vars.Count)
{
vars[index_counter]= (var_def_statement)value;
return;
}
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class record_type_parts : syntax_tree_node
{
///
///Конструктор без параметров.
///
public record_type_parts()
{
}
///
///Конструктор с параметрами.
///
public record_type_parts(var_def_list_for_record _fixed_part,variant_record_type _variant_part)
{
this._fixed_part=_fixed_part;
this._variant_part=_variant_part;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public record_type_parts(var_def_list_for_record _fixed_part,variant_record_type _variant_part,SourceContext sc)
{
this._fixed_part=_fixed_part;
this._variant_part=_variant_part;
source_context = sc;
FillParentsInDirectChilds();
}
protected var_def_list_for_record _fixed_part;
protected variant_record_type _variant_part;
///
///
///
public var_def_list_for_record fixed_part
{
get
{
return _fixed_part;
}
set
{
_fixed_part=value;
}
}
///
///
///
public variant_record_type variant_part
{
get
{
return _variant_part;
}
set
{
_variant_part=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
record_type_parts copy = new record_type_parts();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (fixed_part != null)
{
copy.fixed_part = (var_def_list_for_record)fixed_part.Clone();
copy.fixed_part.Parent = copy;
}
if (variant_part != null)
{
copy.variant_part = (variant_record_type)variant_part.Clone();
copy.variant_part.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new record_type_parts TypedClone()
{
return Clone() as record_type_parts;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (fixed_part != null)
fixed_part.Parent = this;
if (variant_part != null)
variant_part.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
fixed_part?.FillParentsInAllChilds();
variant_part?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return fixed_part;
case 1:
return variant_part;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
fixed_part = (var_def_list_for_record)value;
break;
case 1:
variant_part = (variant_record_type)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class property_array_default : syntax_tree_node
{
///
///Конструктор без параметров.
///
public property_array_default()
{
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
property_array_default copy = new property_array_default();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
return copy;
}
/// Получает копию данного узла корректного типа
public new property_array_default TypedClone()
{
return Clone() as property_array_default;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class property_interface : syntax_tree_node
{
///
///Конструктор без параметров.
///
public property_interface()
{
}
///
///Конструктор с параметрами.
///
public property_interface(property_parameter_list _parameter_list,type_definition _property_type,expression _index_expression)
{
this._parameter_list=_parameter_list;
this._property_type=_property_type;
this._index_expression=_index_expression;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public property_interface(property_parameter_list _parameter_list,type_definition _property_type,expression _index_expression,SourceContext sc)
{
this._parameter_list=_parameter_list;
this._property_type=_property_type;
this._index_expression=_index_expression;
source_context = sc;
FillParentsInDirectChilds();
}
protected property_parameter_list _parameter_list;
protected type_definition _property_type;
protected expression _index_expression;
///
///
///
public property_parameter_list parameter_list
{
get
{
return _parameter_list;
}
set
{
_parameter_list=value;
}
}
///
///
///
public type_definition property_type
{
get
{
return _property_type;
}
set
{
_property_type=value;
}
}
///
///
///
public expression index_expression
{
get
{
return _index_expression;
}
set
{
_index_expression=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
property_interface copy = new property_interface();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (parameter_list != null)
{
copy.parameter_list = (property_parameter_list)parameter_list.Clone();
copy.parameter_list.Parent = copy;
}
if (property_type != null)
{
copy.property_type = (type_definition)property_type.Clone();
copy.property_type.Parent = copy;
}
if (index_expression != null)
{
copy.index_expression = (expression)index_expression.Clone();
copy.index_expression.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new property_interface TypedClone()
{
return Clone() as property_interface;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (parameter_list != null)
parameter_list.Parent = this;
if (property_type != null)
property_type.Parent = this;
if (index_expression != null)
index_expression.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
parameter_list?.FillParentsInAllChilds();
property_type?.FillParentsInAllChilds();
index_expression?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 3;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 3;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return parameter_list;
case 1:
return property_type;
case 2:
return index_expression;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
parameter_list = (property_parameter_list)value;
break;
case 1:
property_type = (type_definition)value;
break;
case 2:
index_expression = (expression)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class property_parameter : syntax_tree_node
{
///
///Конструктор без параметров.
///
public property_parameter()
{
}
///
///Конструктор с параметрами.
///
public property_parameter(ident_list _names,type_definition _type)
{
this._names=_names;
this._type=_type;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public property_parameter(ident_list _names,type_definition _type,SourceContext sc)
{
this._names=_names;
this._type=_type;
source_context = sc;
FillParentsInDirectChilds();
}
protected ident_list _names;
protected type_definition _type;
///
///
///
public ident_list names
{
get
{
return _names;
}
set
{
_names=value;
}
}
///
///
///
public type_definition type
{
get
{
return _type;
}
set
{
_type=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
property_parameter copy = new property_parameter();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (names != null)
{
copy.names = (ident_list)names.Clone();
copy.names.Parent = copy;
}
if (type != null)
{
copy.type = (type_definition)type.Clone();
copy.type.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new property_parameter TypedClone()
{
return Clone() as property_parameter;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (names != null)
names.Parent = this;
if (type != null)
type.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
names?.FillParentsInAllChilds();
type?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return names;
case 1:
return type;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
names = (ident_list)value;
break;
case 1:
type = (type_definition)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class property_parameter_list : syntax_tree_node
{
///
///Конструктор без параметров.
///
public property_parameter_list()
{
}
///
///Конструктор с параметрами.
///
public property_parameter_list(List _parameters)
{
this._parameters=_parameters;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public property_parameter_list(List _parameters,SourceContext sc)
{
this._parameters=_parameters;
source_context = sc;
FillParentsInDirectChilds();
}
public property_parameter_list(property_parameter elem, SourceContext sc = null)
{
Add(elem, sc);
FillParentsInDirectChilds();
}
protected List _parameters=new List();
///
///
///
public List parameters
{
get
{
return _parameters;
}
set
{
_parameters=value;
}
}
public property_parameter_list Add(property_parameter elem, SourceContext sc = null)
{
parameters.Add(elem);
if (elem != null)
elem.Parent = this;
if (sc != null)
source_context = sc;
return this;
}
public void AddFirst(property_parameter el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
parameters.Insert(0, el);
FillParentsInDirectChilds();
}
public void AddFirst(IEnumerable els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
parameters.InsertRange(0, els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
public void AddMany(params property_parameter[] els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
parameters.AddRange(els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
private int FindIndexInList(property_parameter el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
var ind = parameters.FindIndex(x => x == el);
if (ind == -1)
throw new Exception(string.Format("У списка {0} не найден элемент {1} среди дочерних\n", this, el));
return ind;
}
public void InsertAfter(property_parameter el, property_parameter newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
parameters.Insert(FindIndexInList(el) + 1, newel);
newel.Parent = this;
}
public void InsertAfter(property_parameter el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
parameters.InsertRange(FindIndexInList(el) + 1, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public void InsertBefore(property_parameter el, property_parameter newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
parameters.Insert(FindIndexInList(el), newel);
newel.Parent = this;
}
public void InsertBefore(property_parameter el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
parameters.InsertRange(FindIndexInList(el), newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public bool Remove(property_parameter el)
{
return parameters.Remove(el);
}
public void ReplaceInList(property_parameter el, property_parameter newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
parameters[FindIndexInList(el)] = newel;
newel.Parent = this;
}
public void ReplaceInList(property_parameter el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
var ind = FindIndexInList(el);
parameters.RemoveAt(ind);
parameters.InsertRange(ind, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public int RemoveAll(Predicate match)
{
return parameters.RemoveAll(match);
}
public property_parameter Last()
{
if (parameters.Count > 0)
return parameters[parameters.Count - 1];
throw new InvalidOperationException("Список пуст");
}
public int Count
{
get { return parameters.Count; }
}
public void Insert(int pos, property_parameter el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
parameters.Insert(pos,el);
if (el != null)
el.Parent = this;
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
property_parameter_list copy = new property_parameter_list();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (parameters != null)
{
foreach (property_parameter elem in parameters)
{
if (elem != null)
{
copy.Add((property_parameter)elem.Clone());
copy.Last().Parent = copy;
}
else
copy.Add(null);
}
}
return copy;
}
/// Получает копию данного узла корректного типа
public new property_parameter_list TypedClone()
{
return Clone() as property_parameter_list;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (parameters != null)
{
foreach (var child in parameters)
if (child != null)
child.Parent = this;
}
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
if (parameters != null)
{
foreach (var child in parameters)
child?.FillParentsInAllChilds();
}
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0 + (parameters == null ? 0 : parameters.Count);
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(parameters != null)
{
if(index_counter < parameters.Count)
{
return parameters[index_counter];
}
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
Int32 index_counter=ind - 0;
if(parameters != null)
{
if(index_counter < parameters.Count)
{
parameters[index_counter]= (property_parameter)value;
return;
}
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class inherited_ident : ident
{
///
///Конструктор без параметров.
///
public inherited_ident()
{
}
///
///Конструктор с параметрами.
///
public inherited_ident(string _name)
{
this._name=_name;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public inherited_ident(string _name,SourceContext sc)
{
this._name=_name;
source_context = sc;
FillParentsInDirectChilds();
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
inherited_ident copy = new inherited_ident();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
copy.name = name;
return copy;
}
/// Получает копию данного узла корректного типа
public new inherited_ident TypedClone()
{
return Clone() as inherited_ident;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///expr:1:2
///
[Serializable]
public partial class format_expr : addressed_value
{
///
///Конструктор без параметров.
///
public format_expr()
{
}
///
///Конструктор с параметрами.
///
public format_expr(expression _expr,expression _format1,expression _format2)
{
this._expr=_expr;
this._format1=_format1;
this._format2=_format2;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public format_expr(expression _expr,expression _format1,expression _format2,SourceContext sc)
{
this._expr=_expr;
this._format1=_format1;
this._format2=_format2;
source_context = sc;
FillParentsInDirectChilds();
}
protected expression _expr;
protected expression _format1;
protected expression _format2;
///
///
///
public expression expr
{
get
{
return _expr;
}
set
{
_expr=value;
}
}
///
///
///
public expression format1
{
get
{
return _format1;
}
set
{
_format1=value;
}
}
///
///
///
public expression format2
{
get
{
return _format2;
}
set
{
_format2=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
format_expr copy = new format_expr();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (expr != null)
{
copy.expr = (expression)expr.Clone();
copy.expr.Parent = copy;
}
if (format1 != null)
{
copy.format1 = (expression)format1.Clone();
copy.format1.Parent = copy;
}
if (format2 != null)
{
copy.format2 = (expression)format2.Clone();
copy.format2.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new format_expr TypedClone()
{
return Clone() as format_expr;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (expr != null)
expr.Parent = this;
if (format1 != null)
format1.Parent = this;
if (format2 != null)
format2.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
expr?.FillParentsInAllChilds();
format1?.FillParentsInAllChilds();
format2?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 3;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 3;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return expr;
case 1:
return format1;
case 2:
return format2;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
expr = (expression)value;
break;
case 1:
format1 = (expression)value;
break;
case 2:
format2 = (expression)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class initfinal_part : syntax_tree_node
{
///
///Конструктор без параметров.
///
public initfinal_part()
{
}
///
///Конструктор с параметрами.
///
public initfinal_part(statement_list _initialization_sect,statement_list _finalization_sect)
{
this._initialization_sect=_initialization_sect;
this._finalization_sect=_finalization_sect;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public initfinal_part(statement_list _initialization_sect,statement_list _finalization_sect,SourceContext sc)
{
this._initialization_sect=_initialization_sect;
this._finalization_sect=_finalization_sect;
source_context = sc;
FillParentsInDirectChilds();
}
protected statement_list _initialization_sect;
protected statement_list _finalization_sect;
///
///
///
public statement_list initialization_sect
{
get
{
return _initialization_sect;
}
set
{
_initialization_sect=value;
}
}
///
///
///
public statement_list finalization_sect
{
get
{
return _finalization_sect;
}
set
{
_finalization_sect=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
initfinal_part copy = new initfinal_part();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (initialization_sect != null)
{
copy.initialization_sect = (statement_list)initialization_sect.Clone();
copy.initialization_sect.Parent = copy;
}
if (finalization_sect != null)
{
copy.finalization_sect = (statement_list)finalization_sect.Clone();
copy.finalization_sect.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new initfinal_part TypedClone()
{
return Clone() as initfinal_part;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (initialization_sect != null)
initialization_sect.Parent = this;
if (finalization_sect != null)
finalization_sect.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
initialization_sect?.FillParentsInAllChilds();
finalization_sect?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return initialization_sect;
case 1:
return finalization_sect;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
initialization_sect = (statement_list)value;
break;
case 1:
finalization_sect = (statement_list)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class token_info : syntax_tree_node
{
///
///Конструктор без параметров.
///
public token_info()
{
}
///
///Конструктор с параметрами.
///
public token_info(string _text)
{
this._text=_text;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public token_info(string _text,SourceContext sc)
{
this._text=_text;
source_context = sc;
FillParentsInDirectChilds();
}
protected string _text;
///
///
///
public string text
{
get
{
return _text;
}
set
{
_text=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
token_info copy = new token_info();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
copy.text = text;
return copy;
}
/// Получает копию данного узла корректного типа
public new token_info TypedClone()
{
return Clone() as token_info;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///raise [expr [at address]]
///
[Serializable]
public partial class raise_stmt : statement
{
///
///Конструктор без параметров.
///
public raise_stmt()
{
}
///
///Конструктор с параметрами.
///
public raise_stmt(expression _expr,expression _address)
{
this._expr=_expr;
this._address=_address;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public raise_stmt(expression _expr,expression _address,SourceContext sc)
{
this._expr=_expr;
this._address=_address;
source_context = sc;
FillParentsInDirectChilds();
}
protected expression _expr;
protected expression _address;
///
///
///
public expression expr
{
get
{
return _expr;
}
set
{
_expr=value;
}
}
///
///
///
public expression address
{
get
{
return _address;
}
set
{
_address=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
raise_stmt copy = new raise_stmt();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (expr != null)
{
copy.expr = (expression)expr.Clone();
copy.expr.Parent = copy;
}
if (address != null)
{
copy.address = (expression)address.Clone();
copy.address.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new raise_stmt TypedClone()
{
return Clone() as raise_stmt;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (expr != null)
expr.Parent = this;
if (address != null)
address.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
expr?.FillParentsInAllChilds();
address?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return expr;
case 1:
return address;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
expr = (expression)value;
break;
case 1:
address = (expression)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class op_type_node : token_info
{
///
///Конструктор без параметров.
///
public op_type_node()
{
}
///
///Конструктор с параметрами.
///
public op_type_node(Operators _type)
{
this._type=_type;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public op_type_node(Operators _type,SourceContext sc)
{
this._type=_type;
source_context = sc;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public op_type_node(string _text,Operators _type)
{
this._text=_text;
this._type=_type;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public op_type_node(string _text,Operators _type,SourceContext sc)
{
this._text=_text;
this._type=_type;
source_context = sc;
FillParentsInDirectChilds();
}
protected Operators _type;
///
///
///
public Operators type
{
get
{
return _type;
}
set
{
_type=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
op_type_node copy = new op_type_node();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
copy.text = text;
copy.type = type;
return copy;
}
/// Получает копию данного узла корректного типа
public new op_type_node TypedClone()
{
return Clone() as op_type_node;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class file_type : type_definition
{
///
///Конструктор без параметров.
///
public file_type()
{
}
///
///Конструктор с параметрами.
///
public file_type(type_definition _file_of_type)
{
this._file_of_type=_file_of_type;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public file_type(type_definition _file_of_type,SourceContext sc)
{
this._file_of_type=_file_of_type;
source_context = sc;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public file_type(type_definition_attr_list _attr_list,type_definition _file_of_type)
{
this._attr_list=_attr_list;
this._file_of_type=_file_of_type;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public file_type(type_definition_attr_list _attr_list,type_definition _file_of_type,SourceContext sc)
{
this._attr_list=_attr_list;
this._file_of_type=_file_of_type;
source_context = sc;
FillParentsInDirectChilds();
}
protected type_definition _file_of_type;
///
///
///
public type_definition file_of_type
{
get
{
return _file_of_type;
}
set
{
_file_of_type=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
file_type copy = new file_type();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
if (attr_list != null)
{
copy.attr_list = (type_definition_attr_list)attr_list.Clone();
copy.attr_list.Parent = copy;
}
if (file_of_type != null)
{
copy.file_of_type = (type_definition)file_of_type.Clone();
copy.file_of_type.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new file_type TypedClone()
{
return Clone() as file_type;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (attr_list != null)
attr_list.Parent = this;
if (file_of_type != null)
file_of_type.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
attr_list?.FillParentsInAllChilds();
file_of_type?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return attr_list;
case 1:
return file_of_type;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
attr_list = (type_definition_attr_list)value;
break;
case 1:
file_of_type = (type_definition)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class known_type_ident : ident
{
///
///Конструктор без параметров.
///
public known_type_ident()
{
}
///
///Конструктор с параметрами.
///
public known_type_ident(known_type _type)
{
this._type=_type;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public known_type_ident(known_type _type,SourceContext sc)
{
this._type=_type;
source_context = sc;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public known_type_ident(string _name,known_type _type)
{
this._name=_name;
this._type=_type;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public known_type_ident(string _name,known_type _type,SourceContext sc)
{
this._name=_name;
this._type=_type;
source_context = sc;
FillParentsInDirectChilds();
}
protected known_type _type;
///
///
///
public known_type type
{
get
{
return _type;
}
set
{
_type=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
known_type_ident copy = new known_type_ident();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
copy.name = name;
copy.type = type;
return copy;
}
/// Получает копию данного узла корректного типа
public new known_type_ident TypedClone()
{
return Clone() as known_type_ident;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 0;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class exception_handler : syntax_tree_node
{
///
///Конструктор без параметров.
///
public exception_handler()
{
}
///
///Конструктор с параметрами.
///
public exception_handler(ident _variable,named_type_reference _type_name,statement _statements)
{
this._variable=_variable;
this._type_name=_type_name;
this._statements=_statements;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public exception_handler(ident _variable,named_type_reference _type_name,statement _statements,SourceContext sc)
{
this._variable=_variable;
this._type_name=_type_name;
this._statements=_statements;
source_context = sc;
FillParentsInDirectChilds();
}
protected ident _variable;
protected named_type_reference _type_name;
protected statement _statements;
///
///
///
public ident variable
{
get
{
return _variable;
}
set
{
_variable=value;
}
}
///
///
///
public named_type_reference type_name
{
get
{
return _type_name;
}
set
{
_type_name=value;
}
}
///
///
///
public statement statements
{
get
{
return _statements;
}
set
{
_statements=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
exception_handler copy = new exception_handler();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (variable != null)
{
copy.variable = (ident)variable.Clone();
copy.variable.Parent = copy;
}
if (type_name != null)
{
copy.type_name = (named_type_reference)type_name.Clone();
copy.type_name.Parent = copy;
}
if (statements != null)
{
copy.statements = (statement)statements.Clone();
copy.statements.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new exception_handler TypedClone()
{
return Clone() as exception_handler;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (variable != null)
variable.Parent = this;
if (type_name != null)
type_name.Parent = this;
if (statements != null)
statements.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
variable?.FillParentsInAllChilds();
type_name?.FillParentsInAllChilds();
statements?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 3;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 3;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return variable;
case 1:
return type_name;
case 2:
return statements;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
variable = (ident)value;
break;
case 1:
type_name = (named_type_reference)value;
break;
case 2:
statements = (statement)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class exception_ident : syntax_tree_node
{
///
///Конструктор без параметров.
///
public exception_ident()
{
}
///
///Конструктор с параметрами.
///
public exception_ident(ident _variable,named_type_reference _type_name)
{
this._variable=_variable;
this._type_name=_type_name;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public exception_ident(ident _variable,named_type_reference _type_name,SourceContext sc)
{
this._variable=_variable;
this._type_name=_type_name;
source_context = sc;
FillParentsInDirectChilds();
}
protected ident _variable;
protected named_type_reference _type_name;
///
///
///
public ident variable
{
get
{
return _variable;
}
set
{
_variable=value;
}
}
///
///
///
public named_type_reference type_name
{
get
{
return _type_name;
}
set
{
_type_name=value;
}
}
/// Создает копию узла
public override syntax_tree_node Clone()
{
exception_ident copy = new exception_ident();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (variable != null)
{
copy.variable = (ident)variable.Clone();
copy.variable.Parent = copy;
}
if (type_name != null)
{
copy.type_name = (named_type_reference)type_name.Clone();
copy.type_name.Parent = copy;
}
return copy;
}
/// Получает копию данного узла корректного типа
public new exception_ident TypedClone()
{
return Clone() as exception_ident;
}
/// Заполняет поля Parent в непосредственных дочерних узлах
public override void FillParentsInDirectChilds()
{
if (variable != null)
variable.Parent = this;
if (type_name != null)
type_name.Parent = this;
}
/// Заполняет поля Parent во всем поддереве
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
variable?.FillParentsInAllChilds();
type_name?.FillParentsInAllChilds();
}
///
///Свойство для получения количества всех подузлов без элементов поля типа List
///
public override Int32 subnodes_without_list_elements_count
{
get
{
return 2;
}
}
///
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///
public override Int32 subnodes_count
{
get
{
return 2;
}
}
///
///Индексатор для получения всех подузлов
///
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return variable;
case 1:
return type_name;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
variable = (ident)value;
break;
case 1:
type_name = (named_type_reference)value;
break;
}
}
}
///
///Метод для обхода дерева посетителем
///
///Объект-посетитель.
///Return value is void
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///
///
///
[Serializable]
public partial class exception_handler_list : syntax_tree_node
{
///
///Конструктор без параметров.
///
public exception_handler_list()
{
}
///
///Конструктор с параметрами.
///
public exception_handler_list(List _handlers)
{
this._handlers=_handlers;
FillParentsInDirectChilds();
}
///
///Конструктор с параметрами.
///
public exception_handler_list(List _handlers,SourceContext sc)
{
this._handlers=_handlers;
source_context = sc;
FillParentsInDirectChilds();
}
public exception_handler_list(exception_handler elem, SourceContext sc = null)
{
Add(elem, sc);
FillParentsInDirectChilds();
}
protected List _handlers=new List();
///
///
///
public List handlers
{
get
{
return _handlers;
}
set
{
_handlers=value;
}
}
public exception_handler_list Add(exception_handler elem, SourceContext sc = null)
{
handlers.Add(elem);
if (elem != null)
elem.Parent = this;
if (sc != null)
source_context = sc;
return this;
}
public void AddFirst(exception_handler el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
handlers.Insert(0, el);
FillParentsInDirectChilds();
}
public void AddFirst(IEnumerable els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
handlers.InsertRange(0, els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
public void AddMany(params exception_handler[] els)
{
if (els == null)
throw new ArgumentNullException(nameof(els));
handlers.AddRange(els);
foreach (var el in els)
if (el != null)
el.Parent = this;
}
private int FindIndexInList(exception_handler el)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
var ind = handlers.FindIndex(x => x == el);
if (ind == -1)
throw new Exception(string.Format("У списка {0} не найден элемент {1} среди дочерних\n", this, el));
return ind;
}
public void InsertAfter(exception_handler el, exception_handler newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
handlers.Insert(FindIndexInList(el) + 1, newel);
newel.Parent = this;
}
public void InsertAfter(exception_handler el, IEnumerable newels)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newels == null)
throw new ArgumentNullException(nameof(newels));
handlers.InsertRange(FindIndexInList(el) + 1, newels);
foreach (var newel in newels)
if (newel != null)
newel.Parent = this;
}
public void InsertBefore(exception_handler el, exception_handler newel)
{
if (el == null)
throw new ArgumentNullException(nameof(el));
if (newel == null)
throw new ArgumentNullException(nameof(newel));
handlers.Insert(FindIndexInList(el), newel);
newel.Parent = this;
}
public void InsertBefore(exception_handler el, IEnumerable