pascalabcnet/Yield/YieldConversionSyntax/YieldDesugarSyntaxTreeConverter.cs

40 lines
890 B
C#
Raw Normal View History

2016-05-19 02:14:06 +03:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PascalABCCompiler;
using PascalABCCompiler.SyntaxTree;
using PascalABCCompiler.Errors;
2016-05-19 02:14:06 +03:00
using SyntaxVisitors;
using PascalABCCompiler.SyntaxTreeConverters;
namespace YieldDesugarSyntaxTreeConverter
{
public class YieldDesugarSyntaxTreeConverter : ISyntaxTreeConverter
{
public string Name { get; } = "YieldDesugar";
public syntax_tree_node Convert(syntax_tree_node root)
2016-05-19 02:14:06 +03:00
{
root.visit(new MarkMethodHasYieldAndCheckSomeErrorsVisitor());
2016-08-20 11:55:59 +03:00
ProcessYieldCapturedVarsVisitor.New.ProcessNode(root);
2016-06-11 13:25:29 +03:00
#if DEBUG
2016-07-19 23:07:47 +03:00
try
{
2016-08-27 11:14:39 +03:00
//root.visit(new SimplePrettyPrinterVisitor(@"d:\\zzz1.txt"));
2016-07-19 23:07:47 +03:00
}
catch
{
}
#endif
2016-06-11 13:25:29 +03:00
2016-05-19 02:14:06 +03:00
return root;
}
}
}