UnknownID в yield_unknown_ident сделал генерируемым автоматически

This commit is contained in:
Mikhalkovich Stanislav 2022-08-04 11:19:54 +03:00
parent 4fd7a8cda5
commit 308da7ab5c
12 changed files with 91 additions and 19 deletions

View file

@ -15,7 +15,7 @@ internal static class RevisionClass
public const string Major = "3";
public const string Minor = "8";
public const string Build = "3";
public const string Revision = "3147";
public const string Revision = "3150";
public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;

View file

@ -1,4 +1,4 @@
%MINOR%=8
%REVISION%=3147
%COREVERSION%=3
%REVISION%=3150
%MINOR%=8
%MAJOR%=3

Binary file not shown.

View file

@ -1 +1 @@
3.8.3.3147
3.8.3.3150

View file

@ -1 +1 @@
!define VERSION '3.8.3.3147'
!define VERSION '3.8.3.3150'

View file

@ -3910,6 +3910,7 @@ namespace PascalABCCompiler.SyntaxTree
{
DefaultVisit(_yield_unknown_ident);
pre_do_visit(_yield_unknown_ident);
visit(yield_unknown_ident.UnknownID);
post_do_visit(_yield_unknown_ident);
}

View file

@ -3878,6 +3878,7 @@ namespace PascalABCCompiler.SyntaxTree
public void read_yield_unknown_ident(yield_unknown_ident _yield_unknown_ident)
{
read_ident(_yield_unknown_ident);
_yield_unknown_ident.UnknownID = _read_node() as ident;
}

View file

@ -5990,6 +5990,15 @@ namespace PascalABCCompiler.SyntaxTree
public void write_yield_unknown_ident(yield_unknown_ident _yield_unknown_ident)
{
write_ident(_yield_unknown_ident);
if (_yield_unknown_ident.UnknownID == null)
{
bw.Write((byte)0);
}
else
{
bw.Write((byte)1);
_yield_unknown_ident.UnknownID.visit(this);
}
}

View file

@ -46350,31 +46350,70 @@ namespace PascalABCCompiler.SyntaxTree
}
///<summary>
///Конструктор с параметрами.
///</summary>
public yield_unknown_ident(string _name)
public yield_unknown_ident(ident _UnknownID)
{
this._name=_name;
this._UnknownID=_UnknownID;
FillParentsInDirectChilds();
}
///<summary>
///Конструктор с параметрами.
///</summary>
public yield_unknown_ident(string _name,SourceContext sc)
public yield_unknown_ident(ident _UnknownID,SourceContext sc)
{
this._name=_name;
this._UnknownID=_UnknownID;
source_context = sc;
FillParentsInDirectChilds();
}
///<summary>
///Конструктор с параметрами.
///</summary>
public yield_unknown_ident(string _name,ident _UnknownID)
{
this._name=_name;
this._UnknownID=_UnknownID;
FillParentsInDirectChilds();
}
///<summary>
///Конструктор с параметрами.
///</summary>
public yield_unknown_ident(string _name,ident _UnknownID,SourceContext sc)
{
this._name=_name;
this._UnknownID=_UnknownID;
source_context = sc;
FillParentsInDirectChilds();
}
protected ident _UnknownID;
///<summary>
///
///</summary>
public ident UnknownID
{
get
{
return _UnknownID;
}
set
{
_UnknownID=value;
if (_UnknownID != null)
_UnknownID.Parent = this;
}
}
/// <summary> Создает копию узла </summary>
public override syntax_tree_node Clone()
{
yield_unknown_ident copy = new yield_unknown_ident();
copy.Parent = this.Parent;
copy.UnknownID = this.UnknownID;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
@ -46383,6 +46422,11 @@ namespace PascalABCCompiler.SyntaxTree
copy.attributes.Parent = copy;
}
copy.name = name;
if (UnknownID != null)
{
copy.UnknownID = (ident)UnknownID.Clone();
copy.UnknownID.Parent = copy;
}
return copy;
}
@ -46397,6 +46441,8 @@ namespace PascalABCCompiler.SyntaxTree
{
if (attributes != null)
attributes.Parent = this;
if (UnknownID != null)
UnknownID.Parent = this;
}
///<summary> Заполняет поля Parent во всем поддереве </summary>
@ -46404,6 +46450,7 @@ namespace PascalABCCompiler.SyntaxTree
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
UnknownID?.FillParentsInAllChilds();
}
///<summary>
@ -46413,7 +46460,7 @@ namespace PascalABCCompiler.SyntaxTree
{
get
{
return 0;
return 1;
}
}
///<summary>
@ -46423,7 +46470,7 @@ namespace PascalABCCompiler.SyntaxTree
{
get
{
return 0;
return 1;
}
}
///<summary>
@ -46435,12 +46482,23 @@ namespace PascalABCCompiler.SyntaxTree
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
return UnknownID;
}
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
switch(ind)
{
case 0:
UnknownID = (ident)value;
break;
}
}
}
///<summary>

View file

@ -1588,15 +1588,15 @@ namespace PascalABCCompiler.SyntaxTree
public partial class yield_unknown_ident : ident
{
protected ident _UnknownID;
//protected ident _UnknownID;
protected ident _ClassName;
protected bool _IsYieldInStaticMethod;
public ident UnknownID
/*public ident UnknownID
{
get { return _UnknownID; }
set { _UnknownID = value; }
}
}*/
public ident ClassName
{

View file

@ -2757,7 +2757,9 @@
</Tags>
</SyntaxNode>
<SyntaxNode Name="yield_unknown_ident" BaseName="ident">
<Fields />
<Fields>
<SyntaxField Name="UnknownID" SyntaxType="ident" />
</Fields>
<Methods />
<Tags>
<CategoryIndices>
@ -4944,6 +4946,7 @@
<HelpData Key="yield_unknown_foreach_type_ident.unknown_foreach" Value="" />
<HelpData Key="yield_unknown_ident" Value="Неопознанный идентификатор. Откладывает определение необходимости захвата имени как поля класса до этапа семантики." />
<HelpData Key="yield_unknown_ident.ClassName" Value="" />
<HelpData Key="yield_unknown_ident.IsYieldInStaticMethod" Value="" />
<HelpData Key="yield_unknown_ident.UnknownID" Value="" />
<HelpData Key="yield_var_def_statement_with_unknown_type" Value="Узел-обертка для yield для определения типов локальных переменных в var_def_statement" />
<HelpData Key="yield_var_def_statement_with_unknown_type.vars" Value="" />

View file

@ -1,8 +1,8 @@
// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt)
// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
unit DMTaskMaker;
interface
interface
uses System.Collections.Generic;