tree.xml с парой новых узлов для Питона

This commit is contained in:
Mikhalkovich Stanislav 2024-10-16 12:04:33 +03:00
parent 53b3fd0881
commit 0c773a7ecb
12 changed files with 3881 additions and 5 deletions

View file

@ -15,7 +15,7 @@ internal static class RevisionClass
public const string Major = "3"; public const string Major = "3";
public const string Minor = "10"; public const string Minor = "10";
public const string Build = "0"; public const string Build = "0";
public const string Revision = "3551"; public const string Revision = "3552";
public const string MainVersion = Major + "." + Minor; public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision; public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;

View file

@ -1,4 +1,4 @@
%MINOR%=10
%REVISION%=3551
%COREVERSION%=0 %COREVERSION%=0
%REVISION%=3552
%MINOR%=10
%MAJOR%=3 %MAJOR%=3

View file

@ -1 +1 @@
3.10.0.3551 3.10.0.3552

View file

@ -1 +1 @@
!define VERSION '3.10.0.3551' !define VERSION '3.10.0.3552'

View file

@ -1322,6 +1322,16 @@ namespace PascalABCCompiler.SyntaxTree
{ {
DefaultVisit(_to_expr); DefaultVisit(_to_expr);
} }
public virtual void visit(global_statement _global_statement)
{
DefaultVisit(_global_statement);
}
public virtual void visit(list_generator _list_generator)
{
DefaultVisit(_list_generator);
}
} }

View file

@ -2109,6 +2109,22 @@ namespace PascalABCCompiler.SyntaxTree
{ {
} }
public virtual void pre_do_visit(global_statement _global_statement)
{
}
public virtual void post_do_visit(global_statement _global_statement)
{
}
public virtual void pre_do_visit(list_generator _list_generator)
{
}
public virtual void post_do_visit(list_generator _list_generator)
{
}
public override void visit(expression _expression) public override void visit(expression _expression)
{ {
DefaultVisit(_expression); DefaultVisit(_expression);
@ -4359,6 +4375,25 @@ namespace PascalABCCompiler.SyntaxTree
visit(to_expr.value); visit(to_expr.value);
post_do_visit(_to_expr); post_do_visit(_to_expr);
} }
public override void visit(global_statement _global_statement)
{
DefaultVisit(_global_statement);
pre_do_visit(_global_statement);
visit(global_statement.idents);
post_do_visit(_global_statement);
}
public override void visit(list_generator _list_generator)
{
DefaultVisit(_list_generator);
pre_do_visit(_list_generator);
visit(list_generator._expr);
visit(list_generator._ident);
visit(list_generator._range);
visit(list_generator._condition);
post_do_visit(_list_generator);
}
} }

View file

@ -546,6 +546,10 @@ namespace PascalABCCompiler.SyntaxTree
return new let_var_expr(); return new let_var_expr();
case 262: case 262:
return new to_expr(); return new to_expr();
case 263:
return new global_statement();
case 264:
return new list_generator();
} }
return null; return null;
} }
@ -4584,6 +4588,33 @@ namespace PascalABCCompiler.SyntaxTree
_to_expr.value = _read_node() as expression; _to_expr.value = _read_node() as expression;
} }
public void visit(global_statement _global_statement)
{
read_global_statement(_global_statement);
}
public void read_global_statement(global_statement _global_statement)
{
read_statement(_global_statement);
_global_statement.idents = _read_node() as ident_list;
}
public void visit(list_generator _list_generator)
{
read_list_generator(_list_generator);
}
public void read_list_generator(list_generator _list_generator)
{
read_expression(_list_generator);
_list_generator._expr = _read_node() as expression;
_list_generator._ident = _read_node() as ident;
_list_generator._range = _read_node() as expression;
_list_generator._condition = _read_node() as expression;
}
} }

View file

