Множественные uses

This commit is contained in:
miks1965 2016-01-20 20:31:39 +03:00
parent d933ae1f2c
commit 3e844d597b
14 changed files with 1290 additions and 1217 deletions

View file

@ -2769,6 +2769,18 @@ namespace CodeFormatters
}
}
public override void visit(uses_closure uc)
{
var i = 0;
foreach (var ul in uc.listunitsections)
{
if (i>0)
visit_node(ul);
i++;
}
}
#endregion
}
}

View file

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

View file

@ -1,4 +1,4 @@
%COREVERSION%=0
%REVISION%=1145
%MINOR%=0
%MAJOR%=3
%REVISION%=1146
%COREVERSION%=0
%MAJOR%=3

View file

@ -2,7 +2,7 @@
// This CSharp output file generated by Gardens Point LEX
// Version: 1.1.3.301
// Machine: SSM
// DateTime: 19.01.2016 22:49:35
// DateTime: 20.01.2016 7:56:03
// UserName: ?????????
// GPLEX input file <ABCPascal.lex>
// GPLEX frame file <embedded resource>

View file

@ -301,14 +301,23 @@ uses_clause
{
$$ = null;
}
| tkUses used_units_list tkSemiColon
| uses_clause tkUses used_units_list tkSemiColon
{
//if ($1 == null)
//$1 = new uses_closure($3 as uses_list,@$);
//else ($1 as uses_closure).Add($3 as uses_list,@$);
//$$ = $1;
$$ = $2;
$$.source_context = @$;
if (parsertools.build_tree_for_formatter)
{
if ($1 == null)
$1 = new uses_closure($3 as uses_list,@$);
else ($1 as uses_closure).AddUsesList($3 as uses_list,@$);
$$ = $1;
}
else
{
if ($1 == null)
$1 = $3;
else ($1 as uses_list).AddUsesList($3 as uses_list,@$);
$$ = $1;
$$.source_context = @$;
}
}
;

File diff suppressed because it is too large Load diff

View file

@ -105,5 +105,6 @@ script=

View file

@ -1,5 +1 @@
<<<<<<< HEAD
!define VERSION '3.0.0.1144'
=======
!define VERSION '3.0.0.1145'
>>>>>>> 1226bee7eaefabee672f0fa2d1943e289f9b4efb
!define VERSION '3.0.0.1146'

View file

@ -3702,7 +3702,7 @@ namespace PascalABCCompiler.SyntaxTree
public void read_uses_closure(uses_closure _uses_closure)
{
read_syntax_tree_node(_uses_closure);
read_uses_list(_uses_closure);
if (br.ReadByte() == 0)
{
_uses_closure.listunitsections = null;

View file

@ -5806,7 +5806,7 @@ namespace PascalABCCompiler.SyntaxTree
public void write_uses_closure(uses_closure _uses_closure)
{
write_syntax_tree_node(_uses_closure);
write_uses_list(_uses_closure);
if (_uses_closure.listunitsections == null)
{
bw.Write((byte)0);

View file

@ -27390,7 +27390,7 @@ namespace PascalABCCompiler.SyntaxTree
///
///</summary>
[Serializable]
public partial class uses_closure : syntax_tree_node
public partial class uses_closure : uses_list
{
///<summary>
@ -27418,6 +27418,25 @@ namespace PascalABCCompiler.SyntaxTree
source_context = sc;
}
///<summary>
///Конструктор с параметрами.
///</summary>
public uses_closure(List<unit_or_namespace> _units,List<uses_list> _listunitsections)
{
this._units=_units;
this._listunitsections=_listunitsections;
}
///<summary>
///Конструктор с параметрами.
///</summary>
public uses_closure(List<unit_or_namespace> _units,List<uses_list> _listunitsections,SourceContext sc)
{
this._units=_units;
this._listunitsections=_listunitsections;
source_context = sc;
}
protected List<uses_list> _listunitsections=new List<uses_list>();
///<summary>
@ -27453,7 +27472,7 @@ namespace PascalABCCompiler.SyntaxTree
{
get
{
return 0 + (listunitsections == null ? 0 : listunitsections.Count);
return 0 + (units == null ? 0 : units.Count) + (listunitsections == null ? 0 : listunitsections.Count);
}
}
///<summary>
@ -27466,6 +27485,15 @@ namespace PascalABCCompiler.SyntaxTree
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];
}
else
index_counter = index_counter - units.Count;
}
if(listunitsections != null)
{
if(index_counter < listunitsections.Count)
@ -27480,6 +27508,16 @@ namespace PascalABCCompiler.SyntaxTree
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;
}
else
index_counter = index_counter - units.Count;
}
if(listunitsections != null)
{
if(index_counter < listunitsections.Count)

View file

@ -916,6 +916,14 @@ namespace PascalABCCompiler.SyntaxTree
source_context = sc;
return this;
}
public uses_list AddUsesList(uses_list ul, SourceContext sc = null)
{
foreach (var un in ul.units)
units.Add(un);
if (sc != null)
source_context = sc;
return this;
}
}
public partial class unit_module

Binary file not shown.

Binary file not shown.