Permalink
Browse files

Перенёс SyntaxVisitors в папку первого уровня

  • Loading branch information...
1 parent e7b65c4 commit bd19c5e385f7b72e6b430363fff30be90ddfd188 @miks1965 miks1965 committed Jul 18, 2016
Showing with 57 additions and 4,511 deletions.
  1. +1 −1 Compiler/Compiler.cs
  2. +3 −3 Compiler/SyntaxTreeConvertersController/SyntaxTreeConvertersController.cs
  3. +0 −1 Errors/Errors.cs
  4. +2 −3 ParserTools/ParserTools.csproj
  5. +17 −6 PascalABCNET.axml
  6. +7 −1 SyntaxTreeConverters/ISyntaxTreeConverter.cs
  7. +1 −1 SyntaxTreeConverters/Properties/AssemblyInfo.cs
  8. +6 −1 SyntaxTreeConverters/SampleSyntaxTreeConverter.cs
  9. +0 −167 Yield/SyntaxVisitors/.gitignore
  10. +0 −81 Yield/SyntaxVisitors/AllVarsInProcYieldsProba.cs
  11. +0 −102 Yield/SyntaxVisitors/BaseVisitors/BaseChangeVisitor.cs
  12. +0 −27 Yield/SyntaxVisitors/BaseVisitors/BaseEnterExitVisitor.cs
  13. +0 −61 Yield/SyntaxVisitors/BaseVisitors/CollectNamespaces.cs
  14. +0 −41 Yield/SyntaxVisitors/BaseVisitors/CollectUpperNodesVisitor.cs
  15. +0 −35 Yield/SyntaxVisitors/BaseVisitors/HasStatementVisitor.cs
  16. +0 −50 Yield/SyntaxVisitors/BaseVisitors/SmallHelperVisitors.cs
  17. +0 −51 Yield/SyntaxVisitors/ChangeWhileVisitor.cs
  18. +0 −50 Yield/SyntaxVisitors/ObjectCopier.cs
  19. +0 −120 Yield/SyntaxVisitors/Optimization/CalcConstExprs.cs
  20. +0 −36 Yield/SyntaxVisitors/Properties/AssemblyInfo.cs
  21. +0 −114 Yield/SyntaxVisitors/SyntaxVisitors.csproj
  22. +0 −50 Yield/SyntaxVisitors/UniversalVisitors/AddBeginEndsVisitor.cs
  23. +0 −44 Yield/SyntaxVisitors/UniversalVisitors/CountNodesVisitor.cs
  24. +0 −52 Yield/SyntaxVisitors/UniversalVisitors/DeleteRedundantBeginEnds.cs
  25. +0 −277 Yield/SyntaxVisitors/UniversalVisitors/SimplePrettyPrinterVisitor.cs
  26. +0 −149 Yield/SyntaxVisitors/YieldVisitors/CheckVariablesRedefenitionVisitor.cs
  27. +0 −70 Yield/SyntaxVisitors/YieldVisitors/CollectClassFieldsVisitor.cs
  28. +0 −54 Yield/SyntaxVisitors/YieldVisitors/CollectClassMethodsVisitor.cs
  29. +0 −48 Yield/SyntaxVisitors/YieldVisitors/CollectClassPropertiesVisitor.cs
  30. +0 −43 Yield/SyntaxVisitors/YieldVisitors/CollectUnitGlobalsVisitor.cs
  31. +0 −87 Yield/SyntaxVisitors/YieldVisitors/DeleteAllLocalDefs.cs
  32. +0 −72 Yield/SyntaxVisitors/YieldVisitors/DeleteLocalDefs.cs
  33. +0 −148 Yield/SyntaxVisitors/YieldVisitors/JustTestVisitor.cs
  34. +0 −48 Yield/SyntaxVisitors/YieldVisitors/LocalVariablesTypeDetectorHelperVisior.cs
  35. +0 −470 Yield/SyntaxVisitors/YieldVisitors/LoweringVisitor.cs
  36. +0 −141 Yield/SyntaxVisitors/YieldVisitors/MarkMethodHasYieldVisitor.cs
  37. +0 −1,151 Yield/SyntaxVisitors/YieldVisitors/ProcessYieldsCapturedVars.cs
  38. +0 −181 Yield/SyntaxVisitors/YieldVisitors/RenameSameBlockLocalVarsVisitor.cs
  39. +0 −51 Yield/SyntaxVisitors/YieldVisitors/ReplaceBreakContinueWithGotoLabelVisitor.cs
  40. +0 −200 Yield/SyntaxVisitors/YieldVisitors/ReplaceCapturedVariablesVisitor.cs
  41. +0 −116 Yield/SyntaxVisitors/YieldVisitors/ReplaceFormalParametersRefsVisitor.cs
  42. +0 −46 Yield/SyntaxVisitors/YieldVisitors/ReplaceVariableNameVisitor.cs
  43. +0 −59 Yield/SyntaxVisitors/YieldVisitors/ReplaceYieldWithLamdasVisitor.cs
  44. +4 −0 Yield/YieldConversionSyntax/YieldConversionSyntax.csproj
  45. +8 −2 Yield/YieldConversionSyntax/YieldDesugarSyntaxTreeConverter.cs
  46. +4 −0 bin/Lng/Eng/SyntaxTreeVisitorsErrors.dat
  47. +4 −0 bin/Lng/Rus/SyntaxTreeVisitorsErrors.dat