@ -7211,6 +7211,75 @@ namespace PascalABCCompiler.SyntaxTree
} }
} }
public void visit(global_statement _global_statement)
{
bw.Write((Int16)263);
write_global_statement(_global_statement);
}
public void write_global_statement(global_statement _global_statement)
{
write_statement(_global_statement);
if (_global_statement.idents == null)
{
bw.Write((byte)0);
}
else
{
bw.Write((byte)1);
_global_statement.idents.visit(this);
}
}
public void visit(list_generator _list_generator)
{
bw.Write((Int16)264);
write_list_generator(_list_generator);
}
public void write_list_generator(list_generator _list_generator)
{
write_expression(_list_generator);
if (_list_generator._expr == null)
{
bw.Write((byte)0);
}
else
{
bw.Write((byte)1);
_list_generator._expr.visit(this);
}
if (_list_generator._ident == null)
{
bw.Write((byte)0);
}
else
{
bw.Write((byte)1);
_list_generator._ident.visit(this);
}
if (_list_generator._range == null)
{
bw.Write((byte)0);
}
else
{
bw.Write((byte)1);
_list_generator._range.visit(this);
}
if (_list_generator._condition == null)
{
bw.Write((byte)0);
}
else
{
bw.Write((byte)1);
_list_generator._condition.visit(this);
}
}
} }

View file

@ -56087,6 +56087,419 @@ namespace PascalABCCompiler.SyntaxTree
} }
///<summary>
///
///</summary>
[Serializable]
public partial class global_statement : statement
{
///<summary>
///Конструктор без параметров.
///</summary>
public global_statement()
{
}
///<summary>
///Конструктор с параметрами.
///</summary>
public global_statement(ident_list _idents)
{
this._idents=_idents;
FillParentsInDirectChilds();
}
///<summary>
///Конструктор с параметрами.
///</summary>
public global_statement(ident_list _idents,SourceContext sc)
{
this._idents=_idents;
source_context = sc;
FillParentsInDirectChilds();
}
protected ident_list _idents;
///<summary>
///
///</summary>
public ident_list idents
{
get
{
return _idents;
}
set
{
_idents=value;
if (_idents != null)
_idents.Parent = this;
}
}
/// <summary> Создает копию узла </summary>
public override syntax_tree_node Clone()
{
global_statement copy = new global_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 (idents != null)
{
copy.idents = (ident_list)idents.Clone();
copy.idents.Parent = copy;
}
return copy;
}
/// <summary> Получает копию данного узла корректного типа </summary>
public new global_statement TypedClone()
{
return Clone() as global_statement;
}
///<summary> Заполняет поля Parent в непосредственных дочерних узлах </summary>
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (idents != null)
idents.Parent = this;
}
///<summary> Заполняет поля Parent во всем поддереве </summary>
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
idents?.FillParentsInAllChilds();
}
///<summary>
///Свойство для получения количества всех подузлов без элементов поля типа List
///</summary>
public override Int32 subnodes_without_list_elements_count
{
get
{
return 1;
}
}
///<summary>
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///</summary>
public override Int32 subnodes_count
{
get
{
return 1;
}
}
///<summary>
///Индексатор для получения всех подузлов
///</summary>
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;
}
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;
}
}
}
///<summary>
///Метод для обхода дерева посетителем
///</summary>
///<param name="visitor">Объект-посетитель.</param>
///<returns>Return value is void</returns>
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
///<summary>
///
///</summary>
[Serializable]
public partial class list_generator : expression
{
///<summary>
///Конструктор без параметров.
///</summary>
public list_generator()
{
}
///<summary>
///Конструктор с параметрами.
///</summary>
public list_generator(expression __expr,ident __ident,expression __range,expression __condition)
{
this.__expr=__expr;
this.__ident=__ident;
this.__range=__range;
this.__condition=__condition;
FillParentsInDirectChilds();
}
///<summary>
///Конструктор с параметрами.
///</summary>
public list_generator(expression __expr,ident __ident,expression __range,expression __condition,SourceContext sc)
{
this.__expr=__expr;
this.__ident=__ident;
this.__range=__range;
this.__condition=__condition;
source_context = sc;
FillParentsInDirectChilds();
}
protected expression __expr;
protected ident __ident;
protected expression __range;
protected expression __condition;
///<summary>
///
///</summary>
public expression _expr
{
get
{
return __expr;
}
set
{
__expr=value;
if (__expr != null)
__expr.Parent = this;
}
}
///<summary>
///
///</summary>
public ident _ident
{
get
{
return __ident;
}
set
{
__ident=value;
if (__ident != null)
__ident.Parent = this;
}
}
///<summary>
///
///</summary>
public expression _range
{
get
{
return __range;
}
set
{
__range=value;
if (__range != null)
__range.Parent = this;
}
}
///<summary>
///
///</summary>
public expression _condition
{
get
{
return __condition;
}
set
{
__condition=value;
if (__condition != null)
__condition.Parent = this;
}
}
/// <summary> Создает копию узла </summary>
public override syntax_tree_node Clone()
{
list_generator copy = new list_generator();
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 (_ident != null)
{
copy._ident = (ident)_ident.Clone();
copy._ident.Parent = copy;
}
if (_range != null)
{
copy._range = (expression)_range.Clone();
copy._range.Parent = copy;
}
if (_condition != null)
{
copy._condition = (expression)_condition.Clone();
copy._condition.Parent = copy;
}
return copy;
}
/// <summary> Получает копию данного узла корректного типа </summary>
public new list_generator TypedClone()
{
return Clone() as list_generator;
}
///<summary> Заполняет поля Parent в непосредственных дочерних узлах </summary>
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
if (_expr != null)
_expr.Parent = this;
if (_ident != null)
_ident.Parent = this;
if (_range != null)
_range.Parent = this;
if (_condition != null)
_condition.Parent = this;
}
///<summary> Заполняет поля Parent во всем поддереве </summary>
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
_expr?.FillParentsInAllChilds();
_ident?.FillParentsInAllChilds();
_range?.FillParentsInAllChilds();
_condition?.FillParentsInAllChilds();
}
///<summary>
///Свойство для получения количества всех подузлов без элементов поля типа List
///</summary>
public override Int32 subnodes_without_list_elements_count
{
get
{
return 4;
}
}
///<summary>
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///</summary>
public override Int32 subnodes_count
{
get
{
return 4;
}
}
///<summary>
///Индексатор для получения всех подузлов
///</summary>
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 _ident;
case 2:
return _range;
case 3:
return _condition;
}
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:
_ident = (ident)value;
break;
case 2:
_range = (expression)value;
break;
case 3:
_condition = (expression)value;
break;
}
}
}
///<summary>
///Метод для обхода дерева посетителем
///</summary>
///<param name="visitor">Объект-посетитель.</param>
///<returns>Return value is void</returns>
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
} }

