Изменения в расположении файлов визиторов, чистка проекта от ненужных references, проект YieldConversionSyntax уже не нужен - все его визиторы подключаются явно в StandardSyntaxConverter.cs, ObjectCopier перенесен в подпапку
This commit is contained in:
parent
342a914d39
commit
df3274d578
|
|
@ -50,7 +50,7 @@ namespace PascalABCCompiler.SyntaxTreeConverters
|
||||||
private void AddExternalConvertersAsPlugins(string DirectoryName)
|
private void AddExternalConvertersAsPlugins(string DirectoryName)
|
||||||
{
|
{
|
||||||
DirectoryInfo di = new DirectoryInfo(DirectoryName);
|
DirectoryInfo di = new DirectoryInfo(DirectoryName);
|
||||||
List<FileInfo> dllfiles = di.GetFiles("*ConversionSyntax.dll").ToList(); // Это только YieldConversionSyntax.dll
|
List<FileInfo> dllfiles = di.GetFiles("*ConversionSyntaxExternal.dll").ToList(); // Это только YieldConversionSyntax.dll
|
||||||
//List<FileInfo> standartdllfile = di.GetFiles("StandardSyntaxTreeConverter.dll").ToList();
|
//List<FileInfo> standartdllfile = di.GetFiles("StandardSyntaxTreeConverter.dll").ToList();
|
||||||
//if (standartdllfile.Count>0)
|
//if (standartdllfile.Count>0)
|
||||||
// dllfiles.Insert(0, standartdllfile[0]);
|
// dllfiles.Insert(0, standartdllfile[0]);
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using PascalABCCompiler.SyntaxTree;
|
using PascalABCCompiler.SyntaxTree;
|
||||||
|
using SyntaxVisitors;
|
||||||
|
|
||||||
namespace PascalABCCompiler.SyntaxTreeConverters
|
namespace PascalABCCompiler.SyntaxTreeConverters
|
||||||
{
|
{
|
||||||
|
|
@ -12,10 +13,16 @@ namespace PascalABCCompiler.SyntaxTreeConverters
|
||||||
public syntax_tree_node Convert(syntax_tree_node root)
|
public syntax_tree_node Convert(syntax_tree_node root)
|
||||||
{
|
{
|
||||||
// Прошивание ссылками на Parent nodes. Должно идти первым
|
// Прошивание ссылками на Parent nodes. Должно идти первым
|
||||||
|
// FillParentNodeVisitor расположен в SyntaxTree/tree как базовый визитор, отвечающий за построение дерева
|
||||||
FillParentNodeVisitor.New.ProcessNode(root);
|
FillParentNodeVisitor.New.ProcessNode(root);
|
||||||
|
|
||||||
// Выносим выражения с лямбдами из заголовка foreach
|
// Выносим выражения с лямбдами из заголовка foreach
|
||||||
StandOutExprWithLambdaInForeachSequenceVisitor.New.ProcessNode(root);
|
StandOutExprWithLambdaInForeachSequenceVisitor.New.ProcessNode(root);
|
||||||
|
|
||||||
|
// Всё, связанное с yield
|
||||||
|
root.visit(new MarkMethodHasYieldAndCheckSomeErrorsVisitor());
|
||||||
|
ProcessYieldCapturedVarsVisitor.New.ProcessNode(root);
|
||||||
|
|
||||||
|
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="StandardSyntaxConverter.cs" />
|
<Compile Include="StandardSyntaxConverter.cs" />
|
||||||
<Compile Include="StandOutExprWithLambdaInForeachSequenceConverter.cs" />
|
<Compile Include="StandOutExprWithLambdaInForeachSequenceVisitor.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\SyntaxTreeConverters\SyntaxTreeConverters.csproj">
|
<ProjectReference Include="..\SyntaxTreeConverters\SyntaxTreeConverters.csproj">
|
||||||
|
|
@ -52,6 +52,14 @@
|
||||||
<Project>{c2cac65a-b2ae-4ccc-b067-e6b8e75df73a}</Project>
|
<Project>{c2cac65a-b2ae-4ccc-b067-e6b8e75df73a}</Project>
|
||||||
<Name>SyntaxTree</Name>
|
<Name>SyntaxTree</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\SyntaxVisitors\SyntaxVisitors.csproj">
|
||||||
|
<Project>{a9ab4282-83b4-41a7-86c3-e5bf6a45e7e2}</Project>
|
||||||
|
<Name>SyntaxVisitors</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\Yield\YieldConversionSyntax\YieldConversionSyntax.csproj">
|
||||||
|
<Project>{276ee073-60f6-46d2-8811-1b8026bcaada}</Project>
|
||||||
|
<Name>YieldConversionSyntax</Name>
|
||||||
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,6 @@
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Net.Http" />
|
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
@ -49,7 +48,7 @@
|
||||||
<Compile Include="BaseVisitors\HasStatementVisitor.cs" />
|
<Compile Include="BaseVisitors\HasStatementVisitor.cs" />
|
||||||
<Compile Include="BaseVisitors\SmallHelperVisitors.cs" />
|
<Compile Include="BaseVisitors\SmallHelperVisitors.cs" />
|
||||||
<Compile Include="ChangeWhileVisitor.cs" />
|
<Compile Include="ChangeWhileVisitor.cs" />
|
||||||
<Compile Include="ObjectCopier.cs" />
|
<Compile Include="YieldVisitors\ObjectCopier\ObjectCopier.cs" />
|
||||||
<Compile Include="Optimization\CalcConstExprs.cs" />
|
<Compile Include="Optimization\CalcConstExprs.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="SyntaxTreeVisitorsErrors.cs" />
|
<Compile Include="SyntaxTreeVisitorsErrors.cs" />
|
||||||
|
|
@ -77,10 +76,6 @@
|
||||||
<Compile Include="YieldVisitors\ReplaceYieldWithLamdasVisitor.cs" />
|
<Compile Include="YieldVisitors\ReplaceYieldWithLamdasVisitor.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Compiler\Compiler.csproj">
|
|
||||||
<Project>{1e42361a-eda3-4872-88af-a3aaf600d36d}</Project>
|
|
||||||
<Name>Compiler</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\Errors\Errors.csproj">
|
<ProjectReference Include="..\Errors\Errors.csproj">
|
||||||
<Project>{44a01f9e-dce7-470c-aae5-c3de0ccbee3b}</Project>
|
<Project>{44a01f9e-dce7-470c-aae5-c3de0ccbee3b}</Project>
|
||||||
<Name>Errors</Name>
|
<Name>Errors</Name>
|
||||||
|
|
@ -97,10 +92,6 @@
|
||||||
<Project>{c2cac65a-b2ae-4ccc-b067-e6b8e75df73a}</Project>
|
<Project>{c2cac65a-b2ae-4ccc-b067-e6b8e75df73a}</Project>
|
||||||
<Name>SyntaxTree</Name>
|
<Name>SyntaxTree</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\TreeConverter\TreeConverter.csproj">
|
|
||||||
<Project>{1c9c945a-586d-42a2-a06b-65d84fa7ff78}</Project>
|
|
||||||
<Name>TreeConverter</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\Yield\YieldHelpers\YieldHelpers.csproj">
|
<ProjectReference Include="..\Yield\YieldHelpers\YieldHelpers.csproj">
|
||||||
<Project>{ce5c55c2-a11c-4e94-a9fa-3fc6ca3e4c09}</Project>
|
<Project>{ce5c55c2-a11c-4e94-a9fa-3fc6ca3e4c09}</Project>
|
||||||
<Name>YieldHelpers</Name>
|
<Name>YieldHelpers</Name>
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,6 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
using PascalABCCompiler.Errors;
|
|
||||||
using PascalABCCompiler.PCU;
|
|
||||||
using PascalABCCompiler.SemanticTreeConverters;
|
|
||||||
using System.CodeDom.Compiler;
|
|
||||||
using PascalABCCompiler;
|
|
||||||
using PascalABCCompiler.SyntaxTree;
|
using PascalABCCompiler.SyntaxTree;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,10 +44,6 @@
|
||||||
<Compile Include="YieldDesugarSyntaxTreeConverter.cs" />
|
<Compile Include="YieldDesugarSyntaxTreeConverter.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\Compiler\Compiler.csproj">
|
|
||||||
<Project>{1e42361a-eda3-4872-88af-a3aaf600d36d}</Project>
|
|
||||||
<Name>Compiler</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\..\Errors\Errors.csproj">
|
<ProjectReference Include="..\..\Errors\Errors.csproj">
|
||||||
<Project>{44a01f9e-dce7-470c-aae5-c3de0ccbee3b}</Project>
|
<Project>{44a01f9e-dce7-470c-aae5-c3de0ccbee3b}</Project>
|
||||||
<Name>Errors</Name>
|
<Name>Errors</Name>
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,7 @@ using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
using PascalABCCompiler;
|
|
||||||
using PascalABCCompiler.SyntaxTree;
|
using PascalABCCompiler.SyntaxTree;
|
||||||
using PascalABCCompiler.Errors;
|
|
||||||
|
|
||||||
using SyntaxVisitors;
|
using SyntaxVisitors;
|
||||||
|
|
||||||
|
|
@ -13,6 +11,8 @@ using PascalABCCompiler.SyntaxTreeConverters;
|
||||||
|
|
||||||
namespace YieldDesugarSyntaxTreeConverter
|
namespace YieldDesugarSyntaxTreeConverter
|
||||||
{
|
{
|
||||||
|
// Он перестал быть нужен, поскольку код YieldDesugarSyntaxTreeConverter.Convert был явно добавлен в StandardSyntaxTreeConverter.Convert
|
||||||
|
// Со временем этот проект надо исключить из решения, а YieldConversionSyntax.dll - исключить из инсталлята
|
||||||
public class YieldDesugarSyntaxTreeConverter : ISyntaxTreeConverter
|
public class YieldDesugarSyntaxTreeConverter : ISyntaxTreeConverter
|
||||||
{
|
{
|
||||||
public string Name { get; } = "YieldDesugar";
|
public string Name { get; } = "YieldDesugar";
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in a new issue