diff --git a/Compiler/SyntaxTreeConvertersController/SyntaxTreeConvertersController.cs b/Compiler/SyntaxTreeConvertersController/SyntaxTreeConvertersController.cs index c035eb8e3..de8fdaff6 100644 --- a/Compiler/SyntaxTreeConvertersController/SyntaxTreeConvertersController.cs +++ b/Compiler/SyntaxTreeConvertersController/SyntaxTreeConvertersController.cs @@ -1,6 +1,7 @@ // 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 System; +using System.Linq; using System.Collections.Generic; using System.Text; using System.IO; @@ -42,7 +43,9 @@ namespace PascalABCCompiler.SyntaxTreeConverters private void AddConverters(string DirectoryName) { DirectoryInfo di = new DirectoryInfo(DirectoryName); - FileInfo[] dllfiles = di.GetFiles("*ConversionSyntax.dll"); + List dllfiles = di.GetFiles("*ConversionSyntax.dll").ToList(); + dllfiles.Add(new FileInfo("SyntaxTreeConverters.dll")); + System.Reflection.Assembly assembly = null; ISyntaxTreeConverter Converter; foreach (FileInfo fi in dllfiles) diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 2a0f78eee..d08e0b5ce 100644 --- a/Configuration/GlobalAssemblyInfo.cs +++ b/Configuration/GlobalAssemblyInfo.cs @@ -15,7 +15,7 @@ internal static class RevisionClass public const string Major = "3"; public const string Minor = "1"; public const string Build = "0"; - public const string Revision = "1231"; + public const string Revision = "1232"; public const string MainVersion = Major + "." + Minor; public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision; diff --git a/Configuration/Version.defs b/Configuration/Version.defs index 77b15647d..3498c1449 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ -%COREVERSION%=0 -%REVISION%=1231 %MINOR%=1 +%REVISION%=1232 +%COREVERSION%=0 %MAJOR%=3 diff --git a/Localization/DefaultLang.resources b/Localization/DefaultLang.resources index 49ac4ca6a..f7f6da972 100644 Binary files a/Localization/DefaultLang.resources and b/Localization/DefaultLang.resources differ diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index c40967416..8da5aa4c2 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.1.0.1231' +!define VERSION '3.1.0.1232' diff --git a/SyntaxTreeConverters/SampleSyntaxTreeConverter.cs b/SyntaxTreeConverters/SampleSyntaxTreeConverter.cs new file mode 100644 index 000000000..edcd4926a --- /dev/null +++ b/SyntaxTreeConverters/SampleSyntaxTreeConverter.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.IO; +using PascalABCCompiler.SyntaxTree; + +namespace PascalABCCompiler.SyntaxTreeConverters +{ + public class SampleVisitor: BaseEnterExitVisitor + { + int Tabs = -2; + System.IO.StreamWriter fs; + public SampleVisitor() + { + fs = File.CreateText("d:\\logSampleVisitor.log"); + } + + public string TabString + { + get + { + return new string(' ', Tabs); + } + } + public override void Enter(syntax_tree_node st) + { + Tabs += 2; + fs.Write(TabString); + } + public override void Exit(syntax_tree_node st) + { + Tabs -= 2; + if (st.GetType()==typeof(program_module)) + fs.Close(); + } + public override void DefaultVisit(syntax_tree_node n) + { + fs.WriteLine(n.GetType().Name); + base.DefaultVisit(n); + } + public override void visit(ident id) + { + fs.WriteLine(id.name); + } + public override void visit(int32_const i) + { + fs.WriteLine(i.val); + } + public override void visit(token_info n) + { + fs.WriteLine(n.text); + } + public override void visit(bin_expr n) + { + fs.WriteLine(n.GetType().Name + " " + n.operation_type); + base.DefaultVisit(n); + } + } + + public class SampleSyntaxTreeConverter: ISyntaxTreeConverter + { + 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) + { + //var v = new SampleVisitor(); + //v.ProcessNode(root); + return root; + } + } +} diff --git a/SyntaxTreeConverters/SyntaxTreeConverters.csproj b/SyntaxTreeConverters/SyntaxTreeConverters.csproj index 9ed7accc2..54446dfc5 100644 --- a/SyntaxTreeConverters/SyntaxTreeConverters.csproj +++ b/SyntaxTreeConverters/SyntaxTreeConverters.csproj @@ -7,8 +7,8 @@ {F10A5330-DCF4-4533-877C-7B1B1BE23884} Library Properties - SyntaxTreeChanger - SyntaxTreeChanger + SyntaxTreeConverter + SyntaxTreeConverters v4.0 512 @@ -36,6 +36,7 @@ + diff --git a/bin/Lib/PABCRtl.dll b/bin/Lib/PABCRtl.dll index 51ed41052..212be7af5 100644 Binary files a/bin/Lib/PABCRtl.dll and b/bin/Lib/PABCRtl.dll differ diff --git a/bin/Lng/Rus/SemanticErrors_nv.dat b/bin/Lng/Rus/SemanticErrors_nv.dat index d9889a4a4..3d59d2317 100644 --- a/bin/Lng/Rus/SemanticErrors_nv.dat +++ b/bin/Lng/Rus/SemanticErrors_nv.dat @@ -25,7 +25,7 @@ CLASS_CAN_NOT_BE_DEFINED_IN_TYPE_OR_FUNCTION=Класс не может быть ONLY_ONE_PARAMETER_NAME_WITH_DEFAULT_VALUE_ALLOWED=Допустим только один параметр со значением по умолчанию NEED_DEFAULT_VALUE_FOR_PARAMETER=Этому параметру необходимо значение по умолчанию DUPLICATE_ATTRIBUTE_APPLICATION=Двухкратное применение атрибута -VAR_PARAMETER_CAN_NOT_HAVE_DEFAULT_VALUE=Параметер, передаваемый по ссылке, не может иметь значение по умолчанию +VAR_PARAMETER_CAN_NOT_HAVE_DEFAULT_VALUE=Параметр, передаваемый по ссылке, не может иметь значение по умолчанию DUPLICATE_FUNCTION_DEFINITION=Повторное объявление подпрограммы THIS_EXPRESSION_CAN_NOT_BE_PASSED_BY_ADDRESS=Данный объект не может быть передан как var-параметр MEMBER_{0}_IS_NOT_DECLARED_IN_TYPE_{1}={0} не объявлен в типе {1} @@ -83,7 +83,7 @@ EXPECTED_DELEGATE=Ожидалось имя процедуры или функц EXPECTED_STATIC_METHOD=Ожидался классовый метод EXPECTED_NON_STATIC_METHOD=Ожидался экземплярный метод CAN_NOT_EXPLICITLY_CONVERT_TYPE_{0}_TO_TYPE_{1}=Невозможно явно преобразовать тип {0} к типу {1} -ONLY_ONE_PARAMETER_OF_TYPE_CONVERSION_ALLOWED=У операции преобразования типов допустим только один параметер +ONLY_ONE_PARAMETER_OF_TYPE_CONVERSION_ALLOWED=У операции преобразования типов допустим только один параметр REAL_TYPE_IN_DOUBLE_COLON_EXPRESSION_EXPECTED=Данный формат вывода может быть применен только к вещественному типу ONLY_ONE_PARAMS_PARAMETER_ALLOWED=Допустим только один параметр с ключевым словом params ONLY_UNSIZED_ARRAY_PARAMS_PARAMETER_ALLOWED=Только динамический массив может описываться с ключевым словом params