View file

@ -1582,6 +1582,18 @@ namespace PascalABCCompiler.SyntaxTree
///<param name="_to_expr">Node to visit</param> ///<param name="_to_expr">Node to visit</param>
///<returns> Return value is void </returns> ///<returns> Return value is void </returns>
void visit(to_expr _to_expr); void visit(to_expr _to_expr);
///<summary>
///Method to visit global_statement.
///</summary>
///<param name="_global_statement">Node to visit</param>
///<returns> Return value is void </returns>
void visit(global_statement _global_statement);
///<summary>
///Method to visit list_generator.
///</summary>
///<param name="_list_generator">Node to visit</param>
///<returns> Return value is void </returns>
void visit(list_generator _list_generator);
} }

View file

@ -3379,6 +3379,29 @@
<TagIndices /> <TagIndices />
</Tags> </Tags>
</SyntaxNode> </SyntaxNode>
<SyntaxNode Name="global_statement" BaseName="statement">
<Fields>
<SyntaxField Name="idents" SyntaxType="ident_list" />
</Fields>
<Methods />
<Tags>
<CategoryIndices />
<TagIndices />
</Tags>
</SyntaxNode>
<SyntaxNode Name="list_generator" BaseName="expression">
<Fields>
<SyntaxField Name="_expr" SyntaxType="expression" />
<SyntaxField Name="_ident" SyntaxType="ident" />
<SyntaxField Name="_range" SyntaxType="expression" />
<SyntaxField Name="_condition" SyntaxType="expression" />
</Fields>
<Methods />
<Tags>
<CategoryIndices />
<TagIndices />
</Tags>
</SyntaxNode>
</SyntaxNodes> </SyntaxNodes>
<Settings> <Settings>
<FileName>Tree.cs</FileName> <FileName>Tree.cs</FileName>
@ -3420,6 +3443,10 @@
<HelpData Key=".Name" Value="" /> <HelpData Key=".Name" Value="" />
<HelpData Key=".UnknownID" Value="" /> <HelpData Key=".UnknownID" Value="" />
<HelpData Key=".Vds" Value="" /> <HelpData Key=".Vds" Value="" />
<HelpData Key="._condition" Value="" />
<HelpData Key="._expr" Value="" />
<HelpData Key="._ident" Value="" />
<HelpData Key="._range" Value="" />
<HelpData Key="._realType" Value="" /> <HelpData Key="._realType" Value="" />
<HelpData Key=".additional_restrictions" Value="" /> <HelpData Key=".additional_restrictions" Value="" />
<HelpData Key=".aloneparam" Value="" /> <HelpData Key=".aloneparam" Value="" />
@ -3447,6 +3474,7 @@
<HelpData Key=".has_deref" Value="" /> <HelpData Key=".has_deref" Value="" />
<HelpData Key=".i" Value="" /> <HelpData Key=".i" Value="" />
<HelpData Key=".id" Value="" /> <HelpData Key=".id" Value="" />
<HelpData Key=".idents" Value="" />
<HelpData Key=".if_false" Value="" /> <HelpData Key=".if_false" Value="" />
<HelpData Key=".if_true" Value="" /> <HelpData Key=".if_true" Value="" />
<HelpData Key=".il" Value="" /> <HelpData Key=".il" Value="" />
@ -3998,6 +4026,8 @@
<HelpData Key="function_lambda_definition.visit_for_type_inference" Value="" /> <HelpData Key="function_lambda_definition.visit_for_type_inference" Value="" />
<HelpData Key="get_address" Value="" /> <HelpData Key="get_address" Value="" />
<HelpData Key="get_address.address_of" Value="" /> <HelpData Key="get_address.address_of" Value="" />
<HelpData Key="global_statement" Value="" />
<HelpData Key="global_statement.idents" Value="" />
<HelpData Key="goto_statement" Value="" /> <HelpData Key="goto_statement" Value="" />
<HelpData Key="goto_statement.goto_statement(string name)" Value="" /> <HelpData Key="goto_statement.goto_statement(string name)" Value="" />
<HelpData Key="goto_statement.goto_statement(string name, SourceContext sc)" Value="" /> <HelpData Key="goto_statement.goto_statement(string name, SourceContext sc)" Value="" />
@ -4142,6 +4172,11 @@
<HelpData Key="let_var_expr" Value="" /> <HelpData Key="let_var_expr" Value="" />
<HelpData Key="let_var_expr.ex" Value="" /> <HelpData Key="let_var_expr.ex" Value="" />
<HelpData Key="let_var_expr.id" Value="" /> <HelpData Key="let_var_expr.id" Value="" />
<HelpData Key="list_generator" Value="" />
<HelpData Key="list_generator._condition" Value="" />
<HelpData Key="list_generator._expr" Value="" />
<HelpData Key="list_generator._ident" Value="" />
<HelpData Key="list_generator._range" Value="" />
<HelpData Key="literal" Value="#12 либо 'abc'" /> <HelpData Key="literal" Value="#12 либо 'abc'" />
<HelpData Key="literal_const_line" Value="Представляет в синтаксическом дереве строку вида #123'abc'#124#125." /> <HelpData Key="literal_const_line" Value="Представляет в синтаксическом дереве строку вида #123'abc'#124#125." />
<HelpData Key="literal_const_line.literal_const_line Add(literal _literal)" Value="" /> <HelpData Key="literal_const_line.literal_const_line Add(literal _literal)" Value="" />
@ -4609,6 +4644,9 @@
<HelpData Key="slice_expr_question.step" Value="" /> <HelpData Key="slice_expr_question.step" Value="" />
<HelpData Key="slice_expr_question.to" Value="" /> <HelpData Key="slice_expr_question.to" Value="" />
<HelpData Key="slice_expr_question.v" Value="" /> <HelpData Key="slice_expr_question.v" Value="" />
<HelpData Key="spython_method_call" Value="" />
<HelpData Key="spython_method_call.method_name" Value="" />
<HelpData Key="spython_method_call.param_list" Value="" />
<HelpData Key="statement" Value="Оператор" /> <HelpData Key="statement" Value="Оператор" />
<HelpData Key="statement." Value="" /> <HelpData Key="statement." Value="" />
<HelpData Key="statement.label_name" Value="" /> <HelpData Key="statement.label_name" Value="" />

File diff suppressed because it is too large Load diff