@@ -2902,7 +2902,7 @@ public CompilationUnit CompileUnit(PascalABCCompiler.TreeRealization.unit_node_l
if (errorsList.Count == 0) // SSM 2/05/16 - для преобразования синтаксических деревьев извне
{
- CurrentUnit.SyntaxTree = syntaxTreeConvertersController.Convert(CurrentUnit.SyntaxTree) as SyntaxTree.compilation_unit;
+ CurrentUnit.SyntaxTree = syntaxTreeConvertersController.Convert(CurrentUnit.SyntaxTree,UnitName,errorsList) as SyntaxTree.compilation_unit;
}
if (errorsList.Count == 0 && need_gen_doc(CurrentUnit.SyntaxTree))
@@ -6,7 +6,7 @@
using System.Text;
using System.IO;
using PascalABCCompiler.SyntaxTree;
-using PascalABCCompiler.SyntaxTreeConverters;
+using PascalABCCompiler.Errors;
namespace PascalABCCompiler.SyntaxTreeConverters
{
@@ -87,12 +87,12 @@ private void AddConverters(string DirectoryName)
}
- public syntax_tree_node Convert(syntax_tree_node root)
+ public syntax_tree_node Convert(syntax_tree_node root, string FileName, List<Error> errorsList)
{
foreach (ISyntaxTreeConverter SyntaxTreeConverter in syntaxTreeConverters)
{
ChangeState(State.Convert, SyntaxTreeConverter);
- root = SyntaxTreeConverter.Convert(root);
+ root = SyntaxTreeConverter.Convert(root,FileName,errorsList);
}
return root;
}
View
@@ -153,7 +153,6 @@ public SyntaxError(string Message, string fileName, PascalABCCompiler.SyntaxTree
if (source_context != null && source_context.FileName != null)
base.fileName = source_context.FileName;
bad_node = _bad_node;
- //Console.WriteLine(ToString());
}
public override string ToString()
{
@@ -75,6 +75,7 @@
<Compile Include="ParserTools\LanguageInformation.cs" />
<Compile Include="ParserTools\ParserTools.cs" />
<Compile Include="ParserTools\SourceContextMap.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SyntaxTreeVisitors\ConstantExpressionToConstantConvertor.cs" />
<Compile Include="SyntaxTreeVisitors\SyntaxTreeComparer.cs" />
<Compile Include="Tools.cs" />
@@ -96,9 +97,7 @@
<Name>SyntaxTree</Name>
</ProjectReference>
</ItemGroup>
- <ItemGroup>
- <Folder Include="Properties\" />
- </ItemGroup>
+ <ItemGroup />
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
View
@@ -522,6 +522,17 @@
</i>
</OCtx>
</Node>
+ <Node Name="foreach (ISyntaxTreeConverter SyntaxTreeConverter in syntaxTreeConverters)">
+ <FileName>\Compiler\SyntaxTreeConvertersController\SyntaxTreeConvertersController.cs</FileName>
+ <Text>foreach (ISyntaxTreeConverter SyntaxTreeConverter in syntaxTreeConverters)</Text>
+ <OCtx>
+ <i Type="Method">public syntax_tree_node Convert ( syntax_tree_node root , string FileName , List &lt; Error &gt; errorsList )</i>
+ <i Type="ClassOrNamespace">public class SyntaxTreeConvertersController</i>
+ <i Type="ClassOrNamespace">namespace PascalABCCompiler . SyntaxTreeConverters</i>
+ <i Type="CS_TreeNode">
+ </i>
+ </OCtx>
+ </Node>
</Items>
</Node>
<Node Name="PVS Studio Detected">
@@ -1035,13 +1046,13 @@
</Node>
</Items>
</Node>
- <Node Name="id.name.ToLower() == &quot;result&quot;">
- <FileName>\Yield\SyntaxVisitors\YieldVisitors\MarkMethodHasYieldVisitor.cs</FileName>
- <Text>if (id.name.ToLower() == "result")</Text>
+ <Node Name="AddErrorFromResource">
+ <FileName>\Parsers\PascalABCParserNewSaushkin\ABCPascalParserTools.cs</FileName>
+ <Text>public void AddErrorFromResource(string res, PascalABCCompiler.SyntaxTree.SourceContext loc, params string[] pars)</Text>
<OCtx>
- <i Type="Method">public override void visit ( ident id )</i>
- <i Type="ClassOrNamespace">public class MarkMethodHasYieldVisitor : WalkingVisitorNew</i>
- <i Type="ClassOrNamespace">namespace SyntaxVisitors</i>
+ <i Type="Method">public void AddErrorFromResource ( string res , PascalABCCompiler . SyntaxTree . SourceContext loc , params string [ ] pars )</i>
+ <i Type="ClassOrNamespace">public class PT</i>
+ <i Type="ClassOrNamespace">namespace PascalABCSavParser</i>
<i Type="CS_TreeNode">
</i>
</OCtx>
@@ -1,6 +1,8 @@
// Copyright (c) Ivan Bondarev, Stanislav Mihalkovich (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using PascalABCCompiler.SyntaxTree;
+using PascalABCCompiler.Errors;
+using System.Collections.Generic;
namespace PascalABCCompiler.SyntaxTreeConverters
{
@@ -14,6 +16,10 @@ public enum ExecutionOrder
}
public interface ISyntaxTreeConverter
{
+ string FileName { get; set; }
+
+ List<Error> ErrorsList { get; set; }
+
string Name { get; }
string Version { get; }
@@ -26,7 +32,7 @@ public interface ISyntaxTreeConverter
ExecutionOrder ExecutionOrder { get; }
- syntax_tree_node Convert(syntax_tree_node root);
+ syntax_tree_node Convert(syntax_tree_node root, string FileName, List<Error> errorsList);
}
}
@@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SyntaxTreeChanger")]
-[assembly: AssemblyCopyright("Copyright © 2016")]
+[assembly: AssemblyCopyright("Copyright © 2005-2016 by Ivan Bondarev, Stanislav Mihalkovich")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -4,6 +4,7 @@
using System.Text;
using System.IO;
using PascalABCCompiler.SyntaxTree;
+using PascalABCCompiler.Errors;
namespace PascalABCCompiler.SyntaxTreeConverters
{
@@ -81,14 +82,18 @@ public override void visit(bin_expr n)
public class SampleSyntaxTreeConverter: ISyntaxTreeConverter
{
+ public string FileName { get; set; }
+ public List<Error> ErrorsList { get; set; }
public string Name { get; set; }
public string Version { get; set; }
public string Description { get; set; }
public string Copyright { get; set; }
public ConverterType ConverterType { get; set; }
public ExecutionOrder ExecutionOrder { get; set; }
- public syntax_tree_node Convert(syntax_tree_node root)
+ public syntax_tree_node Convert(syntax_tree_node root, string FileName, List<Error> ErrorsList)
{
+ this.FileName = FileName;
+ this.ErrorsList = ErrorsList;
//var v = new SampleVisitor();
//v.ProcessNode(root);
return root;
@@ -1,167 +0,0 @@
-## Ignore Visual Studio temporary files, build results, and
-## files generated by popular Visual Studio add-ons.
-
-# User-specific files
-*.suo
-*.user
-*.sln.docstates
-.vs/
-
-# Build results
-[Bb]inaries/
-[Dd]ebug/
-[Rr]elease/
-x64/
-[Bb]in/
-[Oo]bj/
-
-# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
-!packages/*/build/
-
-# NuGet restore semaphore
-build/ToolsetPackages/toolsetpackages.semaphore
-
-# MSTest test Results
-[Tt]est[Rr]esult*/
-[Bb]uild[Ll]og.*
-UnitTestResults.html
-
-# NuGet V3 artifacts
-*-packages.config
-*.nuget.props
-*.nuget.targets
-
-*_i.c
-*_p.c
-*.ilk
-*.meta
-*.obj
-*.pch
-*.pdb
-*.pgc
-*.pgd
-*.sbr
-*.tlb
-*.tli
-*.tlh
-*.tmp
-*.tmp_proj
-*.log
-*.wrn
-*.vspscc
-*.vssscc
-.builds
-*.pidb
-*.log
-*.scc
-
-# Visual Studio cache files
-*.sln.ide/
-
-# Visual C++ cache files
-ipch/
-*.aps
-*.ncb
-*.opensdf
-*.sdf
-*.cachefile
-
-# Visual Studio profiler
-*.psess
-*.vsp
-*.vspx
-
-# Guidance Automation Toolkit
-*.gpState
-
-# ReSharper is a .NET coding add-in
-_ReSharper*/
-*.[Rr]e[Ss]harper
-
-# TeamCity is a build add-in
-_TeamCity*
-
-# DotCover is a Code Coverage Tool
-*.dotCover
-
-# NCrunch
-*.ncrunch*
-.*crunch*.local.xml
-
-# Installshield output folder
-[Ee]xpress/
-
-# DocProject is a documentation generator add-in
-DocProject/buildhelp/
-DocProject/Help/*.HxT
-DocProject/Help/*.HxC
-DocProject/Help/*.hhc
-DocProject/Help/*.hhk
-DocProject/Help/*.hhp
-DocProject/Help/Html2
-DocProject/Help/html
-
-# Click-Once directory
-publish/
-
-# Publish Web Output
-*.Publish.xml
-
-# NuGet Packages Directory
-packages/
-
-# Windows Azure Build Output
-csx
-*.build.csdef
-
-# Windows Store app package directory
-AppPackages/
-
-# Others
-sql/
-*.Cache
-ClientBin/
-[Ss]tyle[Cc]op.*
-~$*
-*~
-*.dbmdl
-*.[Pp]ublish.xml
-*.pfx
-*.publishsettings
-
-# RIA/Silverlight projects
-Generated_Code/
-
-# Backup & report files from converting an old project file to a newer
-# Visual Studio version. Backup files are not needed, because we have git ;-)
-_UpgradeReport_Files/
-Backup*/
-UpgradeLog*.XML
-UpgradeLog*.htm
-
-# SQL Server files
-App_Data/*.mdf
-App_Data/*.ldf
-
-
-#LightSwitch generated files
-GeneratedArtifacts/
-_Pvt_Extensions/
-ModelManifest.xml
-
-# =========================
-# Windows detritus
-# =========================
-
-# Windows image file caches
-Thumbs.db
-ehthumbs.db
-
-# Folder config file
-Desktop.ini
-
-# Recycle Bin used on file shares
-$RECYCLE.BIN/
-
-# Mac desktop service store files
-.DS_Store
Oops, something went wrong.

0 comments on commit bd19c5e

Please sign in to comment.