PT4 вернул к новой версии
This commit is contained in:
parent
27413f906b
commit
183d51742f
|
|
@ -770,6 +770,32 @@
|
|||
</Node>
|
||||
<Node Name="Yield">
|
||||
<Items>
|
||||
<Node Name="NewConstructFiniteAutomata">
|
||||
<Items>
|
||||
<Node Name="ConstructFiniteAutomata1">
|
||||
<FileName>\yield\syntaxvisitors\yieldvisitors\processyieldscapturedvars.cs</FileName>
|
||||
<Text>public ConstructFiniteAutomata1(block bl)</Text>
|
||||
<OCtx>
|
||||
<i Type="Method">public ConstructFiniteAutomata ( block bl )</i>
|
||||
<i Type="ClassOrNamespace">class ConstructFiniteAutomata</i>
|
||||
<i Type="ClassOrNamespace">namespace SyntaxVisitors</i>
|
||||
<i Type="CS_TreeNode">
|
||||
</i>
|
||||
</OCtx>
|
||||
</Node>
|
||||
<Node Name="GenClassesForYield">
|
||||
<FileName>\yield\syntaxvisitors\yieldvisitors\processyieldscapturedvars.cs</FileName>
|
||||
<Text>type_declarations GenClassesForYield(procedure_definition pd,</Text>
|
||||
<OCtx>
|
||||
<i Type="Method">type_declarations GenClassesForYield ( procedure_definition pd , IEnumerable < var_def_statement > fields , IDictionary < string , string > localsMap , IDictionary < string , string > formalParamsMap , IDictionary < var_def_statement , var_def_statement > localsCloneMap )</i>
|
||||
<i Type="ClassOrNamespace">public class ProcessYieldCapturedVarsVisitor : BaseChangeVisitor</i>
|
||||
<i Type="ClassOrNamespace">namespace SyntaxVisitors</i>
|
||||
<i Type="CS_TreeNode">
|
||||
</i>
|
||||
</OCtx>
|
||||
</Node>
|
||||
</Items>
|
||||
</Node>
|
||||
<Node Name="root.visit(new ProcessYieldCapturedVarsVisitor());">
|
||||
<FileName>\Yield\YieldConversionSyntax\YieldDesugarSyntaxTreeConverter.cs</FileName>
|
||||
<Text>root.visit(new ProcessYieldCapturedVarsVisitor());</Text>
|
||||
|
|
@ -796,7 +822,7 @@
|
|||
<FileName>\yield\syntaxvisitors\yieldvisitors\processyieldscapturedvars.cs</FileName>
|
||||
<Text>function_header nfh = ObjectCopier.Clone(fh);</Text>
|
||||
<OCtx>
|
||||
<i Type="Method">type_declarations GenClassesForYield ( procedure_definition pd , IEnumerable < var_def_statement > fields , IDictionary < string , string > localsMap , IDictionary < string , string > formalParamsMap , IDictionary < var_def_statement , var_def_statement > localsCloneMap , yield_locals_type_map_helper localTypeMapHelper )</i>
|
||||
<i Type="Method">type_declarations GenClassesForYield ( procedure_definition pd , IEnumerable < var_def_statement > fields , IDictionary < string , string > localsMap , IDictionary < string , string > formalParamsMap , IDictionary < var_def_statement , var_def_statement > localsCloneMap )</i>
|
||||
<i Type="ClassOrNamespace">public class ProcessYieldCapturedVarsVisitor : BaseChangeVisitor</i>
|
||||
<i Type="ClassOrNamespace">namespace SyntaxVisitors</i>
|
||||
<i Type="CS_TreeNode">
|
||||
|
|
@ -814,6 +840,17 @@
|
|||
</i>
|
||||
</OCtx>
|
||||
</Node>
|
||||
<Node Name="InsertHelperMethod">
|
||||
<FileName>\yield\syntaxvisitors\yieldvisitors\processyieldscapturedvars.cs</FileName>
|
||||
<Text>//InsertHelperMethod(pd, pdCloned); // SSM 13.07.16 - вызов этого метода можно не добавлять</Text>
|
||||
<OCtx>
|
||||
<i Type="Method">private void CreateLocalVariablesTypeProxies ( procedure_definition pd , out IEnumerable < var_def_statement > localsClonesCollection )</i>
|
||||
<i Type="ClassOrNamespace">public class ProcessYieldCapturedVarsVisitor : BaseChangeVisitor</i>
|
||||
<i Type="ClassOrNamespace">namespace SyntaxVisitors</i>
|
||||
<i Type="CS_TreeNode">
|
||||
</i>
|
||||
</OCtx>
|
||||
</Node>
|
||||
<Node Name="UnknownExprType">
|
||||
<Items>
|
||||
<Node Name=" visit(yield_unknown_expression_type">
|
||||
|
|
@ -952,31 +989,27 @@
|
|||
</Node>
|
||||
</Items>
|
||||
</Node>
|
||||
<Node Name="NewConstructFiniteAutomata">
|
||||
<Items>
|
||||
<Node Name="ConstructFiniteAutomata1">
|
||||
<FileName>\yield\syntaxvisitors\yieldvisitors\processyieldscapturedvars.cs</FileName>
|
||||
<Text>public ConstructFiniteAutomata1(block bl)</Text>
|
||||
<OCtx>
|
||||
<i Type="Method">public ConstructFiniteAutomata ( block bl )</i>
|
||||
<i Type="ClassOrNamespace">class ConstructFiniteAutomata</i>
|
||||
<i Type="ClassOrNamespace">namespace SyntaxVisitors</i>
|
||||
<i Type="CS_TreeNode">
|
||||
</i>
|
||||
</OCtx>
|
||||
</Node>
|
||||
<Node Name="GenClassesForYield">
|
||||
<FileName>\yield\syntaxvisitors\yieldvisitors\processyieldscapturedvars.cs</FileName>
|
||||
<Text>type_declarations GenClassesForYield(procedure_definition pd,</Text>
|
||||
<OCtx>
|
||||
<i Type="Method">type_declarations GenClassesForYield ( procedure_definition pd , IEnumerable < var_def_statement > fields , IDictionary < string , string > localsMap , IDictionary < string , string > formalParamsMap , IDictionary < var_def_statement , var_def_statement > localsCloneMap , yield_locals_type_map_helper localTypeMapHelper )</i>
|
||||
<i Type="ClassOrNamespace">public class ProcessYieldCapturedVarsVisitor : BaseChangeVisitor</i>
|
||||
<i Type="ClassOrNamespace">namespace SyntaxVisitors</i>
|
||||
<i Type="CS_TreeNode">
|
||||
</i>
|
||||
</OCtx>
|
||||
</Node>
|
||||
</Items>
|
||||
<Node Name="ReplaceCapturedVariables">
|
||||
<FileName>\yield\syntaxvisitors\yieldvisitors\processyieldscapturedvars.cs</FileName>
|
||||
<Text>ReplaceCapturedVariables(pd, dld.LocalDeletedDefs, out CapturedLocalsNamesMap, out CapturedFormalParamsNamesMap);</Text>
|
||||
<OCtx>
|
||||
<i Type="Method">public override void visit ( procedure_definition pd )</i>
|
||||
<i Type="ClassOrNamespace">public class ProcessYieldCapturedVarsVisitor : BaseChangeVisitor</i>
|
||||
<i Type="ClassOrNamespace">namespace SyntaxVisitors</i>
|
||||
<i Type="CS_TreeNode">
|
||||
</i>
|
||||
</OCtx>
|
||||
</Node>
|
||||
<Node Name="var pdCloned = ObjectCopier.Clone(pd);">
|
||||
<FileName>\yield\syntaxvisitors\yieldvisitors\processyieldscapturedvars.cs</FileName>
|
||||
<Text>var pdCloned = ObjectCopier.Clone(pd);</Text>
|
||||
<OCtx>
|
||||
<i Type="Method">private void CreateLocalVariablesTypeProxies ( procedure_definition pd , out IEnumerable < var_def_statement > localsClonesCollection )</i>
|
||||
<i Type="ClassOrNamespace">public class ProcessYieldCapturedVarsVisitor : BaseChangeVisitor</i>
|
||||
<i Type="ClassOrNamespace">namespace SyntaxVisitors</i>
|
||||
<i Type="CS_TreeNode">
|
||||
</i>
|
||||
</OCtx>
|
||||
</Node>
|
||||
</Items>
|
||||
</Node>
|
||||
|
|
|
|||
|
|
@ -2040,7 +2040,7 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
|
||||
|
||||
///<summary>
|
||||
///Секция описания переменных
|
||||
///Секция описания переменных (до beginа). Состоит из var_def_statement. Не путать с var_statement - однострочным описанием переменной внутри begin-end
|
||||
///</summary>
|
||||
[Serializable]
|
||||
public partial class variable_definitions : declaration
|
||||
|
|
@ -2438,7 +2438,8 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
|
||||
|
||||
///<summary>
|
||||
///Описание переменных
|
||||
///Описание переменных одной строкой. Не содержит var, т.к. встречается исключительно внутри другой конструкции.Может встречаться как до beginа (внутри variable_definitions), так и как внутриблочное описание (внутри var_statement).
|
||||
|
||||
///</summary>
|
||||
[Serializable]
|
||||
public partial class var_def_statement : declaration
|
||||
|
|
@ -22873,7 +22874,7 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
|
||||
|
||||
///<summary>
|
||||
///
|
||||
///Однострочное описание переменной внутри begin-end. Хранит внутри var_def_statement
|
||||
///</summary>
|
||||
[Serializable]
|
||||
public partial class var_statement : statement
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -18,7 +18,7 @@ namespace SyntaxVisitors
|
|||
|
||||
public ISet<string> LocalDeletedDefsNames = new HashSet<string>(); // их имена - для быстрого поиска
|
||||
|
||||
public ISet<ident> CollectedLocals = new HashSet<ident>();
|
||||
public ISet<ident> CollectedLocals = new HashSet<ident>(); // SSM - не очень понимаю, зачем хранить строки, identы и
|
||||
|
||||
public IEnumerable<var_def_statement> LocalDeletedDefs
|
||||
{
|
||||
|
|
@ -44,6 +44,7 @@ namespace SyntaxVisitors
|
|||
}
|
||||
else
|
||||
{
|
||||
// Нескольких переменных тут всё равно не будет - это ошибка
|
||||
ReplaceStatement(vs, SeqStatements(vs.var_def.vars.idents.Select(id => new assign(id, vs.var_def.inital_value)).ToArray()));
|
||||
}
|
||||
|
||||
|
|
@ -51,7 +52,7 @@ namespace SyntaxVisitors
|
|||
CollectedLocals.UnionWith(vs.var_def.vars.idents);
|
||||
}
|
||||
|
||||
public override void visit(variable_definitions vd)
|
||||
public override void visit(variable_definitions vd) // описания до begin
|
||||
{
|
||||
foreach (var v in vd.list)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -617,7 +617,7 @@ namespace SyntaxVisitors
|
|||
pdCloned.has_yield = false;
|
||||
|
||||
// Заменяем локальные переменные с неизвестным типом на обертки-хелперы (откладываем до семантики)
|
||||
LocalVariablesTypeDetectorHelperVisior localsTypeDetectorHelperVisitor = new LocalVariablesTypeDetectorHelperVisior();
|
||||
var localsTypeDetectorHelperVisitor = new LocalVariablesTypeDetectorHelperVisior();
|
||||
pdCloned.visit(localsTypeDetectorHelperVisitor);
|
||||
|
||||
// frninja 16/03/16 - строим список локальных переменных в правильном порядке
|
||||
|
|
@ -627,9 +627,9 @@ namespace SyntaxVisitors
|
|||
localsClonesCollection = localsTypeDetectorHelperVisitor.LocalDeletedDefs.ToArray();
|
||||
|
||||
// Добавляем в класс метод с обертками для локальных переменных
|
||||
//pdCloned.proc_header.name.meth_name = new ident(YieldConsts.YieldHelperMethodPrefix+ "_locals_type_detector>" + pd.proc_header.name.meth_name.name,
|
||||
pdCloned.proc_header.name.meth_name = new ident(YieldConsts.YieldHelperMethodPrefix+ "_locals_type_detector>" + pd.proc_header.name.meth_name.name,
|
||||
// frninja 05/06/16 - фиксим source_context
|
||||
// pd.proc_header.name.meth_name.source_context); // = new method_name("<yield_helper_locals_type_detector>" + pd.proc_header.className.meth_name.className);
|
||||
pd.proc_header.name.meth_name.source_context); // = new method_name("<yield_helper_locals_type_detector>" + pd.proc_header.className.meth_name.className);
|
||||
|
||||
//InsertHelperMethod(pd, pdCloned); // SSM 13.07.16 - вызов этого метода можно не добавлять
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/// Модуль электронного задачника Programming Taskbook 4
|
||||
unit PT4;
|
||||
unit PT4;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Модуль для подключения задачника Programming Taskbook
|
||||
|
|
|
|||
Loading…
Reference in a new issue