diff --git a/.gitignore b/.gitignore index 9b8452933..d9918d872 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ **/OptimizerConversion.dll **/PABCRtl.dll **/LanguageIntegrator.dll +**/StringConstants.dll **/ParserTools.dll **/PascalABCParser.dll **/PluginsSupport.dll diff --git a/CodeCompletion/CodeCompletion.cs b/CodeCompletion/CodeCompletion.cs index 9ca08aae1..dd4d7055c 100644 --- a/CodeCompletion/CodeCompletion.cs +++ b/CodeCompletion/CodeCompletion.cs @@ -335,7 +335,7 @@ namespace CodeCompletion public class CodeCompletionNameHelper { - public static readonly string system_unit_file_name = PascalABCCompiler.TreeConverter.compiler_string_consts.pascalSystemUnitName; + public static readonly string system_unit_file_name = PascalABCCompiler.StringConstants.pascalSystemUnitName; public static string system_unit_file_full_name; private static CodeCompletionNameHelper helper; diff --git a/CodeCompletion/CodeCompletion.csproj b/CodeCompletion/CodeCompletion.csproj index 086165685..4953a91fb 100644 --- a/CodeCompletion/CodeCompletion.csproj +++ b/CodeCompletion/CodeCompletion.csproj @@ -99,6 +99,10 @@ {613E0DDA-AA8A-437C-AC45-507B47429FF9} SemanticTree + + {e8aefbf9-0113-4fa4-be45-6cda555498b7} + StringConstants + {C2CAC65A-B2AE-4CCC-B067-E6B8E75DF73A} SyntaxTree diff --git a/CodeCompletion/DomConverter.cs b/CodeCompletion/DomConverter.cs index 4af3cf457..535f76a9a 100644 --- a/CodeCompletion/DomConverter.cs +++ b/CodeCompletion/DomConverter.cs @@ -56,7 +56,7 @@ namespace CodeCompletion foreach (string s in files) { string fname = Path.GetFileNameWithoutExtension(s); - if (fname == "__RedirectIOMode" || fname == "__RunMode" || fname == compiler_string_consts.pascalExtensionsUnitName) + if (fname == "__RedirectIOMode" || fname == "__RunMode" || fname == StringConstants.pascalExtensionsUnitName) continue; SymInfo si = new SymInfo(Path.GetFileNameWithoutExtension(s), SymbolKind.Namespace, null); si.IsUnitNamespace = true; diff --git a/CodeCompletion/DomSyntaxTreeVisitor.cs b/CodeCompletion/DomSyntaxTreeVisitor.cs index e2e42da52..84db7e59e 100644 --- a/CodeCompletion/DomSyntaxTreeVisitor.cs +++ b/CodeCompletion/DomSyntaxTreeVisitor.cs @@ -8,7 +8,6 @@ using System.IO; using PascalABCCompiler.SyntaxTree; using System.Reflection; using PascalABCCompiler; -using PascalABCCompiler.TreeConverter; using PascalABCCompiler.TreeRealization; using PascalABCCompiler.Parsers; @@ -612,7 +611,7 @@ namespace CodeCompletion case Operators.BitwiseNOT: ev.EvalNot(); break; case Operators.LogicalNOT: - ev.EvalNot(); returned_scope = entry_scope.FindName(PascalABCCompiler.TreeConverter.compiler_string_consts.bool_type_name); break; + ev.EvalNot(); returned_scope = entry_scope.FindName(StringConstants.bool_type_name); break; case Operators.Minus: ev.EvalUnmin(); break; } @@ -652,19 +651,19 @@ namespace CodeCompletion public override void visit(bool_const _bool_const) { - returned_scope = TypeTable.bool_type;//entry_scope.FindName(PascalABCCompiler.TreeConverter.compiler_string_consts.bool_type_name); + returned_scope = TypeTable.bool_type;//entry_scope.FindName(StringConstants.bool_type_name); cnst_val.prim_val = _bool_const.val; } public override void visit(int32_const _int32_const) { - returned_scope = TypeTable.int_type;//entry_scope.FindName(PascalABCCompiler.TreeConverter.compiler_string_consts.integer_type_name); + returned_scope = TypeTable.int_type;//entry_scope.FindName(StringConstants.integer_type_name); cnst_val.prim_val = _int32_const.val; } public override void visit(double_const _double_const) { - returned_scope = TypeTable.real_type;//entry_scope.FindName(PascalABCCompiler.TreeConverter.compiler_string_consts.real_type_name); + returned_scope = TypeTable.real_type;//entry_scope.FindName(StringConstants.real_type_name); cnst_val.prim_val = _double_const.val; } @@ -925,7 +924,7 @@ namespace CodeCompletion public override void visit(string_const _string_const) { - returned_scope = TypeTable.string_type;//entry_scope.FindName(PascalABCCompiler.TreeConverter.compiler_string_consts.string_type_name); + returned_scope = TypeTable.string_type;//entry_scope.FindName(StringConstants.string_type_name); //cnst_val.prim_val = "'"+_string_const.Value+"'"; cnst_val.prim_val = this.converter.controller.Parser.LanguageInformation.GetStringForString(_string_const.Value); } @@ -1222,7 +1221,7 @@ namespace CodeCompletion indexes.Add(null); } } - else indexes.Add((TypeScope)entry_scope.FindName(PascalABCCompiler.TreeConverter.compiler_string_consts.integer_type_name)); + else indexes.Add((TypeScope)entry_scope.FindName(StringConstants.integer_type_name)); TypeScope ts = of_type as TypeScope; if (of_type is ProcScope) ts = new ProcType(of_type as ProcScope); @@ -2635,7 +2634,7 @@ namespace CodeCompletion is_system_unit = true; add_standart_types(entry_scope); } - if (_unit_module.unit_name.idunit_name.name == PascalABCCompiler.TreeConverter.compiler_string_consts.pascalExtensionsUnitName) + if (_unit_module.unit_name.idunit_name.name == StringConstants.pascalExtensionsUnitName) { is_extensions_unit = true; } @@ -2731,7 +2730,7 @@ namespace CodeCompletion entry_scope.AddUsedUnit(dc.visitor.entry_scope); add_standart_types(dc.visitor.entry_scope); //get_standart_types(dc.stv); - entry_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.pascalSystemUnitName,dc.visitor.entry_scope); + entry_scope.AddName(StringConstants.pascalSystemUnitName,dc.visitor.entry_scope); } CodeCompletionController.comp_modules[unit_name] = dc; @@ -2741,14 +2740,14 @@ namespace CodeCompletion dc.visitor.entry_scope.InitAssemblies(); entry_scope.AddUsedUnit(dc.visitor.entry_scope); //get_standart_types(dc.stv); - entry_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.pascalSystemUnitName,dc.visitor.entry_scope); + entry_scope.AddName(StringConstants.pascalSystemUnitName,dc.visitor.entry_scope); } } } private void add_extensions_unit() { - string unit_name = CodeCompletionNameHelper.FindSourceFileName(PascalABCCompiler.TreeConverter.compiler_string_consts.pascalExtensionsUnitName, out _); + string unit_name = CodeCompletionNameHelper.FindSourceFileName(StringConstants.pascalExtensionsUnitName, out _); if (unit_name != null) { @@ -2761,7 +2760,7 @@ namespace CodeCompletion { dc.visitor.entry_scope.InitAssemblies(); entry_scope.AddUsedUnit(dc.visitor.entry_scope); - entry_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.pascalExtensionsUnitName, dc.visitor.entry_scope); + entry_scope.AddName(StringConstants.pascalExtensionsUnitName, dc.visitor.entry_scope); } CodeCompletionController.comp_modules[unit_name] = dc; } @@ -2769,7 +2768,7 @@ namespace CodeCompletion { dc.visitor.entry_scope.InitAssemblies(); entry_scope.AddUsedUnit(dc.visitor.entry_scope); - entry_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.pascalExtensionsUnitName, dc.visitor.entry_scope); + entry_scope.AddName(StringConstants.pascalExtensionsUnitName, dc.visitor.entry_scope); } } } @@ -2874,9 +2873,9 @@ namespace CodeCompletion str += "."; } - if (string.Compare(str, PascalABCCompiler.TreeConverter.compiler_string_consts.system_unit_name, true) == 0) + if (string.Compare(str, StringConstants.pascalSystemUnitNamespaceName, true) == 0) has_system_unit = true; - if (string.Compare(str, PascalABCCompiler.TreeConverter.compiler_string_consts.pascalExtensionsUnitName, true) == 0) + if (string.Compare(str, StringConstants.pascalExtensionsUnitName, true) == 0) has_extensions_unit = true; unl.AddElement(new PascalABCCompiler.TreeRealization.using_namespace(str)); } @@ -3075,138 +3074,138 @@ namespace CodeCompletion private void add_standart_types(SymScope cur_scope) { string type_name = null; - //obj_type = new CompiledScope(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.object_type_name, SymbolKind.Type,PascalABCCompiler.TreeConverter.compiler_string_consts.object_type_name),typeof(object)); - cur_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.object_type_name,TypeTable.obj_type); - //int_type = new CompiledScope(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.integer_type_name, SymbolKind.Type,PascalABCCompiler.TreeConverter.compiler_string_consts.integer_type_name),typeof(int)); - //cur_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.integer_type_name, int_type); + //obj_type = new CompiledScope(new SymInfo(StringConstants.object_type_name, SymbolKind.Type,StringConstants.object_type_name),typeof(object)); + cur_scope.AddName(StringConstants.object_type_name,TypeTable.obj_type); + //int_type = new CompiledScope(new SymInfo(StringConstants.integer_type_name, SymbolKind.Type,StringConstants.integer_type_name),typeof(int)); + //cur_scope.AddName(StringConstants.integer_type_name, int_type); type_name = this.converter.controller.Parser.LanguageInformation.GetStandardTypeByKeyword(PascalABCCompiler.Parsers.KeywordKind.IntType); if (type_name != null) cur_scope.AddName(type_name, TypeTable.int_type); - //real_type = new CompiledScope(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.real_type_name, SymbolKind.Type,PascalABCCompiler.TreeConverter.compiler_string_consts.real_type_name),typeof(double)); - //cur_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.real_type_name,real_type); + //real_type = new CompiledScope(new SymInfo(StringConstants.real_type_name, SymbolKind.Type,StringConstants.real_type_name),typeof(double)); + //cur_scope.AddName(StringConstants.real_type_name,real_type); type_name = this.converter.controller.Parser.LanguageInformation.GetStandardTypeByKeyword(PascalABCCompiler.Parsers.KeywordKind.DoubleType); if (type_name != null) cur_scope.AddName(type_name, TypeTable.real_type); - //string_type = new CompiledScope(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.string_type_name, SymbolKind.Class,PascalABCCompiler.TreeConverter.compiler_string_consts.string_type_name),typeof(string)); - cur_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.string_type_name,TypeTable.string_type); - //cur_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.string_type_name, - //new CompiledScope(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.string_type_name, SymbolKind.Type,PascalABCCompiler.TreeConverter.compiler_string_consts.ShortStringTypeName),typeof(string))); - //char_type = new CompiledScope(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.char_type_name, SymbolKind.Type,PascalABCCompiler.TreeConverter.compiler_string_consts.char_type_name),typeof(char)); + //string_type = new CompiledScope(new SymInfo(StringConstants.string_type_name, SymbolKind.Class,StringConstants.string_type_name),typeof(string)); + cur_scope.AddName(StringConstants.string_type_name,TypeTable.string_type); + //cur_scope.AddName(StringConstants.string_type_name, + //new CompiledScope(new SymInfo(StringConstants.string_type_name, SymbolKind.Type,StringConstants.ShortStringTypeName),typeof(string))); + //char_type = new CompiledScope(new SymInfo(StringConstants.char_type_name, SymbolKind.Type,StringConstants.char_type_name),typeof(char)); type_name = this.converter.controller.Parser.LanguageInformation.GetStandardTypeByKeyword(PascalABCCompiler.Parsers.KeywordKind.CharType); if (type_name != null) cur_scope.AddName(type_name, TypeTable.char_type); - //cur_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.char_type_name,char_type); - //bool_type = new CompiledScope(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.bool_type_name, SymbolKind.Type,PascalABCCompiler.TreeConverter.compiler_string_consts.bool_type_name),typeof(bool)); + //cur_scope.AddName(StringConstants.char_type_name,char_type); + //bool_type = new CompiledScope(new SymInfo(StringConstants.bool_type_name, SymbolKind.Type,StringConstants.bool_type_name),typeof(bool)); type_name = this.converter.controller.Parser.LanguageInformation.GetStandardTypeByKeyword(PascalABCCompiler.Parsers.KeywordKind.BoolType); if (type_name != null) cur_scope.AddName(type_name, TypeTable.bool_type); - //cur_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.bool_type_name,bool_type); - //byte_type = new CompiledScope(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.byte_type_name, SymbolKind.Type,PascalABCCompiler.TreeConverter.compiler_string_consts.byte_type_name),typeof(byte)); + //cur_scope.AddName(StringConstants.bool_type_name,bool_type); + //byte_type = new CompiledScope(new SymInfo(StringConstants.byte_type_name, SymbolKind.Type,StringConstants.byte_type_name),typeof(byte)); type_name = this.converter.controller.Parser.LanguageInformation.GetStandardTypeByKeyword(PascalABCCompiler.Parsers.KeywordKind.ByteType); if (type_name != null) cur_scope.AddName(type_name, TypeTable.byte_type); - //cur_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.byte_type_name,byte_type); - //int16_type = new CompiledScope(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.short_type_name, SymbolKind.Type,PascalABCCompiler.TreeConverter.compiler_string_consts.short_type_name),typeof(short)); + //cur_scope.AddName(StringConstants.byte_type_name,byte_type); + //int16_type = new CompiledScope(new SymInfo(StringConstants.short_type_name, SymbolKind.Type,StringConstants.short_type_name),typeof(short)); type_name = this.converter.controller.Parser.LanguageInformation.GetStandardTypeByKeyword(PascalABCCompiler.Parsers.KeywordKind.ShortType); if (type_name != null) cur_scope.AddName(type_name, TypeTable.int16_type); - //cur_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.short_type_name,int16_type); - //sbyte_type = new CompiledScope(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.sbyte_type_name, SymbolKind.Type,PascalABCCompiler.TreeConverter.compiler_string_consts.sbyte_type_name),typeof(sbyte)); + //cur_scope.AddName(StringConstants.short_type_name,int16_type); + //sbyte_type = new CompiledScope(new SymInfo(StringConstants.sbyte_type_name, SymbolKind.Type,StringConstants.sbyte_type_name),typeof(sbyte)); type_name = this.converter.controller.Parser.LanguageInformation.GetStandardTypeByKeyword(PascalABCCompiler.Parsers.KeywordKind.SByteType); if (type_name != null) cur_scope.AddName(type_name, TypeTable.sbyte_type); - //cur_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.sbyte_type_name,sbyte_type); - //uint16_type = new CompiledScope(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.ushort_type_name, SymbolKind.Type,PascalABCCompiler.TreeConverter.compiler_string_consts.ushort_type_name),typeof(ushort)); + //cur_scope.AddName(StringConstants.sbyte_type_name,sbyte_type); + //uint16_type = new CompiledScope(new SymInfo(StringConstants.ushort_type_name, SymbolKind.Type,StringConstants.ushort_type_name),typeof(ushort)); type_name = this.converter.controller.Parser.LanguageInformation.GetStandardTypeByKeyword(PascalABCCompiler.Parsers.KeywordKind.UShortType); if (type_name != null) cur_scope.AddName(type_name, TypeTable.uint16_type); - //cur_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.ushort_type_name,uint16_type); - //uint32_type = new CompiledScope(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.uint_type_name, SymbolKind.Type,PascalABCCompiler.TreeConverter.compiler_string_consts.uint_type_name),typeof(uint)); + //cur_scope.AddName(StringConstants.ushort_type_name,uint16_type); + //uint32_type = new CompiledScope(new SymInfo(StringConstants.uint_type_name, SymbolKind.Type,StringConstants.uint_type_name),typeof(uint)); type_name = this.converter.controller.Parser.LanguageInformation.GetStandardTypeByKeyword(PascalABCCompiler.Parsers.KeywordKind.UIntType); if (type_name != null) cur_scope.AddName(type_name, TypeTable.uint32_type); - //cur_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.uint_type_name,uint32_type); - //int64_type = new CompiledScope(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.long_type_name, SymbolKind.Type,PascalABCCompiler.TreeConverter.compiler_string_consts.long_type_name),typeof(long)); + //cur_scope.AddName(StringConstants.uint_type_name,uint32_type); + //int64_type = new CompiledScope(new SymInfo(StringConstants.long_type_name, SymbolKind.Type,StringConstants.long_type_name),typeof(long)); type_name = this.converter.controller.Parser.LanguageInformation.GetStandardTypeByKeyword(PascalABCCompiler.Parsers.KeywordKind.Int64Type); if (type_name != null) cur_scope.AddName(type_name, TypeTable.int64_type); - //cur_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.long_type_name,int64_type); - //uint64_type = new CompiledScope(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.ulong_type_name, SymbolKind.Type,PascalABCCompiler.TreeConverter.compiler_string_consts.ulong_type_name),typeof(ulong)); + //cur_scope.AddName(StringConstants.long_type_name,int64_type); + //uint64_type = new CompiledScope(new SymInfo(StringConstants.ulong_type_name, SymbolKind.Type,StringConstants.ulong_type_name),typeof(ulong)); type_name = this.converter.controller.Parser.LanguageInformation.GetStandardTypeByKeyword(PascalABCCompiler.Parsers.KeywordKind.UInt64Type); if (type_name != null) cur_scope.AddName(type_name, TypeTable.uint64_type); - //cur_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.ulong_type_name,uint64_type); - //float_type = new CompiledScope(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.float_type_name, SymbolKind.Type,PascalABCCompiler.TreeConverter.compiler_string_consts.float_type_name),typeof(float)); + //cur_scope.AddName(StringConstants.ulong_type_name,uint64_type); + //float_type = new CompiledScope(new SymInfo(StringConstants.float_type_name, SymbolKind.Type,StringConstants.float_type_name),typeof(float)); type_name = this.converter.controller.Parser.LanguageInformation.GetStandardTypeByKeyword(PascalABCCompiler.Parsers.KeywordKind.FloatType); if (type_name != null) cur_scope.AddName(type_name, TypeTable.float_type); - //cur_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.float_type_name,float_type); - //ptr_type = new CompiledScope(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.pointer_type_name, SymbolKind.Type,PascalABCCompiler.TreeConverter.compiler_string_consts.pointer_type_name),Type.GetType("System.Void*")); + //cur_scope.AddName(StringConstants.float_type_name,float_type); + //ptr_type = new CompiledScope(new SymInfo(StringConstants.pointer_type_name, SymbolKind.Type,StringConstants.pointer_type_name),Type.GetType("System.Void*")); type_name = this.converter.controller.Parser.LanguageInformation.GetStandardTypeByKeyword(PascalABCCompiler.Parsers.KeywordKind.PointerType); if (type_name != null) cur_scope.AddName(type_name, TypeTable.ptr_type); - //cur_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.pointer_type_name,ptr_type); - ProcScope ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.set_length_procedure_name,null); + //cur_scope.AddName(StringConstants.pointer_type_name,ptr_type); + ProcScope ps = new ProcScope(StringConstants.set_length_procedure_name,null); ps.AddParameter(new ElementScope(new SymInfo("arr", SymbolKind.Parameter,"arr"),new ArrayScope(),null,ps)); ps.parameters[0].param_kind = parametr_kind.var_parametr; ps.AddParameter(new ElementScope(new SymInfo("length", SymbolKind.Parameter,"length"),TypeTable.int_type,null,ps)); ps.Complete(); - cur_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.set_length_procedure_name,ps); - cur_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.true_const_name,new ElementScope(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.true_const_name, SymbolKind.Constant,PascalABCCompiler.TreeConverter.compiler_string_consts.true_const_name),TypeTable.bool_type,true,null)); - cur_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.false_const_name,new ElementScope(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.false_const_name, SymbolKind.Constant,PascalABCCompiler.TreeConverter.compiler_string_consts.false_const_name),TypeTable.bool_type,false,null)); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.new_procedure_name,null); + cur_scope.AddName(StringConstants.set_length_procedure_name,ps); + cur_scope.AddName(StringConstants.true_const_name,new ElementScope(new SymInfo(StringConstants.true_const_name, SymbolKind.Constant,StringConstants.true_const_name),TypeTable.bool_type,true,null)); + cur_scope.AddName(StringConstants.false_const_name,new ElementScope(new SymInfo(StringConstants.false_const_name, SymbolKind.Constant,StringConstants.false_const_name),TypeTable.bool_type,false,null)); + ps = new ProcScope(StringConstants.new_procedure_name,null); ElementScope prm = new ElementScope(new SymInfo("p", SymbolKind.Parameter,"p"),TypeTable.ptr_type,null,ps); prm.param_kind = parametr_kind.var_parametr; ps.AddParameter(prm); ps.Complete(); - cur_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.new_procedure_name,ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.dispose_procedure_name,null); + cur_scope.AddName(StringConstants.new_procedure_name,ps); + ps = new ProcScope(StringConstants.dispose_procedure_name,null); prm = new ElementScope(new SymInfo("p", SymbolKind.Parameter,"p"),TypeTable.ptr_type,null,ps); prm.param_kind = parametr_kind.var_parametr; ps.AddParameter(prm); ps.Complete(); - cur_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.dispose_procedure_name,ps); + cur_scope.AddName(StringConstants.dispose_procedure_name,ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.IncProcedure, null); + ps = new ProcScope(StringConstants.IncProcedure, null); prm = new ElementScope(new SymInfo("i", SymbolKind.Parameter, "i"), TypeTable.int16_type, null, ps); prm.param_kind = parametr_kind.var_parametr; ps.AddParameter(prm); ps.Complete(); ps.si.not_include = true; - cur_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.IncProcedure, ps); + cur_scope.AddName(StringConstants.IncProcedure, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.IncProcedure, null); + ps = new ProcScope(StringConstants.IncProcedure, null); prm = new ElementScope(new SymInfo("i", SymbolKind.Parameter, "i"), TypeTable.uint16_type, null, ps); prm.param_kind = parametr_kind.var_parametr; ps.AddParameter(prm); ps.Complete(); ps.si.not_include = true; - cur_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.IncProcedure, ps); + cur_scope.AddName(StringConstants.IncProcedure, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.IncProcedure, null); + ps = new ProcScope(StringConstants.IncProcedure, null); prm = new ElementScope(new SymInfo("i", SymbolKind.Parameter, "i"), TypeTable.sbyte_type, null, ps); prm.param_kind = parametr_kind.var_parametr; ps.AddParameter(prm); ps.Complete(); ps.si.not_include = true; - cur_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.IncProcedure, ps); + cur_scope.AddName(StringConstants.IncProcedure, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.IncProcedure, null); + ps = new ProcScope(StringConstants.IncProcedure, null); prm = new ElementScope(new SymInfo("i", SymbolKind.Parameter, "i"), TypeTable.int64_type, null, ps); prm.param_kind = parametr_kind.var_parametr; ps.AddParameter(prm); ps.Complete(); ps.si.not_include = true; - cur_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.IncProcedure, ps); + cur_scope.AddName(StringConstants.IncProcedure, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.IncProcedure, null); + ps = new ProcScope(StringConstants.IncProcedure, null); prm = new ElementScope(new SymInfo("i", SymbolKind.Parameter, "i"), TypeTable.uint64_type, null, ps); prm.param_kind = parametr_kind.var_parametr; ps.AddParameter(prm); ps.Complete(); ps.si.not_include = true; - cur_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.IncProcedure, ps); + cur_scope.AddName(StringConstants.IncProcedure, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.IncProcedure, null); + ps = new ProcScope(StringConstants.IncProcedure, null); prm = new ElementScope(new SymInfo("i", SymbolKind.Parameter, "i"), TypeTable.uint32_type, null, ps); prm.param_kind = parametr_kind.var_parametr; ps.AddParameter(prm); ps.Complete(); ps.si.not_include = true; - cur_scope.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.IncProcedure, ps); + cur_scope.AddName(StringConstants.IncProcedure, ps); } public override void visit(hex_constant _hex_constant) { //throw new Exception("The method or operation is not implemented."); - returned_scope = TypeTable.uint64_type;//entry_scope.FindName(PascalABCCompiler.TreeConverter.compiler_string_consts.ulong_type_name); + returned_scope = TypeTable.uint64_type;//entry_scope.FindName(StringConstants.ulong_type_name); cnst_val.prim_val = _hex_constant.val; } @@ -3838,7 +3837,7 @@ namespace CodeCompletion if (element_type != null) returned_scope = new SetScope(element_type); else - returned_scope = cur_scope.FindName(PascalABCCompiler.TreeConverter.compiler_string_consts.set_name); + returned_scope = cur_scope.FindName(StringConstants.set_name); cnst_val.prim_val = null; } @@ -4332,7 +4331,7 @@ namespace CodeCompletion foreach (enumerator en in _enum_type_definition.enumerators.enumerators) { var name = (en.name as named_type_reference).FirstIdent.name; - ElementScope ss = new ElementScope(new SymInfo(name, SymbolKind.Constant, name),/*cur_scope.FindName(PascalABCCompiler.TreeConverter.compiler_string_consts.integer_type_name)*/enum_scope, cur_scope); + ElementScope ss = new ElementScope(new SymInfo(name, SymbolKind.Constant, name),/*cur_scope.FindName(StringConstants.integer_type_name)*/enum_scope, cur_scope); ss.is_static = true; ss.cnst_val = name; elems.Add(ss); @@ -4350,7 +4349,7 @@ namespace CodeCompletion public override void visit(char_const _char_const) { - returned_scope = TypeTable.char_type;//entry_scope.FindName(PascalABCCompiler.TreeConverter.compiler_string_consts.char_type_name); + returned_scope = TypeTable.char_type;//entry_scope.FindName(StringConstants.char_type_name); if (in_kav) cnst_val.prim_val = this.converter.controller.Parser.LanguageInformation.GetStringForChar(_char_const.cconst); //cnst_val.prim_val = "'"+_char_const.cconst.ToString()+"'"; @@ -4364,14 +4363,14 @@ namespace CodeCompletion public override void visit(sharp_char_const _sharp_char_const) { - returned_scope = TypeTable.char_type;//entry_scope.FindName(PascalABCCompiler.TreeConverter.compiler_string_consts.char_type_name); + returned_scope = TypeTable.char_type;//entry_scope.FindName(StringConstants.char_type_name); cnst_val.prim_val = this.converter.controller.Parser.LanguageInformation.GetStringForSharpChar(_sharp_char_const.char_num); } private bool in_kav=true; public override void visit(literal_const_line _literal_const_line) { - //entry_scope.FindName(PascalABCCompiler.TreeConverter.compiler_string_consts.string_type_name); + //entry_scope.FindName(StringConstants.string_type_name); StringBuilder sb = new StringBuilder(); in_kav = false; for (int i = 0; i < _literal_const_line.literals.Count; i++) @@ -4398,7 +4397,7 @@ namespace CodeCompletion { } - returned_scope = new ShortStringScope(TypeTable.string_type,cnst_val.prim_val);//entry_scope.FindName(PascalABCCompiler.TreeConverter.compiler_string_consts.string_type_name); + returned_scope = new ShortStringScope(TypeTable.string_type,cnst_val.prim_val);//entry_scope.FindName(StringConstants.string_type_name); returned_scope.topScope = cur_scope; returned_scope.loc = get_location(_string_num_definition); } @@ -4756,7 +4755,7 @@ namespace CodeCompletion ref has_system_unit, ref has_extensions_unit, unl); } } - //if (_interface_node.unit_name.idunit_name.name != PascalABCCompiler.TreeConverter.compiler_string_consts.system_unit_file_name) + //if (_interface_node.unit_name.idunit_name.name != StringConstants.system_unit_file_name) if (!is_system_unit && !has_system_unit) add_system_unit(); if (!is_system_unit && !is_extensions_unit && !has_extensions_unit) @@ -5152,13 +5151,13 @@ namespace CodeCompletion public override void visit(int64_const _int64_const) { //throw new Exception("The method or operation is not implemented."); - returned_scope = TypeTable.int64_type;//entry_scope.FindName(PascalABCCompiler.TreeConverter.compiler_string_consts.long_type_name); + returned_scope = TypeTable.int64_type;//entry_scope.FindName(StringConstants.long_type_name); cnst_val.prim_val = _int64_const.val; } public override void visit(uint64_const _uint64_const) { - returned_scope = TypeTable.uint64_type;//entry_scope.FindName(PascalABCCompiler.TreeConverter.compiler_string_consts.ulong_type_name); + returned_scope = TypeTable.uint64_type;//entry_scope.FindName(StringConstants.ulong_type_name); cnst_val.prim_val = _uint64_const.val; } @@ -5232,30 +5231,30 @@ namespace CodeCompletion { switch(op) { - case Operators.Plus : return PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name; - case Operators.Minus : return PascalABCCompiler.TreeConverter.compiler_string_consts.minus_name; - case Operators.Division : return PascalABCCompiler.TreeConverter.compiler_string_consts.div_name; - case Operators.IntegerDivision: return PascalABCCompiler.TreeConverter.compiler_string_consts.div_name; - case Operators.Multiplication : return PascalABCCompiler.TreeConverter.compiler_string_consts.mul_name; - case Operators.ModulusRemainder : return PascalABCCompiler.TreeConverter.compiler_string_consts.mod_name; - case Operators.Less : return PascalABCCompiler.TreeConverter.compiler_string_consts.sm_name; - case Operators.LessEqual : return PascalABCCompiler.TreeConverter.compiler_string_consts.smeq_name; - case Operators.Greater : return PascalABCCompiler.TreeConverter.compiler_string_consts.gr_name; - case Operators.GreaterEqual : return PascalABCCompiler.TreeConverter.compiler_string_consts.greq_name; - case Operators.Equal : return PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name; - case Operators.NotEqual : return PascalABCCompiler.TreeConverter.compiler_string_consts.noteq_name; - case Operators.AssignmentAddition : return PascalABCCompiler.TreeConverter.compiler_string_consts.plusassign_name; - case Operators.AssignmentMultiplication : return PascalABCCompiler.TreeConverter.compiler_string_consts.multassign_name; - case Operators.AssignmentSubtraction : return PascalABCCompiler.TreeConverter.compiler_string_consts.minusassign_name; - case Operators.AssignmentDivision : return PascalABCCompiler.TreeConverter.compiler_string_consts.divassign_name; + case Operators.Plus : return StringConstants.plus_name; + case Operators.Minus : return StringConstants.minus_name; + case Operators.Division : return StringConstants.div_name; + case Operators.IntegerDivision: return StringConstants.div_name; + case Operators.Multiplication : return StringConstants.mul_name; + case Operators.ModulusRemainder : return StringConstants.mod_name; + case Operators.Less : return StringConstants.sm_name; + case Operators.LessEqual : return StringConstants.smeq_name; + case Operators.Greater : return StringConstants.gr_name; + case Operators.GreaterEqual : return StringConstants.greq_name; + case Operators.Equal : return StringConstants.eq_name; + case Operators.NotEqual : return StringConstants.noteq_name; + case Operators.AssignmentAddition : return StringConstants.plusassign_name; + case Operators.AssignmentMultiplication : return StringConstants.multassign_name; + case Operators.AssignmentSubtraction : return StringConstants.minusassign_name; + case Operators.AssignmentDivision : return StringConstants.divassign_name; case Operators.Implicit : return "implicit"; case Operators.Explicit : return "explicit"; - case Operators.In: return PascalABCCompiler.TreeConverter.compiler_string_consts.in_name; - case Operators.Power: return PascalABCCompiler.TreeConverter.compiler_string_consts.power_name; - case Operators.LogicalOR: return PascalABCCompiler.TreeConverter.compiler_string_consts.or_name; - case Operators.LogicalAND: return PascalABCCompiler.TreeConverter.compiler_string_consts.and_name; - case Operators.BitwiseXOR: return PascalABCCompiler.TreeConverter.compiler_string_consts.xor_name; - case Operators.LogicalNOT: return PascalABCCompiler.TreeConverter.compiler_string_consts.not_name; + case Operators.In: return StringConstants.in_name; + case Operators.Power: return StringConstants.power_name; + case Operators.LogicalOR: return StringConstants.or_name; + case Operators.LogicalAND: return StringConstants.and_name; + case Operators.BitwiseXOR: return StringConstants.xor_name; + case Operators.LogicalNOT: return StringConstants.not_name; } return ""; } @@ -5821,7 +5820,7 @@ namespace CodeCompletion { method_call mc = new method_call(); mc.parameters = new expression_list(new List { _diapason_expr_new.left, _diapason_expr_new.right }); - mc.dereferencing_value = new dot_node(new ident(compiler_string_consts.pascalSystemUnitName), new ident("InternalRange")); + mc.dereferencing_value = new dot_node(new ident(StringConstants.pascalSystemUnitName), new ident("InternalRange")); mc.visit(this); } diff --git a/CodeCompletion/ExpressionVisitor.cs b/CodeCompletion/ExpressionVisitor.cs index af73b94a0..687f4500d 100644 --- a/CodeCompletion/ExpressionVisitor.cs +++ b/CodeCompletion/ExpressionVisitor.cs @@ -471,7 +471,7 @@ namespace CodeCompletion public override void visit(string_const _string_const) { - returned_scope = new ElementScope(entry_scope.FindName(PascalABCCompiler.TreeConverter.compiler_string_consts.string_type_name)); + returned_scope = new ElementScope(entry_scope.FindName(StringConstants.string_type_name)); } public override void visit(expression_list _expression_list) @@ -1450,7 +1450,7 @@ namespace CodeCompletion if (returned_scope != null) returned_scope = new ElementScope(returned_scope); } else if (_typecast_node.cast_op == op_typecast.is_op) - returned_scope = new ElementScope(entry_scope.FindName(PascalABCCompiler.TreeConverter.compiler_string_consts.bool_type_name)); + returned_scope = new ElementScope(entry_scope.FindName(StringConstants.bool_type_name)); } public override void visit(interface_node _interface_node) @@ -1546,7 +1546,7 @@ namespace CodeCompletion public override void visit(format_expr _format_expr) { - returned_scope = entry_scope.FindName(PascalABCCompiler.TreeConverter.compiler_string_consts.string_type_name); + returned_scope = entry_scope.FindName(StringConstants.string_type_name); } public override void visit(initfinal_part _initfinal_part) @@ -1776,7 +1776,7 @@ namespace CodeCompletion public override void visit(sizeof_operator _sizeof_operator) { - returned_scope = new ElementScope(entry_scope.FindName(PascalABCCompiler.TreeConverter.compiler_string_consts.integer_type_name)); + returned_scope = new ElementScope(entry_scope.FindName(StringConstants.integer_type_name)); } public override void visit(typeof_operator _typeof_operator) @@ -2041,7 +2041,7 @@ namespace CodeCompletion method_call mc = new method_call(); mc.parameters = new expression_list(new List { _diapason_expr_new.left, _diapason_expr_new.right }); - mc.dereferencing_value = new dot_node(new ident(compiler_string_consts.pascalSystemUnitName), new ident("InternalRange")); + mc.dereferencing_value = new dot_node(new ident(StringConstants.pascalSystemUnitName), new ident("InternalRange")); mc.visit(this); } @@ -2051,7 +2051,7 @@ namespace CodeCompletion var rr = this.returned_scope; //var nn = new new_expr((syntax_type, plist, true, new SyntaxTree.array_const(acn.elements, acn.elements.source_context), acn.source_context); //var nn = new new_expr($2, el, true, $6 as array_const, @$); - var dn = new dot_node(new ident(compiler_string_consts.pascalSystemUnitName), new ident("Arr"), acn.source_context); + var dn = new dot_node(new ident(StringConstants.pascalSystemUnitName), new ident("Arr"), acn.source_context); var el = new expression_list(acn.elements.expressions[0], acn.source_context); var nn = new method_call(dn, el, acn.source_context); visit(nn); diff --git a/CodeCompletion/SymTable.cs b/CodeCompletion/SymTable.cs index df190c520..d43881ca5 100644 --- a/CodeCompletion/SymTable.cs +++ b/CodeCompletion/SymTable.cs @@ -75,19 +75,19 @@ namespace CodeCompletion if (!ctn.IsEnum) switch (tc) { - case TypeCode.Int32: return PascalABCCompiler.TreeConverter.compiler_string_consts.integer_type_name; - case TypeCode.Double: return PascalABCCompiler.TreeConverter.compiler_string_consts.real_type_name; - case TypeCode.Boolean: return PascalABCCompiler.TreeConverter.compiler_string_consts.bool_type_name; - case TypeCode.String: return PascalABCCompiler.TreeConverter.compiler_string_consts.string_type_name; - case TypeCode.Char: return PascalABCCompiler.TreeConverter.compiler_string_consts.char_type_name; - case TypeCode.Byte: return PascalABCCompiler.TreeConverter.compiler_string_consts.byte_type_name; - case TypeCode.SByte: return PascalABCCompiler.TreeConverter.compiler_string_consts.sbyte_type_name; - case TypeCode.Int16: return PascalABCCompiler.TreeConverter.compiler_string_consts.short_type_name; - case TypeCode.Int64: return PascalABCCompiler.TreeConverter.compiler_string_consts.long_type_name; - case TypeCode.UInt16: return PascalABCCompiler.TreeConverter.compiler_string_consts.ushort_type_name; - case TypeCode.UInt32: return PascalABCCompiler.TreeConverter.compiler_string_consts.uint_type_name; - case TypeCode.UInt64: return PascalABCCompiler.TreeConverter.compiler_string_consts.ulong_type_name; - case TypeCode.Single: return PascalABCCompiler.TreeConverter.compiler_string_consts.float_type_name; + case TypeCode.Int32: return StringConstants.integer_type_name; + case TypeCode.Double: return StringConstants.real_type_name; + case TypeCode.Boolean: return StringConstants.bool_type_name; + case TypeCode.String: return StringConstants.string_type_name; + case TypeCode.Char: return StringConstants.char_type_name; + case TypeCode.Byte: return StringConstants.byte_type_name; + case TypeCode.SByte: return StringConstants.sbyte_type_name; + case TypeCode.Int16: return StringConstants.short_type_name; + case TypeCode.Int64: return StringConstants.long_type_name; + case TypeCode.UInt16: return StringConstants.ushort_type_name; + case TypeCode.UInt32: return StringConstants.uint_type_name; + case TypeCode.UInt64: return StringConstants.ulong_type_name; + case TypeCode.Single: return StringConstants.float_type_name; } else return ctn.FullName; @@ -108,7 +108,7 @@ namespace CodeCompletion return sb.ToString(); } if (ctn.IsArray) return "array of " + GetTypeName(ctn.GetElementType()); - if (ctn == Type.GetType("System.Void*")) return PascalABCCompiler.TreeConverter.compiler_string_consts.pointer_type_name; + if (ctn == Type.GetType("System.Void*")) return StringConstants.pointer_type_name; return ctn.FullName; } @@ -137,14 +137,14 @@ namespace CodeCompletion return sb.ToString(); } //if (ctn.IsArray) return "array of "+GetTypeName(ctn.GetElementType()); - //if (ctn == Type.GetType("System.Void*")) return PascalABCCompiler.TreeConverter.compiler_string_consts.pointer_type_name; + //if (ctn == Type.GetType("System.Void*")) return StringConstants.pointer_type_name; return ctn.Name; } public static string GetTopScopeName(SymScope sc) { if (sc == null || sc.si == null) return ""; - if (sc.si.name == "" || sc.si.name.Contains("$") || sc.si.name == PascalABCCompiler.TreeConverter.compiler_string_consts.pascalSystemUnitName) return ""; + if (sc.si.name == "" || sc.si.name.Contains("$") || sc.si.name == StringConstants.pascalSystemUnitName) return ""; if (sc is ProcScope) return ""; return sc.si.name + "."; } @@ -495,7 +495,7 @@ namespace CodeCompletion private bool hasUsesCycle(SymScope unit, int deep=0) { - if (unit.Name == compiler_string_consts.pascalSystemUnitName) + if (unit.Name == StringConstants.pascalSystemUnitName) return true; if (deep > 100) return true; @@ -525,7 +525,7 @@ namespace CodeCompletion public void AddUsedUnit(SymScope unit) { - if (this.si.name != compiler_string_consts.pascalSystemUnitName || unit is NamespaceScope) + if (this.si.name != StringConstants.pascalSystemUnitName || unit is NamespaceScope) used_units.Add(unit); } @@ -5336,8 +5336,8 @@ namespace CodeCompletion else { Type t = PascalABCCompiler.NetHelper.NetHelper.FindType(full_name); - if (t == null) t = PascalABCCompiler.NetHelper.NetHelper.FindType(full_name + PascalABCCompiler.TreeConverter.compiler_string_consts.generic_params_infix + "1"); - if (t == null) t = PascalABCCompiler.NetHelper.NetHelper.FindType(full_name + PascalABCCompiler.TreeConverter.compiler_string_consts.generic_params_infix + "2"); + if (t == null) t = PascalABCCompiler.NetHelper.NetHelper.FindType(full_name + StringConstants.generic_params_infix + "1"); + if (t == null) t = PascalABCCompiler.NetHelper.NetHelper.FindType(full_name + StringConstants.generic_params_infix + "2"); if (t != null) { return TypeTable.get_compiled_type(new SymInfo(s, SymbolKind.Type, full_name), t); diff --git a/CodeCompletion/Testing.cs b/CodeCompletion/Testing.cs index 7e91cb5c4..90f4a50fe 100644 --- a/CodeCompletion/Testing.cs +++ b/CodeCompletion/Testing.cs @@ -32,7 +32,7 @@ namespace CodeCompletion var controller = new CodeCompletion.CodeCompletionController(); CodeCompletion.DomSyntaxTreeVisitor.use_semantic_for_intellisense = true; CodeCompletion.CodeCompletionController.comp = comp; - CodeCompletion.CodeCompletionController.SetParser(compiler_string_consts.pascalSourceFileExtension); + CodeCompletion.CodeCompletionController.SetParser(StringConstants.pascalSourceFileExtension); CodeCompletion.CodeCompletionController.ParsersController = comp.ParsersController; var files = Directory.GetFiles(dir, "*.pas"); var parser = comp.ParsersController; @@ -104,7 +104,7 @@ namespace CodeCompletion var comp = new PascalABCCompiler.Compiler(); var controller = new CodeCompletion.CodeCompletionController(); CodeCompletion.CodeCompletionController.comp = comp; - CodeCompletion.CodeCompletionController.SetParser(compiler_string_consts.pascalSourceFileExtension); + CodeCompletion.CodeCompletionController.SetParser(StringConstants.pascalSourceFileExtension); CodeCompletion.CodeCompletionController.ParsersController = comp.ParsersController; var files = Directory.GetFiles(dir, "*.pas"); var parser = comp.ParsersController; @@ -341,7 +341,7 @@ namespace CodeCompletion int col=0; PascalABCCompiler.Parsers.KeywordKind keyw; LanguageIntegration.LanguageIntegrator.ReloadAllParsers(); - IParser parser = CodeCompletionController.ParsersController.SelectParser(compiler_string_consts.pascalSourceFileExtension); + IParser parser = CodeCompletionController.ParsersController.SelectParser(StringConstants.pascalSourceFileExtension); string test_str = "System.Console"; off = test_str.Length; diff --git a/CodeCompletion/TypeTable.cs b/CodeCompletion/TypeTable.cs index fa583165b..49142892d 100644 --- a/CodeCompletion/TypeTable.cs +++ b/CodeCompletion/TypeTable.cs @@ -136,919 +136,919 @@ namespace CodeCompletion static TypeTable() { - obj_type = get_compiled_type(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.object_type_name, SymbolKind.Type, PascalABCCompiler.TreeConverter.compiler_string_consts.object_type_name), typeof(object)); + obj_type = get_compiled_type(new SymInfo(StringConstants.object_type_name, SymbolKind.Type, StringConstants.object_type_name), typeof(object)); - int_type = get_compiled_type(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.integer_type_name, SymbolKind.Type, PascalABCCompiler.TreeConverter.compiler_string_consts.integer_type_name), typeof(int)); + int_type = get_compiled_type(new SymInfo(StringConstants.integer_type_name, SymbolKind.Type, StringConstants.integer_type_name), typeof(int)); - real_type = get_compiled_type(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.real_type_name, SymbolKind.Type, PascalABCCompiler.TreeConverter.compiler_string_consts.real_type_name), typeof(double)); + real_type = get_compiled_type(new SymInfo(StringConstants.real_type_name, SymbolKind.Type, StringConstants.real_type_name), typeof(double)); - string_type = get_compiled_type(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.string_type_name, SymbolKind.Class, PascalABCCompiler.TreeConverter.compiler_string_consts.string_type_name), typeof(string)); + string_type = get_compiled_type(new SymInfo(StringConstants.string_type_name, SymbolKind.Class, StringConstants.string_type_name), typeof(string)); - char_type = get_compiled_type(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.char_type_name, SymbolKind.Type, PascalABCCompiler.TreeConverter.compiler_string_consts.char_type_name), typeof(char)); + char_type = get_compiled_type(new SymInfo(StringConstants.char_type_name, SymbolKind.Type, StringConstants.char_type_name), typeof(char)); - bool_type = get_compiled_type(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.bool_type_name, SymbolKind.Type, PascalABCCompiler.TreeConverter.compiler_string_consts.bool_type_name), typeof(bool)); + bool_type = get_compiled_type(new SymInfo(StringConstants.bool_type_name, SymbolKind.Type, StringConstants.bool_type_name), typeof(bool)); - byte_type = get_compiled_type(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.byte_type_name, SymbolKind.Type, PascalABCCompiler.TreeConverter.compiler_string_consts.byte_type_name), typeof(byte)); + byte_type = get_compiled_type(new SymInfo(StringConstants.byte_type_name, SymbolKind.Type, StringConstants.byte_type_name), typeof(byte)); - int16_type = get_compiled_type(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.short_type_name, SymbolKind.Type, PascalABCCompiler.TreeConverter.compiler_string_consts.short_type_name), typeof(short)); + int16_type = get_compiled_type(new SymInfo(StringConstants.short_type_name, SymbolKind.Type, StringConstants.short_type_name), typeof(short)); - sbyte_type = get_compiled_type(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.sbyte_type_name, SymbolKind.Type, PascalABCCompiler.TreeConverter.compiler_string_consts.sbyte_type_name), typeof(sbyte)); + sbyte_type = get_compiled_type(new SymInfo(StringConstants.sbyte_type_name, SymbolKind.Type, StringConstants.sbyte_type_name), typeof(sbyte)); - uint16_type = get_compiled_type(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.ushort_type_name, SymbolKind.Type, PascalABCCompiler.TreeConverter.compiler_string_consts.ushort_type_name), typeof(ushort)); + uint16_type = get_compiled_type(new SymInfo(StringConstants.ushort_type_name, SymbolKind.Type, StringConstants.ushort_type_name), typeof(ushort)); - uint32_type = get_compiled_type(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.uint_type_name, SymbolKind.Type, PascalABCCompiler.TreeConverter.compiler_string_consts.uint_type_name), typeof(uint)); + uint32_type = get_compiled_type(new SymInfo(StringConstants.uint_type_name, SymbolKind.Type, StringConstants.uint_type_name), typeof(uint)); - int64_type = get_compiled_type(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.long_type_name, SymbolKind.Type, PascalABCCompiler.TreeConverter.compiler_string_consts.long_type_name), typeof(long)); + int64_type = get_compiled_type(new SymInfo(StringConstants.long_type_name, SymbolKind.Type, StringConstants.long_type_name), typeof(long)); - uint64_type = get_compiled_type(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.ulong_type_name, SymbolKind.Type, PascalABCCompiler.TreeConverter.compiler_string_consts.ulong_type_name), typeof(ulong)); + uint64_type = get_compiled_type(new SymInfo(StringConstants.ulong_type_name, SymbolKind.Type, StringConstants.ulong_type_name), typeof(ulong)); - float_type = get_compiled_type(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.float_type_name, SymbolKind.Type, PascalABCCompiler.TreeConverter.compiler_string_consts.float_type_name), typeof(float)); + float_type = get_compiled_type(new SymInfo(StringConstants.float_type_name, SymbolKind.Type, StringConstants.float_type_name), typeof(float)); - ptr_type = get_compiled_type(new SymInfo(PascalABCCompiler.TreeConverter.compiler_string_consts.pointer_type_name, SymbolKind.Type, PascalABCCompiler.TreeConverter.compiler_string_consts.pointer_type_name), Type.GetType("System.Void*")); + ptr_type = get_compiled_type(new SymInfo(StringConstants.pointer_type_name, SymbolKind.Type, StringConstants.pointer_type_name), Type.GetType("System.Void*")); void_type = get_compiled_type(new SymInfo("void", SymbolKind.Type, "void"), typeof(void)); - ProcScope ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name, int_type); + ProcScope ps = new ProcScope(StringConstants.plus_name, int_type); int_plus = ps; ElementScope left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); ElementScope right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); ps.return_type = int_type; ps.AddParameter(left); ps.AddParameter(right); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name, ps); + int_type.AddName(StringConstants.plus_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.minus_name, int_type); + ps = new ProcScope(StringConstants.minus_name, int_type); int_minus = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); ps.return_type = int_type; ps.AddParameter(left); ps.AddParameter(right); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.minus_name, ps); + int_type.AddName(StringConstants.minus_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.mul_name, int_type); + ps = new ProcScope(StringConstants.mul_name, int_type); int_mul = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); ps.return_type = int_type; ps.AddParameter(left); ps.AddParameter(right); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.mul_name, ps); + int_type.AddName(StringConstants.mul_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.idiv_name, int_type); + ps = new ProcScope(StringConstants.idiv_name, int_type); int_div = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); ps.return_type = int_type; ps.AddParameter(left); ps.AddParameter(right); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.idiv_name, ps); + int_type.AddName(StringConstants.idiv_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.mod_name, int_type); + ps = new ProcScope(StringConstants.mod_name, int_type); int_mod = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); ps.return_type = int_type; ps.AddParameter(left); ps.AddParameter(right); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.mod_name, ps); + int_type.AddName(StringConstants.mod_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.shl_name, int_type); + ps = new ProcScope(StringConstants.shl_name, int_type); int_shl = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); ps.return_type = int_type; ps.AddParameter(left); ps.AddParameter(right); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.shl_name, ps); + int_type.AddName(StringConstants.shl_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.shr_name, int_type); + ps = new ProcScope(StringConstants.shr_name, int_type); int_shr = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); ps.return_type = int_type; ps.AddParameter(left); ps.AddParameter(right); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.shr_name, ps); + int_type.AddName(StringConstants.shr_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.and_name, int_type); + ps = new ProcScope(StringConstants.and_name, int_type); int_and = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); ps.return_type = int_type; ps.AddParameter(left); ps.AddParameter(right); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.and_name, ps); + int_type.AddName(StringConstants.and_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.or_name, int_type); + ps = new ProcScope(StringConstants.or_name, int_type); int_or = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); ps.return_type = int_type; ps.AddParameter(left); ps.AddParameter(right); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.or_name, ps); + int_type.AddName(StringConstants.or_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.xor_name, int_type); + ps = new ProcScope(StringConstants.xor_name, int_type); int_xor = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); ps.return_type = int_type; ps.AddParameter(left); ps.AddParameter(right); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.xor_name, ps); + int_type.AddName(StringConstants.xor_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name, int_type); + ps = new ProcScope(StringConstants.eq_name, int_type); int_eq = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name, ps); + int_type.AddName(StringConstants.eq_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.noteq_name, int_type); + ps = new ProcScope(StringConstants.noteq_name, int_type); int_noteq = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.noteq_name, ps); + int_type.AddName(StringConstants.noteq_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.sm_name, int_type); + ps = new ProcScope(StringConstants.sm_name, int_type); int_sm = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.sm_name, ps); + int_type.AddName(StringConstants.sm_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.smeq_name, int_type); + ps = new ProcScope(StringConstants.smeq_name, int_type); int_smeq = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.smeq_name, ps); + int_type.AddName(StringConstants.smeq_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.gr_name, int_type); + ps = new ProcScope(StringConstants.gr_name, int_type); int_gr = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.gr_name, ps); + int_type.AddName(StringConstants.gr_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.greq_name, int_type); + ps = new ProcScope(StringConstants.greq_name, int_type); int_greq = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int_type, int_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.greq_name, ps); + int_type.AddName(StringConstants.greq_name, ps); //byte type - byte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name, int_plus); - byte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.minus_name, int_minus); - byte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.mul_name, int_mul); - byte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.idiv_name, int_div); - byte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.mod_name, int_mod); - byte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.shl_name, int_shl); - byte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.shr_name, int_shr); - byte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name, int_eq); - byte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.noteq_name, int_noteq); - byte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.sm_name, int_sm); - byte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.smeq_name, int_smeq); - byte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.gr_name, int_gr); - byte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.greq_name, int_greq); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.and_name, byte_type); + byte_type.AddName(StringConstants.plus_name, int_plus); + byte_type.AddName(StringConstants.minus_name, int_minus); + byte_type.AddName(StringConstants.mul_name, int_mul); + byte_type.AddName(StringConstants.idiv_name, int_div); + byte_type.AddName(StringConstants.mod_name, int_mod); + byte_type.AddName(StringConstants.shl_name, int_shl); + byte_type.AddName(StringConstants.shr_name, int_shr); + byte_type.AddName(StringConstants.eq_name, int_eq); + byte_type.AddName(StringConstants.noteq_name, int_noteq); + byte_type.AddName(StringConstants.sm_name, int_sm); + byte_type.AddName(StringConstants.smeq_name, int_smeq); + byte_type.AddName(StringConstants.gr_name, int_gr); + byte_type.AddName(StringConstants.greq_name, int_greq); + ps = new ProcScope(StringConstants.and_name, byte_type); byte_and = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), byte_type, byte_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), byte_type, byte_type); ps.return_type = byte_type; ps.AddParameter(left); ps.AddParameter(right); - byte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.and_name, ps); + byte_type.AddName(StringConstants.and_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.or_name, byte_type); + ps = new ProcScope(StringConstants.or_name, byte_type); byte_or = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), byte_type, byte_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), byte_type, byte_type); ps.return_type = byte_type; ps.AddParameter(left); ps.AddParameter(right); - byte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.or_name, ps); + byte_type.AddName(StringConstants.or_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.xor_name, byte_type); + ps = new ProcScope(StringConstants.xor_name, byte_type); byte_xor = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), byte_type, byte_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), byte_type, byte_type); ps.return_type = byte_type; ps.AddParameter(left); ps.AddParameter(right); - byte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.xor_name, ps); + byte_type.AddName(StringConstants.xor_name, ps); //sbyte - sbyte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name, int_plus); - sbyte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.minus_name, int_minus); - sbyte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.mul_name, int_mul); - sbyte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.idiv_name, int_div); - sbyte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.mod_name, int_mod); - sbyte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.shl_name, int_shl); - sbyte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.shr_name, int_shr); - sbyte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name, int_eq); - sbyte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.noteq_name, int_noteq); - sbyte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.sm_name, int_sm); - sbyte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.smeq_name, int_smeq); - sbyte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.gr_name, int_gr); - sbyte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.greq_name, int_greq); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.and_name, sbyte_type); + sbyte_type.AddName(StringConstants.plus_name, int_plus); + sbyte_type.AddName(StringConstants.minus_name, int_minus); + sbyte_type.AddName(StringConstants.mul_name, int_mul); + sbyte_type.AddName(StringConstants.idiv_name, int_div); + sbyte_type.AddName(StringConstants.mod_name, int_mod); + sbyte_type.AddName(StringConstants.shl_name, int_shl); + sbyte_type.AddName(StringConstants.shr_name, int_shr); + sbyte_type.AddName(StringConstants.eq_name, int_eq); + sbyte_type.AddName(StringConstants.noteq_name, int_noteq); + sbyte_type.AddName(StringConstants.sm_name, int_sm); + sbyte_type.AddName(StringConstants.smeq_name, int_smeq); + sbyte_type.AddName(StringConstants.gr_name, int_gr); + sbyte_type.AddName(StringConstants.greq_name, int_greq); + ps = new ProcScope(StringConstants.and_name, sbyte_type); sbyte_and = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), sbyte_type, sbyte_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), sbyte_type, sbyte_type); ps.return_type = sbyte_type; ps.AddParameter(left); ps.AddParameter(right); - sbyte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.and_name, ps); + sbyte_type.AddName(StringConstants.and_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.or_name, sbyte_type); + ps = new ProcScope(StringConstants.or_name, sbyte_type); sbyte_or = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), sbyte_type, sbyte_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), sbyte_type, sbyte_type); ps.return_type = sbyte_type; ps.AddParameter(left); ps.AddParameter(right); - sbyte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.or_name, ps); + sbyte_type.AddName(StringConstants.or_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.xor_name, sbyte_type); + ps = new ProcScope(StringConstants.xor_name, sbyte_type); sbyte_xor = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), sbyte_type, sbyte_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), sbyte_type, sbyte_type); ps.return_type = sbyte_type; ps.AddParameter(left); ps.AddParameter(right); - sbyte_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.xor_name, ps); + sbyte_type.AddName(StringConstants.xor_name, ps); //ushort - uint16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name, int_plus); - uint16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.minus_name, int_minus); - uint16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.mul_name, int_mul); - uint16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.idiv_name, int_div); - uint16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.mod_name, int_mod); - uint16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.shl_name, int_shl); - uint16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.shr_name, int_shr); - uint16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name, int_eq); - uint16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.noteq_name, int_noteq); - uint16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.sm_name, int_sm); - uint16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.smeq_name, int_smeq); - uint16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.gr_name, int_gr); - uint16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.greq_name, int_greq); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.and_name, uint16_type); + uint16_type.AddName(StringConstants.plus_name, int_plus); + uint16_type.AddName(StringConstants.minus_name, int_minus); + uint16_type.AddName(StringConstants.mul_name, int_mul); + uint16_type.AddName(StringConstants.idiv_name, int_div); + uint16_type.AddName(StringConstants.mod_name, int_mod); + uint16_type.AddName(StringConstants.shl_name, int_shl); + uint16_type.AddName(StringConstants.shr_name, int_shr); + uint16_type.AddName(StringConstants.eq_name, int_eq); + uint16_type.AddName(StringConstants.noteq_name, int_noteq); + uint16_type.AddName(StringConstants.sm_name, int_sm); + uint16_type.AddName(StringConstants.smeq_name, int_smeq); + uint16_type.AddName(StringConstants.gr_name, int_gr); + uint16_type.AddName(StringConstants.greq_name, int_greq); + ps = new ProcScope(StringConstants.and_name, uint16_type); uint16_and = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), uint16_type, uint16_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), uint16_type, uint16_type); ps.return_type = uint16_type; ps.AddParameter(left); ps.AddParameter(right); - uint16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.and_name, ps); + uint16_type.AddName(StringConstants.and_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.or_name, uint16_type); + ps = new ProcScope(StringConstants.or_name, uint16_type); uint16_or = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), uint16_type, uint16_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), uint16_type, uint16_type); ps.return_type = uint16_type; ps.AddParameter(left); ps.AddParameter(right); - uint16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.or_name, ps); + uint16_type.AddName(StringConstants.or_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.xor_name, uint16_type); + ps = new ProcScope(StringConstants.xor_name, uint16_type); uint16_xor = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), uint16_type, uint16_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), uint16_type, uint16_type); ps.return_type = uint16_type; ps.AddParameter(left); ps.AddParameter(right); - uint16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.xor_name, ps); + uint16_type.AddName(StringConstants.xor_name, ps); //int16 - int16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name, int_plus); - int16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.minus_name, int_minus); - int16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.mul_name, int_mul); - int16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.idiv_name, int_div); - int16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.mod_name, int_mod); - int16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.shl_name, int_shl); - int16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.shr_name, int_shr); - int16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name, int_eq); - int16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.noteq_name, int_noteq); - int16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.sm_name, int_sm); - int16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.smeq_name, int_smeq); - int16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.gr_name, int_gr); - int16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.greq_name, int_greq); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.and_name, uint16_type); + int16_type.AddName(StringConstants.plus_name, int_plus); + int16_type.AddName(StringConstants.minus_name, int_minus); + int16_type.AddName(StringConstants.mul_name, int_mul); + int16_type.AddName(StringConstants.idiv_name, int_div); + int16_type.AddName(StringConstants.mod_name, int_mod); + int16_type.AddName(StringConstants.shl_name, int_shl); + int16_type.AddName(StringConstants.shr_name, int_shr); + int16_type.AddName(StringConstants.eq_name, int_eq); + int16_type.AddName(StringConstants.noteq_name, int_noteq); + int16_type.AddName(StringConstants.sm_name, int_sm); + int16_type.AddName(StringConstants.smeq_name, int_smeq); + int16_type.AddName(StringConstants.gr_name, int_gr); + int16_type.AddName(StringConstants.greq_name, int_greq); + ps = new ProcScope(StringConstants.and_name, uint16_type); int16_and = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int16_type, int16_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int16_type, int16_type); ps.return_type = int16_type; ps.AddParameter(left); ps.AddParameter(right); - int16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.and_name, ps); + int16_type.AddName(StringConstants.and_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.or_name, int16_type); + ps = new ProcScope(StringConstants.or_name, int16_type); int16_or = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int16_type, int16_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int16_type, int16_type); ps.return_type = int16_type; ps.AddParameter(left); ps.AddParameter(right); - int16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.or_name, ps); + int16_type.AddName(StringConstants.or_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.xor_name, int16_type); + ps = new ProcScope(StringConstants.xor_name, int16_type); int16_xor = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int16_type, int16_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int16_type, int16_type); ps.return_type = int16_type; ps.AddParameter(left); ps.AddParameter(right); - int16_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.xor_name, ps); + int16_type.AddName(StringConstants.xor_name, ps); //int64 - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name, int64_type); + ps = new ProcScope(StringConstants.plus_name, int64_type); int64_plus = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); ps.return_type = int64_type; ps.AddParameter(left); ps.AddParameter(right); - int64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name, ps); + int64_type.AddName(StringConstants.plus_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.minus_name, int64_type); + ps = new ProcScope(StringConstants.minus_name, int64_type); int64_minus = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); ps.return_type = int64_type; ps.AddParameter(left); ps.AddParameter(right); - int64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.minus_name, ps); + int64_type.AddName(StringConstants.minus_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.mul_name, int64_type); + ps = new ProcScope(StringConstants.mul_name, int64_type); int64_mul = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); ps.return_type = int64_type; ps.AddParameter(left); ps.AddParameter(right); - int64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.mul_name, ps); + int64_type.AddName(StringConstants.mul_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.idiv_name, int64_type); + ps = new ProcScope(StringConstants.idiv_name, int64_type); int64_div = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); ps.return_type = int64_type; ps.AddParameter(left); ps.AddParameter(right); - int64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.idiv_name, ps); + int64_type.AddName(StringConstants.idiv_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.mod_name, int64_type); + ps = new ProcScope(StringConstants.mod_name, int64_type); int64_mod = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); ps.return_type = int64_type; ps.AddParameter(left); ps.AddParameter(right); - int64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.mod_name, ps); + int64_type.AddName(StringConstants.mod_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.shl_name, int64_type); + ps = new ProcScope(StringConstants.shl_name, int64_type); int64_shl = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); ps.return_type = int64_type; ps.AddParameter(left); ps.AddParameter(right); - int64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.shl_name, ps); + int64_type.AddName(StringConstants.shl_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.shr_name, int64_type); + ps = new ProcScope(StringConstants.shr_name, int64_type); int64_shr = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); ps.return_type = int64_type; ps.AddParameter(left); ps.AddParameter(right); - int64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.shr_name, ps); + int64_type.AddName(StringConstants.shr_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.and_name, int64_type); + ps = new ProcScope(StringConstants.and_name, int64_type); int64_and = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); ps.return_type = int64_type; ps.AddParameter(left); ps.AddParameter(right); - int64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.and_name, ps); + int64_type.AddName(StringConstants.and_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.or_name, int64_type); + ps = new ProcScope(StringConstants.or_name, int64_type); int64_or = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); ps.return_type = int64_type; ps.AddParameter(left); ps.AddParameter(right); - int64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.or_name, ps); + int64_type.AddName(StringConstants.or_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.xor_name, int64_type); + ps = new ProcScope(StringConstants.xor_name, int64_type); int64_xor = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); ps.return_type = int64_type; ps.AddParameter(left); ps.AddParameter(right); - int64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.xor_name, ps); + int64_type.AddName(StringConstants.xor_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name, int64_type); + ps = new ProcScope(StringConstants.eq_name, int64_type); int64_eq = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - int64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name, ps); + int64_type.AddName(StringConstants.eq_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.noteq_name, int64_type); + ps = new ProcScope(StringConstants.noteq_name, int64_type); int64_noteq = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - int64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.noteq_name, ps); + int64_type.AddName(StringConstants.noteq_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.sm_name, int64_type); + ps = new ProcScope(StringConstants.sm_name, int64_type); int64_sm = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - int64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.sm_name, ps); + int64_type.AddName(StringConstants.sm_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.smeq_name, int64_type); + ps = new ProcScope(StringConstants.smeq_name, int64_type); int64_smeq = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - int64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.smeq_name, ps); + int64_type.AddName(StringConstants.smeq_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.gr_name, int64_type); + ps = new ProcScope(StringConstants.gr_name, int64_type); int64_gr = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - int64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.gr_name, ps); + int64_type.AddName(StringConstants.gr_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.greq_name, int64_type); + ps = new ProcScope(StringConstants.greq_name, int64_type); int64_greq = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - int64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.greq_name, ps); + int64_type.AddName(StringConstants.greq_name, ps); //uint //int16 - uint32_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name, int64_plus); - uint32_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.minus_name, int64_minus); - uint32_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.mul_name, int64_mul); - uint32_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.idiv_name, int64_div); - uint32_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.mod_name, int64_mod); - uint32_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.shl_name, int64_shl); - uint32_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.shr_name, int64_shr); - uint32_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name, int64_eq); - uint32_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.noteq_name, int64_noteq); - uint32_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.sm_name, int64_sm); - uint32_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.smeq_name, int64_smeq); - uint32_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.gr_name, int64_gr); - uint32_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.greq_name, int64_greq); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.and_name, uint32_type); + uint32_type.AddName(StringConstants.plus_name, int64_plus); + uint32_type.AddName(StringConstants.minus_name, int64_minus); + uint32_type.AddName(StringConstants.mul_name, int64_mul); + uint32_type.AddName(StringConstants.idiv_name, int64_div); + uint32_type.AddName(StringConstants.mod_name, int64_mod); + uint32_type.AddName(StringConstants.shl_name, int64_shl); + uint32_type.AddName(StringConstants.shr_name, int64_shr); + uint32_type.AddName(StringConstants.eq_name, int64_eq); + uint32_type.AddName(StringConstants.noteq_name, int64_noteq); + uint32_type.AddName(StringConstants.sm_name, int64_sm); + uint32_type.AddName(StringConstants.smeq_name, int64_smeq); + uint32_type.AddName(StringConstants.gr_name, int64_gr); + uint32_type.AddName(StringConstants.greq_name, int64_greq); + ps = new ProcScope(StringConstants.and_name, uint32_type); uint32_and = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), uint32_type, uint32_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), uint32_type, uint32_type); ps.return_type = uint32_type; ps.AddParameter(left); ps.AddParameter(right); - uint32_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.and_name, ps); + uint32_type.AddName(StringConstants.and_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.or_name, uint32_type); + ps = new ProcScope(StringConstants.or_name, uint32_type); uint32_or = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), uint32_type, uint32_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), uint32_type, uint32_type); ps.return_type = uint32_type; ps.AddParameter(left); ps.AddParameter(right); - uint32_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.or_name, ps); + uint32_type.AddName(StringConstants.or_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.xor_name, uint32_type); + ps = new ProcScope(StringConstants.xor_name, uint32_type); uint32_xor = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), uint32_type, uint32_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), uint32_type, uint32_type); ps.return_type = uint32_type; ps.AddParameter(left); ps.AddParameter(right); - uint32_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.xor_name, ps); + uint32_type.AddName(StringConstants.xor_name, ps); //uint64 type - uint64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name, int64_plus); - uint64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.minus_name, int64_minus); - uint64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.mul_name, int64_mul); - uint64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.idiv_name, int64_div); - uint64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.mod_name, int64_mod); - uint64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.shl_name, int64_shl); - uint64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.shr_name, int64_shr); - uint64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name, int64_eq); - uint64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.noteq_name, int64_noteq); - uint64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.sm_name, int64_sm); - uint64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.smeq_name, int64_smeq); - uint64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.gr_name, int64_gr); - uint64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.greq_name, int64_greq); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.and_name, uint64_type); + uint64_type.AddName(StringConstants.plus_name, int64_plus); + uint64_type.AddName(StringConstants.minus_name, int64_minus); + uint64_type.AddName(StringConstants.mul_name, int64_mul); + uint64_type.AddName(StringConstants.idiv_name, int64_div); + uint64_type.AddName(StringConstants.mod_name, int64_mod); + uint64_type.AddName(StringConstants.shl_name, int64_shl); + uint64_type.AddName(StringConstants.shr_name, int64_shr); + uint64_type.AddName(StringConstants.eq_name, int64_eq); + uint64_type.AddName(StringConstants.noteq_name, int64_noteq); + uint64_type.AddName(StringConstants.sm_name, int64_sm); + uint64_type.AddName(StringConstants.smeq_name, int64_smeq); + uint64_type.AddName(StringConstants.gr_name, int64_gr); + uint64_type.AddName(StringConstants.greq_name, int64_greq); + ps = new ProcScope(StringConstants.and_name, uint64_type); uint64_and = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), uint64_type, uint64_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), uint64_type, uint64_type); ps.return_type = uint64_type; ps.AddParameter(left); ps.AddParameter(right); - uint64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.and_name, ps); + uint64_type.AddName(StringConstants.and_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.or_name, uint64_type); + ps = new ProcScope(StringConstants.or_name, uint64_type); uint64_or = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), uint64_type, uint64_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), uint64_type, uint64_type); ps.return_type = uint64_type; ps.AddParameter(left); ps.AddParameter(right); - uint64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.or_name, ps); + uint64_type.AddName(StringConstants.or_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.xor_name, uint64_type); + ps = new ProcScope(StringConstants.xor_name, uint64_type); uint64_xor = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), uint64_type, uint64_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), uint64_type, uint64_type); ps.return_type = uint64_type; ps.AddParameter(left); ps.AddParameter(right); - uint64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.xor_name, ps); + uint64_type.AddName(StringConstants.xor_name, ps); //real_type - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name, real_type); + ps = new ProcScope(StringConstants.plus_name, real_type); real_plus = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), real_type, real_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), real_type, real_type); ps.return_type = real_type; ps.AddParameter(left); ps.AddParameter(right); - real_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name, ps); + real_type.AddName(StringConstants.plus_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.minus_name, real_type); + ps = new ProcScope(StringConstants.minus_name, real_type); real_minus = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), real_type, real_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), real_type, real_type); ps.return_type = real_type; ps.AddParameter(left); ps.AddParameter(right); - real_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.minus_name, ps); + real_type.AddName(StringConstants.minus_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.mul_name, real_type); + ps = new ProcScope(StringConstants.mul_name, real_type); real_mul = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), real_type, real_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), real_type, real_type); ps.return_type = real_type; ps.AddParameter(left); ps.AddParameter(right); - real_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.mul_name, ps); + real_type.AddName(StringConstants.mul_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.div_name, real_type); + ps = new ProcScope(StringConstants.div_name, real_type); real_div = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), real_type, real_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), real_type, real_type); ps.return_type = real_type; ps.AddParameter(left); ps.AddParameter(right); - real_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.div_name, ps); + real_type.AddName(StringConstants.div_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name, real_type); + ps = new ProcScope(StringConstants.eq_name, real_type); real_eq = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), real_type, real_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), real_type, real_type); ps.return_type = real_type; ps.AddParameter(left); ps.AddParameter(right); - real_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name, ps); + real_type.AddName(StringConstants.eq_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.noteq_name, real_type); + ps = new ProcScope(StringConstants.noteq_name, real_type); real_noteq = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), real_type, real_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), real_type, real_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - real_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.noteq_name, ps); + real_type.AddName(StringConstants.noteq_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.sm_name, real_type); + ps = new ProcScope(StringConstants.sm_name, real_type); real_sm = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), real_type, real_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), real_type, real_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - real_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.sm_name, ps); + real_type.AddName(StringConstants.sm_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.smeq_name, real_type); + ps = new ProcScope(StringConstants.smeq_name, real_type); real_smeq = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), real_type, real_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), real_type, real_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - real_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.smeq_name, ps); + real_type.AddName(StringConstants.smeq_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.gr_name, real_type); + ps = new ProcScope(StringConstants.gr_name, real_type); real_gr = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), real_type, real_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), real_type, real_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - real_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.gr_name, ps); + real_type.AddName(StringConstants.gr_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.greq_name, int64_type); + ps = new ProcScope(StringConstants.greq_name, int64_type); real_greq = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), int64_type, int64_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - real_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.greq_name, ps); + real_type.AddName(StringConstants.greq_name, ps); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name, int64_plus); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.minus_name, int64_minus); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.mul_name, int64_mul); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.idiv_name, int64_div); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.mod_name, int64_mod); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.shl_name, int64_shl); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.shr_name, int64_shr); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name, int64_eq); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.noteq_name, int64_noteq); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.sm_name, int64_sm); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.smeq_name, int64_smeq); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.gr_name, int64_gr); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.greq_name, int64_greq); + int_type.AddName(StringConstants.plus_name, int64_plus); + int_type.AddName(StringConstants.minus_name, int64_minus); + int_type.AddName(StringConstants.mul_name, int64_mul); + int_type.AddName(StringConstants.idiv_name, int64_div); + int_type.AddName(StringConstants.mod_name, int64_mod); + int_type.AddName(StringConstants.shl_name, int64_shl); + int_type.AddName(StringConstants.shr_name, int64_shr); + int_type.AddName(StringConstants.eq_name, int64_eq); + int_type.AddName(StringConstants.noteq_name, int64_noteq); + int_type.AddName(StringConstants.sm_name, int64_sm); + int_type.AddName(StringConstants.smeq_name, int64_smeq); + int_type.AddName(StringConstants.gr_name, int64_gr); + int_type.AddName(StringConstants.greq_name, int64_greq); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name, real_plus); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.minus_name, real_minus); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.mul_name, real_mul); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.div_name, real_div); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name, real_eq); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.noteq_name, real_noteq); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.sm_name, real_sm); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.smeq_name, real_smeq); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.gr_name, real_gr); - int_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.greq_name, real_greq); + int_type.AddName(StringConstants.plus_name, real_plus); + int_type.AddName(StringConstants.minus_name, real_minus); + int_type.AddName(StringConstants.mul_name, real_mul); + int_type.AddName(StringConstants.div_name, real_div); + int_type.AddName(StringConstants.eq_name, real_eq); + int_type.AddName(StringConstants.noteq_name, real_noteq); + int_type.AddName(StringConstants.sm_name, real_sm); + int_type.AddName(StringConstants.smeq_name, real_smeq); + int_type.AddName(StringConstants.gr_name, real_gr); + int_type.AddName(StringConstants.greq_name, real_greq); - int64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name, real_plus); - int64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.minus_name, real_minus); - int64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.mul_name, real_mul); - int64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.div_name, real_div); - int64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name, real_eq); - int64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.noteq_name, real_noteq); - int64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.sm_name, real_sm); - int64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.smeq_name, real_smeq); - int64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.gr_name, real_gr); - int64_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.greq_name, real_greq); + int64_type.AddName(StringConstants.plus_name, real_plus); + int64_type.AddName(StringConstants.minus_name, real_minus); + int64_type.AddName(StringConstants.mul_name, real_mul); + int64_type.AddName(StringConstants.div_name, real_div); + int64_type.AddName(StringConstants.eq_name, real_eq); + int64_type.AddName(StringConstants.noteq_name, real_noteq); + int64_type.AddName(StringConstants.sm_name, real_sm); + int64_type.AddName(StringConstants.smeq_name, real_smeq); + int64_type.AddName(StringConstants.gr_name, real_gr); + int64_type.AddName(StringConstants.greq_name, real_greq); //boolean type - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.and_name, bool_type); + ps = new ProcScope(StringConstants.and_name, bool_type); bool_and = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), bool_type, bool_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), bool_type, bool_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - bool_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.and_name, ps); + bool_type.AddName(StringConstants.and_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.or_name, bool_type); + ps = new ProcScope(StringConstants.or_name, bool_type); bool_or = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), bool_type, bool_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), bool_type, bool_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - bool_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.or_name, ps); + bool_type.AddName(StringConstants.or_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.xor_name, bool_type); + ps = new ProcScope(StringConstants.xor_name, bool_type); bool_xor = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), bool_type, bool_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), bool_type, bool_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - bool_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.xor_name, ps); + bool_type.AddName(StringConstants.xor_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name, bool_type); + ps = new ProcScope(StringConstants.eq_name, bool_type); bool_eq = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), bool_type, bool_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), bool_type, bool_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - bool_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name, ps); + bool_type.AddName(StringConstants.eq_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.noteq_name, bool_type); + ps = new ProcScope(StringConstants.noteq_name, bool_type); bool_noteq = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), bool_type, bool_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), bool_type, bool_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - bool_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.noteq_name, ps); + bool_type.AddName(StringConstants.noteq_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.sm_name, bool_type); + ps = new ProcScope(StringConstants.sm_name, bool_type); bool_sm = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), bool_type, bool_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), bool_type, bool_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - bool_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.sm_name, ps); + bool_type.AddName(StringConstants.sm_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.smeq_name, bool_type); + ps = new ProcScope(StringConstants.smeq_name, bool_type); bool_smeq = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), bool_type, bool_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), bool_type, bool_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - bool_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.smeq_name, ps); + bool_type.AddName(StringConstants.smeq_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.gr_name, bool_type); + ps = new ProcScope(StringConstants.gr_name, bool_type); bool_gr = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), bool_type, bool_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), bool_type, bool_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - bool_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.gr_name, ps); + bool_type.AddName(StringConstants.gr_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.greq_name, bool_type); + ps = new ProcScope(StringConstants.greq_name, bool_type); bool_greq = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), bool_type, bool_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), bool_type, bool_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - bool_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.greq_name, ps); + bool_type.AddName(StringConstants.greq_name, ps); //char type - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name, char_type); + ps = new ProcScope(StringConstants.eq_name, char_type); char_eq = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), char_type, char_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), char_type, char_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - char_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name, ps); + char_type.AddName(StringConstants.eq_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.noteq_name, char_type); + ps = new ProcScope(StringConstants.noteq_name, char_type); char_noteq = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), char_type, char_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), char_type, char_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - char_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.noteq_name, ps); + char_type.AddName(StringConstants.noteq_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.sm_name, char_type); + ps = new ProcScope(StringConstants.sm_name, char_type); char_sm = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), char_type, char_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), char_type, char_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - char_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.sm_name, ps); + char_type.AddName(StringConstants.sm_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.smeq_name, char_type); + ps = new ProcScope(StringConstants.smeq_name, char_type); char_smeq = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), char_type, char_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), char_type, char_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - char_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.smeq_name, ps); + char_type.AddName(StringConstants.smeq_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.greq_name, char_type); + ps = new ProcScope(StringConstants.greq_name, char_type); char_greq = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), char_type, char_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), char_type, char_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - char_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.greq_name, ps); + char_type.AddName(StringConstants.greq_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.gr_name, char_type); + ps = new ProcScope(StringConstants.gr_name, char_type); char_gr = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), char_type, char_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), char_type, char_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - char_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.gr_name, ps); + char_type.AddName(StringConstants.gr_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name, char_type); + ps = new ProcScope(StringConstants.plus_name, char_type); char_plus = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), char_type, char_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), char_type, char_type); ps.return_type = string_type; ps.AddParameter(left); ps.AddParameter(right); - char_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name, ps); + char_type.AddName(StringConstants.plus_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name, char_type); + ps = new ProcScope(StringConstants.plus_name, char_type); left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), char_type, char_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), string_type, char_type); ps.return_type = string_type; ps.AddParameter(left); ps.AddParameter(right); - char_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name, ps); + char_type.AddName(StringConstants.plus_name, ps); //string type - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name, string_type); + ps = new ProcScope(StringConstants.plus_name, string_type); string_plus = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), string_type, string_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), string_type, string_type); ps.return_type = string_type; ps.AddParameter(left); ps.AddParameter(right); - string_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name, ps); + string_type.AddName(StringConstants.plus_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name, string_type); + ps = new ProcScope(StringConstants.eq_name, string_type); string_eq = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), string_type, string_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), string_type, string_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - string_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name, ps); + string_type.AddName(StringConstants.eq_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.noteq_name, string_type); + ps = new ProcScope(StringConstants.noteq_name, string_type); string_noteq = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), string_type, string_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), string_type, string_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - string_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.noteq_name, ps); + string_type.AddName(StringConstants.noteq_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.sm_name, string_type); + ps = new ProcScope(StringConstants.sm_name, string_type); string_sm = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), string_type, string_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), string_type, string_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - string_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.sm_name, ps); + string_type.AddName(StringConstants.sm_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.smeq_name, string_type); + ps = new ProcScope(StringConstants.smeq_name, string_type); string_smeq = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), string_type, string_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), string_type, string_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - string_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.smeq_name, ps); + string_type.AddName(StringConstants.smeq_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.gr_name, string_type); + ps = new ProcScope(StringConstants.gr_name, string_type); string_gr = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), string_type, string_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), string_type, string_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - string_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.gr_name, ps); + string_type.AddName(StringConstants.gr_name, ps); - ps = new ProcScope(PascalABCCompiler.TreeConverter.compiler_string_consts.greq_name, string_type); + ps = new ProcScope(StringConstants.greq_name, string_type); string_greq = ps; left = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), string_type, string_type); right = new ElementScope(new SymInfo("", SymbolKind.Parameter, ""), string_type, string_type); ps.return_type = bool_type; ps.AddParameter(left); ps.AddParameter(right); - string_type.AddName(PascalABCCompiler.TreeConverter.compiler_string_consts.greq_name, ps); + string_type.AddName(StringConstants.greq_name, ps); } public static CompiledScope get_compiled_type(Type t) diff --git a/Compiler/Compiler.cs b/Compiler/Compiler.cs index 8303a16a8..3c2f2f276 100644 --- a/Compiler/Compiler.cs +++ b/Compiler/Compiler.cs @@ -279,12 +279,6 @@ namespace PascalABCCompiler { this.sourceLocation = new SourceLocation(sl.doc.file_name, sl.begin_line_num, sl.begin_column_num, sl.end_line_num, sl.end_column_num); } - - public ResourceFileNotFound(string ResFileName) - : base(string.Format(StringResources.Get("COMPILATIONERROR_RESOURCEFILE_{0}_NOT_FOUND"), ResFileName), null) - { - //this.sourceLocation = new SourceLocation(sl.doc.file_name, sl.begin_line_num, sl.begin_column_num, sl.end_line_num, sl.end_column_num); - } } public class IncludeNamespaceInUnitError : CompilerCompilationError @@ -397,13 +391,31 @@ namespace PascalABCCompiler public class UnsupportedTargetFramework : CompilerCompilationError { - public UnsupportedTargetFramework(string FrameworkName, TreeRealization.location sl) + public UnsupportedTargetFramework(string FrameworkName, location sl) : base(string.Format(StringResources.Get("COMPILATIONERROR_UNSUPPORTED_TARGETFRAMEWORK_{0}"), FrameworkName)) { this.sourceLocation = new SourceLocation(sl.doc.file_name, sl.begin_line_num, sl.begin_column_num, sl.end_line_num, sl.end_column_num); } } + public class UnsupportedTargetPlatform : CompilerCompilationError + { + public UnsupportedTargetPlatform(string platformName, location loc) + : base(string.Format(StringResources.Get("COMPILATIONERROR_UNSUPPORTED_TARGET_PLATFORM{0}"), platformName)) + { + sourceLocation = new SourceLocation(loc.doc.file_name, loc.begin_line_num, loc.begin_column_num, loc.end_line_num, loc.end_column_num); + } + } + + public class UnsupportedOutputFileType : CompilerCompilationError + { + public UnsupportedOutputFileType(string outputFileType, location loc) + : base(string.Format(StringResources.Get("COMPILATIONERROR_UNSUPPORTED_OUTPUT_FILE_TYPE{0}"), outputFileType)) + { + sourceLocation = new SourceLocation(loc.doc.file_name, loc.begin_line_num, loc.begin_column_num, loc.end_line_num, loc.end_column_num); + } + } + public enum UnitState { BeginCompilation, InterfaceCompiled, Compiled } public class CompilationUnit @@ -423,7 +435,7 @@ namespace PascalABCCompiler //private SemanticTree.compilation_unitArrayList _interfaceUsedUnits=new SemanticTree.compilation_unitArrayList(); // название языка модуля - public string languageName = TreeConverter.compiler_string_consts.pascalLanguageName; + public string languageName = StringConstants.pascalLanguageName; /// /// Только "реальные" юниты (не dll и namespace) @@ -520,7 +532,7 @@ namespace PascalABCCompiler public bool Optimise = false; public bool SavePCUInThreadPull = false; public bool RunWithEnvironment = false; - public string CompiledUnitExtension = TreeConverter.compiler_string_consts.pascalCompiledUnitExtension; + public string CompiledUnitExtension = StringConstants.pascalCompiledUnitExtension; public bool ProjectCompiled = false; public IProjectInfo CurrentProject = null; public OutputType OutputFileType = OutputType.ConsoleApplicaton; @@ -612,7 +624,7 @@ namespace PascalABCCompiler { public string name = null; public StandardModuleAddMethod addMethod = StandardModuleAddMethod.LeftToAll; - public string languageToAdd = TreeConverter.compiler_string_consts.pascalLanguageName; + public string languageToAdd = StringConstants.pascalLanguageName; public StandardModule(string Name, StandardModuleAddMethod addMethod) { @@ -883,13 +895,6 @@ namespace PascalABCCompiler public List CompiledVariables = new List(); - private Dictionary> compilerDirectives = null; - - //public Hashtable CompilerDirectives - //{ - // get { return compiler_directives; } - //} - private uint linesCompiled; public uint LinesCompiled { @@ -1172,25 +1177,14 @@ namespace PascalABCCompiler } } - private static HashSet knownDirectives = new HashSet(new string[] { PascalABCCompiler.TreeConverter.compiler_string_consts.main_resource_string, - PascalABCCompiler.TreeConverter.compiler_string_consts.trademark_string, PascalABCCompiler.TreeConverter.compiler_string_consts.copyright_string, - PascalABCCompiler.TreeConverter.compiler_string_consts.company_string, PascalABCCompiler.TreeConverter.compiler_string_consts.product_string, - PascalABCCompiler.TreeConverter.compiler_string_consts.version_string, PascalABCCompiler.TreeConverter.compiler_string_consts.compiler_directive_apptype, - PascalABCCompiler.TreeConverter.compiler_string_consts.compiler_directive_reference, PascalABCCompiler.TreeConverter.compiler_string_consts.include_namespace_directive, - PascalABCCompiler.TreeConverter.compiler_string_consts.compiler_savepcu, PascalABCCompiler.TreeConverter.compiler_string_consts.compiler_directive_zerobasedstrings, - PascalABCCompiler.TreeConverter.compiler_string_consts.compiler_directive_zerobasedstrings_ON, PascalABCCompiler.TreeConverter.compiler_string_consts.compiler_directive_zerobasedstrings_OFF, - PascalABCCompiler.TreeConverter.compiler_string_consts.compiler_directive_nullbasedstrings_ON, PascalABCCompiler.TreeConverter.compiler_string_consts.compiler_directive_nullbasedstrings_OFF, - PascalABCCompiler.TreeConverter.compiler_string_consts.compiler_directive_initstring_as_empty_ON, PascalABCCompiler.TreeConverter.compiler_string_consts.compiler_directive_initstring_as_empty_OFF, - PascalABCCompiler.TreeConverter.compiler_string_consts.compiler_directive_resource, PascalABCCompiler.TreeConverter.compiler_string_consts.compiler_directive_platformtarget, - PascalABCCompiler.TreeConverter.compiler_string_consts.compiler_directive_targetframework, PascalABCCompiler.TreeConverter.compiler_string_consts.compiler_directive_faststrings, - PascalABCCompiler.TreeConverter.compiler_string_consts.compiler_directive_gendoc, PascalABCCompiler.TreeConverter.compiler_string_consts.compiler_directive_region, - PascalABCCompiler.TreeConverter.compiler_string_consts.compiler_directive_endregion, PascalABCCompiler.TreeConverter.compiler_string_consts.compiler_directive_ifdef, - PascalABCCompiler.TreeConverter.compiler_string_consts.compiler_directive_endif, PascalABCCompiler.TreeConverter.compiler_string_consts.compiler_directive_ifndef, - PascalABCCompiler.TreeConverter.compiler_string_consts.compiler_directive_define, PascalABCCompiler.TreeConverter.compiler_string_consts.compiler_directive_else, - PascalABCCompiler.TreeConverter.compiler_string_consts.compiler_directive_undef, PascalABCCompiler.TreeConverter.compiler_string_consts.compiler_directive_include, - PascalABCCompiler.TreeConverter.compiler_string_consts.compiler_directive_hidden_idents, - }); + #region COMPILER DIRECTIVES + /// + /// Формирует словарь директив компилятора, собирая их из всех переданных модулей + /// + /// + /// + /// private Dictionary> GetCompilerDirectives(List Units) { Dictionary> directives = new Dictionary>(StringComparer.CurrentCultureIgnoreCase); @@ -1204,11 +1198,10 @@ namespace PascalABCCompiler { if (!directives.ContainsKey(cd.name)) directives.Add(cd.name, new List()); + // TODO: сделать проверку на дубликаты централизованной (в другом месте) EVA else if (cd.name.Equals("mainresource", StringComparison.CurrentCultureIgnoreCase)) throw new DuplicateDirective(cd.location.doc.file_name, "mainresource", cd.location); directives[cd.name].Insert(0, cd); - if (!knownDirectives.Contains(cd.name.ToLower())) - warnings.Add(new Errors.CommonWarning(string.Format(StringResources.Get("WARNING_UNKNOWN_DIRECTIVE"), cd.name), cd.location.doc.file_name, cd.location.begin_line_num, cd.location.begin_column_num)); } } } @@ -1225,6 +1218,24 @@ namespace PascalABCCompiler return Directives; } + /// + /// преобразует в директивы семантического уровня | в TreeConverter такая же функция EVA + /// + private List GetDirectivesAsSemanticNodes(List compilerDirectives, string unitFileName) + { + List list = new List(); + foreach (SyntaxTree.compiler_directive directive in compilerDirectives) + { + list.Add(new compiler_directive(directive.Name.text, + directive.Directive?.text ?? "", + get_location_from_treenode(directive, unitFileName), + unitFileName)); + } + return list; + } + + #endregion + private TreeRealization.location get_location_from_treenode(SyntaxTree.syntax_tree_node tn, string FileName) { if (tn.source_context == null) @@ -1235,22 +1246,6 @@ namespace PascalABCCompiler tn.source_context.end_position.line_num, tn.source_context.end_position.column_num, new TreeRealization.document(FileName)); } - /// - /// преобразует в директивы семантического уровня - /// - private List GetDirectivesAsSemanticNodes(List compilerDirectives, string unitFileName) - { - List list = new List(); - foreach (SyntaxTree.compiler_directive directive in compilerDirectives) - { - list.Add(new compiler_directive(directive.Name.text, - directive.Directive?.text ?? "", - get_location_from_treenode(directive, unitFileName), - unitFileName)); - } - return list; - } - void syncStartCompile() { Compile(); @@ -1826,7 +1821,7 @@ namespace PascalABCCompiler if (info != null && info.modules.Count > 0) { - comp_opt.ReferencedAssemblies.Add(Path.Combine(Path.GetDirectoryName(CompilerOptions.SourceFileName), PascalABCCompiler.TreeConverter.compiler_string_consts.pabc_rtl_dll_name)); + comp_opt.ReferencedAssemblies.Add(Path.Combine(Path.GetDirectoryName(CompilerOptions.SourceFileName), StringConstants.pabc_rtl_dll_name)); string mod_file_name = FindFileInDirs("PABCRtl.dll", out _, Path.Combine(this.CompilerOptions.SystemDirectory, "Lib")); File.Copy(mod_file_name, Path.Combine(Path.GetDirectoryName(CompilerOptions.SourceFileName), "PABCRtl.dll"), true); /*foreach (string mod in info.modules) @@ -1958,12 +1953,12 @@ namespace PascalABCCompiler } } - private void SetOutputFileTypeOption() + private void SetOutputFileTypeOption(Dictionary> compilerDirectives) { - if (compilerDirectives.ContainsKey(TreeConverter.compiler_string_consts.compiler_directive_apptype)) + if (compilerDirectives.ContainsKey(StringConstants.compiler_directive_apptype)) { - string directive = compilerDirectives[TreeConverter.compiler_string_consts.compiler_directive_apptype][0].directive.ToLower(); - switch (directive) + string outputFileType = compilerDirectives[StringConstants.compiler_directive_apptype][0].directive.ToLower(); + switch (outputFileType) { case "console": CompilerOptions.OutputFileType = CompilerOptions.OutputType.ConsoleApplicaton; @@ -1978,18 +1973,27 @@ namespace PascalABCCompiler CompilerOptions.OutputFileType = CompilerOptions.OutputType.PascalCompiledUnit; break; default: - throw new Exception("No possible OutputFileType!"); + ErrorsList.Add(new UnsupportedOutputFileType(outputFileType, compilerDirectives[StringConstants.compiler_directive_apptype][0].location)); + break; } } + + // передача информации о типе выходного файла системному юниту + if (UnitsTopologicallySortedList.Count > 0) + { + bool isConsoleApplication = CompilerOptions.OutputFileType == CompilerOptions.OutputType.ConsoleApplicaton; + common_unit_node systemUnit = UnitsTopologicallySortedList[0].SemanticTree as common_unit_node; + systemUnit.IsConsoleApplicationVariable = isConsoleApplication; + } } - private void SetOutputPlatformOption(NETGenerator.CompilerOptions compilerOptions) + private void SetOutputPlatformOption(NETGenerator.CompilerOptions compilerOptions, Dictionary> compilerDirectives) { List compilerDirectivesList = new List(); - if (compilerDirectives.TryGetValue(TreeConverter.compiler_string_consts.compiler_directive_platformtarget, out compilerDirectivesList)) + if (compilerDirectives.TryGetValue(StringConstants.compiler_directive_platformtarget, out compilerDirectivesList)) { - string plt = compilerDirectivesList[0].directive.ToLower(); - switch (plt) + string platformName = compilerDirectivesList[0].directive.ToLower(); + switch (platformName) { case "x86": compilerOptions.platformtarget = NETGenerator.CompilerOptions.PlatformTarget.x86; @@ -2024,12 +2028,13 @@ namespace PascalABCCompiler } break; default: - throw new Exception("Unknown platform!"); + ErrorsList.Add(new UnsupportedTargetPlatform(platformName, compilerDirectivesList[0].location)); + break; } if (CompilerOptions.Only32Bit) compilerOptions.platformtarget = NETGenerator.CompilerOptions.PlatformTarget.x86; } - if (compilerDirectives.TryGetValue(TreeConverter.compiler_string_consts.compiler_directive_targetframework, out compilerDirectivesList)) + if (compilerDirectives.TryGetValue(StringConstants.compiler_directive_targetframework, out compilerDirectivesList)) { compilerOptions.TargetFramework = compilerDirectivesList[0].directive; if (!(new string[] { "net40", "net403", "net45", "net451", "net452", "net46", "net461", "net462", "net47", "net471", "net472", "net48", "net481" }) @@ -2040,56 +2045,56 @@ namespace PascalABCCompiler } } - private void FillCompilerInfoOptions(NETGenerator.CompilerOptions compilerOptions) + private void FillCompilerInfoOptions(NETGenerator.CompilerOptions compilerOptions, Dictionary> compilerDirectives) { - var compilerDirectives = new List(); - - if (this.compilerDirectives.TryGetValue(TreeConverter.compiler_string_consts.product_string, out compilerDirectives)) + List compilerDirectivesList; + + if (compilerDirectives.TryGetValue(StringConstants.compiler_directive_product_string, out compilerDirectivesList)) { - compilerOptions.Product = compilerDirectives[0].directive; + compilerOptions.Product = compilerDirectivesList[0].directive; } - if (this.compilerDirectives.TryGetValue(TreeConverter.compiler_string_consts.version_string, out compilerDirectives)) + if (compilerDirectives.TryGetValue(StringConstants.compiler_directive_version_string, out compilerDirectivesList)) { - compilerOptions.ProductVersion = compilerDirectives[0].directive; + compilerOptions.ProductVersion = compilerDirectivesList[0].directive; } - if (this.compilerDirectives.TryGetValue(TreeConverter.compiler_string_consts.company_string, out compilerDirectives)) + if (compilerDirectives.TryGetValue(StringConstants.compiler_directive_company_string, out compilerDirectivesList)) { - compilerOptions.Company = compilerDirectives[0].directive; + compilerOptions.Company = compilerDirectivesList[0].directive; } - if (this.compilerDirectives.TryGetValue(TreeConverter.compiler_string_consts.trademark_string, out compilerDirectives)) + if (compilerDirectives.TryGetValue(StringConstants.compiler_directive_trademark_string, out compilerDirectivesList)) { - compilerOptions.TradeMark = compilerDirectives[0].directive; + compilerOptions.TradeMark = compilerDirectivesList[0].directive; } - if (this.compilerDirectives.TryGetValue(TreeConverter.compiler_string_consts.copyright_string, out compilerDirectives)) + if (compilerDirectives.TryGetValue(StringConstants.compiler_directive_copyright_string, out compilerDirectivesList)) { - compilerOptions.Copyright = compilerDirectives[0].directive; + compilerOptions.Copyright = compilerDirectivesList[0].directive; } - if (this.compilerDirectives.TryGetValue(TreeConverter.compiler_string_consts.title_string, out compilerDirectives)) + if (compilerDirectives.TryGetValue(StringConstants.compiler_directive_title_string, out compilerDirectivesList)) { - compilerOptions.Title = compilerDirectives[0].directive; + compilerOptions.Title = compilerDirectivesList[0].directive; } - if (this.compilerDirectives.TryGetValue(TreeConverter.compiler_string_consts.description_string, out compilerDirectives)) + if (compilerDirectives.TryGetValue(StringConstants.compiler_directive_description_string, out compilerDirectivesList)) { - compilerOptions.Description = compilerDirectives[0].directive; + compilerOptions.Description = compilerDirectivesList[0].directive; } - if (this.compilerDirectives.TryGetValue(TreeConverter.compiler_string_consts.main_resource_string, out compilerDirectives)) + if (compilerDirectives.TryGetValue(StringConstants.compiler_directive_main_resource_string, out compilerDirectivesList)) { - if (this.compilerDirectives.ContainsKey(TreeConverter.compiler_string_consts.product_string) || - this.compilerDirectives.ContainsKey(TreeConverter.compiler_string_consts.version_string) || - this.compilerDirectives.ContainsKey(TreeConverter.compiler_string_consts.company_string) || - this.compilerDirectives.ContainsKey(TreeConverter.compiler_string_consts.trademark_string) || - this.compilerDirectives.ContainsKey(TreeConverter.compiler_string_consts.title_string) || - this.compilerDirectives.ContainsKey(TreeConverter.compiler_string_consts.description_string) || - this.compilerDirectives.ContainsKey(TreeConverter.compiler_string_consts.copyright_string)) + if (compilerDirectives.ContainsKey(StringConstants.compiler_directive_product_string) || + compilerDirectives.ContainsKey(StringConstants.compiler_directive_version_string) || + compilerDirectives.ContainsKey(StringConstants.compiler_directive_company_string) || + compilerDirectives.ContainsKey(StringConstants.compiler_directive_trademark_string) || + compilerDirectives.ContainsKey(StringConstants.compiler_directive_title_string) || + compilerDirectives.ContainsKey(StringConstants.compiler_directive_description_string) || + compilerDirectives.ContainsKey(StringConstants.compiler_directive_copyright_string)) { - ErrorsList.Add(new MainResourceNotAllowed(compilerDirectives[0].location)); + ErrorsList.Add(new MainResourceNotAllowed(compilerDirectivesList[0].location)); } - TryThrowInvalidPath(compilerDirectives[0].directive, compilerDirectives[0].location); + TryThrowInvalidPath(compilerDirectivesList[0].directive, compilerDirectivesList[0].location); // Тут не обязательно нормализовывать путь // И если он слишком длинный - File.Exists вернёт false - compilerOptions.MainResourceFileName = Path.Combine(Path.GetDirectoryName(compilerDirectives[0].source_file), compilerDirectives[0].directive); + compilerOptions.MainResourceFileName = Path.Combine(Path.GetDirectoryName(compilerDirectivesList[0].source_file), compilerDirectivesList[0].directive); if (!File.Exists(compilerOptions.MainResourceFileName)) - ErrorsList.Add(new ResourceFileNotFound(compilerDirectives[0].directive, compilerDirectives[0].location)); + ErrorsList.Add(new ResourceFileNotFound(compilerDirectivesList[0].directive, compilerDirectivesList[0].location)); } } @@ -2230,7 +2235,7 @@ namespace PascalABCCompiler PrepareCompileOptionsForProject(); } - #region CONSTRUCTING SYNTAX AND SEMANTIC TREES STAGE + #region CONSTRUCTING SYNTAX AND SEMANTIC TREES // компиляция всех юнитов произойдет рекурсивно (кроме отложенных) CompileUnit( @@ -2248,7 +2253,7 @@ namespace PascalABCCompiler PrebuildMainSemanticTreeActions(out var compilerOptions, out var resourceFiles); - #region GENERATING CODE STAGE + #region GENERATING CODE if (ErrorsList.Count == 0) { @@ -2327,6 +2332,12 @@ namespace PascalABCCompiler else return CompilerOptions.OutputFileName; } + /// + /// Сохраняет документацию для модулей; + /// Выясняет тип выходного файла, целевой фреймворк, платформу; + /// Заполняет опции компиляции согласно директивам и/или информации из проекта; + /// Находит ресурсные файлы из директив + /// private void PrebuildMainSemanticTreeActions(out NETGenerator.CompilerOptions compilerOptions, out List resourceFiles) { if (CompilerOptions.SaveDocumentation) @@ -2334,37 +2345,30 @@ namespace PascalABCCompiler SaveDocumentationsForUnits(); } - compilerDirectives = GetCompilerDirectives(UnitsTopologicallySortedList); + Dictionary> compilerDirectives = GetCompilerDirectives(UnitsTopologicallySortedList); // выяснение типа выходного файла по соотв. директиве компилятора - SetOutputFileTypeOption(); + SetOutputFileTypeOption(compilerDirectives); // перемещаем PABCSystem в начало списка - MoveSystemUnitForwardInUnitsTopologicallySortedList(); - - // передача информации о типе выходного файла системному юниту - if (UnitsTopologicallySortedList.Count > 0) - { - bool isConsoleApplication = CompilerOptions.OutputFileType == CompilerOptions.OutputType.ConsoleApplicaton; - common_unit_node systemUnit = UnitsTopologicallySortedList[0].SemanticTree as common_unit_node; - systemUnit.IsConsoleApplicationVariable = isConsoleApplication; - } + // MoveSystemUnitForwardInUnitsTopologicallySortedList(); compilerOptions = new NETGenerator.CompilerOptions(); // выяснение TargetFramework и целевой платформы - SetOutputPlatformOption(compilerOptions); + SetOutputPlatformOption(compilerOptions, compilerDirectives); - // остальные директивы - FillCompilerInfoOptions(compilerOptions); + // заполнение опций компилятора из директив + FillCompilerInfoOptions(compilerOptions, compilerDirectives); + + // получние путей к файлам ресурсов из директив + resourceFiles = GetResourceFilesFromCompilerDirectives(compilerDirectives); // заполнение опций компилятора из заголовка проекта FillCompilerOptionsFromProject(compilerOptions); // Устанавливает опции компилятора, связанные с типом выходного файла SetTargetTypeOption(compilerOptions); - - resourceFiles = GetResourceFilesFromCompilerDirectives(); } private program_node ConstructMainSemanticTree(NETGenerator.CompilerOptions compilerOptions) @@ -2554,13 +2558,13 @@ namespace PascalABCCompiler } } - private List GetResourceFilesFromCompilerDirectives() + private List GetResourceFilesFromCompilerDirectives(Dictionary> compilerDirectives) { List ResourceFiles = null; - if (compilerDirectives.ContainsKey(TreeConverter.compiler_string_consts.compiler_directive_resource)) + if (compilerDirectives.ContainsKey(StringConstants.compiler_directive_resource)) { ResourceFiles = new List(); - List ResourceDirectives = compilerDirectives[TreeConverter.compiler_string_consts.compiler_directive_resource]; + List ResourceDirectives = compilerDirectives[StringConstants.compiler_directive_resource]; foreach (compiler_directive cd in ResourceDirectives) { @@ -2908,7 +2912,7 @@ namespace PascalABCCompiler // Наверное, этот код MikhailoMMX лишний //MikhailoMMX PABCRtl.dll будем искать сначала в GAC, а потом в папке с программой - if (FileName == TreeConverter.compiler_string_consts.pabc_rtl_dll_name) + if (FileName == StringConstants.pabc_rtl_dll_name) { string name = get_assembly_path(FileName, true); @@ -3150,7 +3154,7 @@ namespace PascalABCCompiler { var directives = GetDirectivesAsSemanticNodes(unit.SyntaxTree.compiler_directives, unit.SyntaxTree.file_name); - return directives.Any(directive => directive.name.ToLower() == TreeConverter.compiler_string_consts.include_namespace_directive); + return directives.Any(directive => directive.name.ToLower() == StringConstants.compiler_directive_include_namespace); } @@ -3289,7 +3293,7 @@ namespace PascalABCCompiler List files = new List(); foreach (compiler_directive cd in directives) { - if (cd.name.ToLower() == TreeConverter.compiler_string_consts.include_namespace_directive) + if (cd.name.ToLower() == StringConstants.compiler_directive_include_namespace) { string directive = cd.directive.Replace('/', Path.DirectorySeparatorChar).Replace('\\', Path.DirectorySeparatorChar); @@ -3362,12 +3366,8 @@ namespace PascalABCCompiler var referenceDirectives = new List(); foreach (compiler_directive directive in directives) { - if (directive.name.ToLower() == TreeConverter.compiler_string_consts.compiler_directive_reference) + if (directive.name.ToLower() == StringConstants.compiler_directive_reference) { - #region SEMANTIC CHECKS : EMPTY REFERENCE - if (string.IsNullOrEmpty(directive.directive)) - throw new TreeConverter.SimpleSemanticError(directive.location, "EXPECTED_ASSEMBLY_NAME"); // Семантическая ошибка - #endregion referenceDirectives.Add(directive); } @@ -3403,7 +3403,7 @@ namespace PascalABCCompiler { foreach (compiler_directive cd in directives) { - if (cd.name.ToLower() == TreeConverter.compiler_string_consts.compiler_directive_platformtarget + if (cd.name.ToLower() == StringConstants.compiler_directive_platformtarget && !string.IsNullOrEmpty(cd.directive) && cd.directive.IndexOf("dotnet5") != -1) { CompilerOptions.UseDllForSystemUnits = false; @@ -4294,7 +4294,7 @@ namespace PascalABCCompiler if (((SyntaxTree.unit_module)Unit.SyntaxTree).unit_name.HeaderKeyword == PascalABCCompiler.SyntaxTree.UnitHeaderKeyword.Library) return; foreach (SyntaxTree.compiler_directive cd in Unit.SyntaxTree.compiler_directives) - if (cd.Name.text.ToLower() == TreeConverter.compiler_string_consts.compiler_savepcu) + if (cd.Name.text.ToLower() == StringConstants.compiler_directive_savepcu) if (!Convert.ToBoolean(cd.Directive.text)) return; } diff --git a/Compiler/Compiler.csproj b/Compiler/Compiler.csproj index bb050421f..650d71014 100644 --- a/Compiler/Compiler.csproj +++ b/Compiler/Compiler.csproj @@ -143,6 +143,10 @@ {613E0DDA-AA8A-437C-AC45-507B47429FF9} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + + {e8aefbf9-0113-4fa4-be45-6cda555498b7} + StringConstants + {f10a5330-dcf4-4533-877c-7b1b1be23884} SyntaxTreeConverters diff --git a/Compiler/DocXml.cs b/Compiler/DocXml.cs index dcecbdebf..af71adfaf 100644 --- a/Compiler/DocXml.cs +++ b/Compiler/DocXml.cs @@ -364,7 +364,7 @@ namespace PascalABCCompiler private string get_delegate_name(common_type_node ctn) { - common_method_node cmn = ctn.find_first_in_type(compiler_string_consts.invoke_method_name).sym_info as common_method_node; + common_method_node cmn = ctn.find_first_in_type(StringConstants.invoke_method_name).sym_info as common_method_node; StringBuilder sb = new StringBuilder(); if (cmn.return_value_type != null) sb.Append("@function"); diff --git a/Compiler/PCU/PCUReader.cs b/Compiler/PCU/PCUReader.cs index b8b46e5cd..883bfbddb 100644 --- a/Compiler/PCU/PCUReader.cs +++ b/Compiler/PCU/PCUReader.cs @@ -282,7 +282,7 @@ namespace PascalABCCompiler.PCU //TODO сохранить в PCU cun.scope.CaseSensitive = false; - if (string.Compare(unit_name, compiler_string_consts.pascalSystemUnitName, true)==0) + if (string.Compare(unit_name, StringConstants.pascalSystemUnitName, true)==0) PascalABCCompiler.TreeConverter.syntax_tree_visitor.init_system_module(cun); //ssyy //Создаём область видимости для implementation - части @@ -1764,9 +1764,9 @@ namespace PascalABCCompiler.PCU cmn.function_code = GetCode(br.ReadInt32()); cmn.cont_type.methods.AddElement(cmn); if (cmn.name == "op_Equality") - cmn.cont_type.scope.AddSymbol(compiler_string_consts.eq_name, new SymbolInfo(cmn)); + cmn.cont_type.scope.AddSymbol(StringConstants.eq_name, new SymbolInfo(cmn)); else if (cmn.name == "op_Inequality") - cmn.cont_type.scope.AddSymbol(compiler_string_consts.noteq_name, new SymbolInfo(cmn)); + cmn.cont_type.scope.AddSymbol(StringConstants.noteq_name, new SymbolInfo(cmn)); return cmn; } @@ -1999,10 +1999,10 @@ namespace PascalABCCompiler.PCU private void AddEnumOperators(common_type_node tctn) { - /*basic_function_node enum_gr = SystemLibrary.SystemLibrary.make_binary_operator(compiler_string_consts.gr_name,tctn,SemanticTree.basic_function_type.enumgr,SystemLibrary.SystemLibrary.bool_type); - basic_function_node enum_greq = SystemLibrary.SystemLibrary.make_binary_operator(compiler_string_consts.greq_name,tctn,SemanticTree.basic_function_type.enumgreq,SystemLibrary.SystemLibrary.bool_type); - basic_function_node enum_sm = SystemLibrary.SystemLibrary.make_binary_operator(compiler_string_consts.sm_name,tctn,SemanticTree.basic_function_type.enumsm,SystemLibrary.SystemLibrary.bool_type); - basic_function_node enum_smeq = SystemLibrary.SystemLibrary.make_binary_operator(compiler_string_consts.smeq_name,tctn,SemanticTree.basic_function_type.enumsmeq,SystemLibrary.SystemLibrary.bool_type);*/ + /*basic_function_node enum_gr = SystemLibrary.SystemLibrary.make_binary_operator(StringConstants.gr_name,tctn,SemanticTree.basic_function_type.enumgr,SystemLibrary.SystemLibrary.bool_type); + basic_function_node enum_greq = SystemLibrary.SystemLibrary.make_binary_operator(StringConstants.greq_name,tctn,SemanticTree.basic_function_type.enumgreq,SystemLibrary.SystemLibrary.bool_type); + basic_function_node enum_sm = SystemLibrary.SystemLibrary.make_binary_operator(StringConstants.sm_name,tctn,SemanticTree.basic_function_type.enumsm,SystemLibrary.SystemLibrary.bool_type); + basic_function_node enum_smeq = SystemLibrary.SystemLibrary.make_binary_operator(StringConstants.smeq_name,tctn,SemanticTree.basic_function_type.enumsmeq,SystemLibrary.SystemLibrary.bool_type);*/ compilation_context.add_convertions_to_enum_type(tctn); } @@ -2256,9 +2256,9 @@ namespace PascalABCCompiler.PCU if (type_is_delegate) { - SymbolInfo sim = ctn.find_first_in_type(compiler_string_consts.invoke_method_name); + SymbolInfo sim = ctn.find_first_in_type(StringConstants.invoke_method_name); common_method_node invoke_method = sim.sym_info as common_method_node; - sim = ctn.find_first_in_type(compiler_string_consts.default_constructor_name); + sim = ctn.find_first_in_type(StringConstants.default_constructor_name); common_method_node constructor = sim.sym_info as common_method_node; delegate_internal_interface dii = new delegate_internal_interface(invoke_method.return_value_type, invoke_method, constructor); dii.parameters.AddRange(invoke_method.parameters); @@ -2277,7 +2277,7 @@ namespace PascalABCCompiler.PCU { foreach (common_type_node par in ctn.generic_params) { - SymbolInfo tsi = ctn.find_first_in_type(compiler_string_consts.generic_param_kind_prefix + par.name); + SymbolInfo tsi = ctn.find_first_in_type(StringConstants.generic_param_kind_prefix + par.name); if (tsi != null) { par.runtime_initialization_marker = tsi.sym_info as class_field; @@ -2516,8 +2516,8 @@ namespace PascalABCCompiler.PCU { if (ctn.fields[0].type is simple_array) { - ctn.find(TreeConverter.compiler_string_consts.upper_array_const_name); - ctn.find(TreeConverter.compiler_string_consts.lower_array_const_name); + ctn.find(StringConstants.upper_array_const_name); + ctn.find(StringConstants.lower_array_const_name); constant_node lower_bound = ctn.const_defs[1].const_value; constant_node upper_bound = ctn.const_defs[0].const_value; diff --git a/Compiler/PCU/PCUWrappers.cs b/Compiler/PCU/PCUWrappers.cs index 8a7b49427..8377f5113 100644 --- a/Compiler/PCU/PCUWrappers.cs +++ b/Compiler/PCU/PCUWrappers.cs @@ -349,7 +349,7 @@ namespace PascalABCCompiler.PCU { if (base_type != null && base_type.IsDelegate) return base_type.find_in_type(name, CurrentScope, null, no_search_in_extension_methods); - else if (name == compiler_string_consts.deconstruct_method_name) + else if (name == StringConstants.deconstruct_method_name) return SystemLibrary.SystemLibrary.object_type.find_in_type(name, CurrentScope, null, no_search_in_extension_methods); // SSM перенес из common_type_node (types.cs 2116) - без этого не работали методы расширения последовательностей для типов в pcu, реализующих IEnumerable diff --git a/Errors/SourceLocation.cs b/Errors/SourceLocation.cs index 67cbb4b03..cd2d43e35 100644 --- a/Errors/SourceLocation.cs +++ b/Errors/SourceLocation.cs @@ -1,8 +1,5 @@ // Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (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.Collections.Generic; -using System.Text; namespace PascalABCCompiler { diff --git a/NETGenerator/Helpers.cs b/NETGenerator/Helpers.cs index bd50bf879..f47f9ed49 100644 --- a/NETGenerator/Helpers.cs +++ b/NETGenerator/Helpers.cs @@ -34,46 +34,46 @@ namespace PascalABCCompiler.NETGenerator { static OperatorsNameConvertor() { - names[PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name]="op_Addition"; - names[PascalABCCompiler.TreeConverter.compiler_string_consts.minus_name]="op_Subtraction"; - names[PascalABCCompiler.TreeConverter.compiler_string_consts.mul_name]="op_Multiply"; - names[PascalABCCompiler.TreeConverter.compiler_string_consts.div_name]="op_Division"; - names[PascalABCCompiler.TreeConverter.compiler_string_consts.and_name]="op_BitwiseAnd"; - names[PascalABCCompiler.TreeConverter.compiler_string_consts.or_name]="op_BitwiseOr"; - names[PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name]="op_Equality"; - names[PascalABCCompiler.TreeConverter.compiler_string_consts.gr_name]="op_GreaterThan"; - names[PascalABCCompiler.TreeConverter.compiler_string_consts.greq_name]="op_GreaterThanOrEqual"; - names[PascalABCCompiler.TreeConverter.compiler_string_consts.sm_name]="op_LessThan"; - names[PascalABCCompiler.TreeConverter.compiler_string_consts.smeq_name]="op_LessThanOrEqual"; - names[PascalABCCompiler.TreeConverter.compiler_string_consts.mod_name]="op_Modulus"; - names[PascalABCCompiler.TreeConverter.compiler_string_consts.not_name]="op_LogicalNot"; - names[PascalABCCompiler.TreeConverter.compiler_string_consts.noteq_name]="op_Inequality"; + names[StringConstants.plus_name]="op_Addition"; + names[StringConstants.minus_name]="op_Subtraction"; + names[StringConstants.mul_name]="op_Multiply"; + names[StringConstants.div_name]="op_Division"; + names[StringConstants.and_name]="op_BitwiseAnd"; + names[StringConstants.or_name]="op_BitwiseOr"; + names[StringConstants.eq_name]="op_Equality"; + names[StringConstants.gr_name]="op_GreaterThan"; + names[StringConstants.greq_name]="op_GreaterThanOrEqual"; + names[StringConstants.sm_name]="op_LessThan"; + names[StringConstants.smeq_name]="op_LessThanOrEqual"; + names[StringConstants.mod_name]="op_Modulus"; + names[StringConstants.not_name]="op_LogicalNot"; + names[StringConstants.noteq_name]="op_Inequality"; //op_Implicit //op_Explicit - names[PascalABCCompiler.TreeConverter.compiler_string_consts.xor_name]="op_ExclusiveOr"; - names[PascalABCCompiler.TreeConverter.compiler_string_consts.and_name]="op_LogicalAnd"; - names[PascalABCCompiler.TreeConverter.compiler_string_consts.or_name]="op_LogicalOr"; - names[PascalABCCompiler.TreeConverter.compiler_string_consts.assign_name]="op_Assign"; - names[PascalABCCompiler.TreeConverter.compiler_string_consts.shl_name]="op_LeftShift"; - names[PascalABCCompiler.TreeConverter.compiler_string_consts.shr_name]="op_RightShift"; - //names["op_SignedRightShift"]=PascalABCCompiler.TreeConverter.compiler_string_consts.shr_name; - names[PascalABCCompiler.TreeConverter.compiler_string_consts.shr_name]="op_UnsignedRightShift"; - names[PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name]="op_Equality"; - names[PascalABCCompiler.TreeConverter.compiler_string_consts.multassign_name]="op_MultiplicationAssignment"; - names[PascalABCCompiler.TreeConverter.compiler_string_consts.minusassign_name]="op_SubtractionAssignment"; - //names[PascalABCCompiler.TreeConverter.compiler_string_consts.minusassign_name]="op_ExclusiveOrAssignment"; + names[StringConstants.xor_name]="op_ExclusiveOr"; + names[StringConstants.and_name]="op_LogicalAnd"; + names[StringConstants.or_name]="op_LogicalOr"; + names[StringConstants.assign_name]="op_Assign"; + names[StringConstants.shl_name]="op_LeftShift"; + names[StringConstants.shr_name]="op_RightShift"; + //names["op_SignedRightShift"]=StringConstants.shr_name; + names[StringConstants.shr_name]="op_UnsignedRightShift"; + names[StringConstants.eq_name]="op_Equality"; + names[StringConstants.multassign_name]="op_MultiplicationAssignment"; + names[StringConstants.minusassign_name]="op_SubtractionAssignment"; + //names[StringConstants.minusassign_name]="op_ExclusiveOrAssignment"; //op_LeftShiftAssignment //op_ModulusAssignment - names[PascalABCCompiler.TreeConverter.compiler_string_consts.plusassign_name]="op_AdditionAssignment"; + names[StringConstants.plusassign_name]="op_AdditionAssignment"; //op_BitwiseAndAssignment //op_BitwiseOrAssignment //op_Comma - names[PascalABCCompiler.TreeConverter.compiler_string_consts.divassign_name]="op_DivisionAssignment"; + names[StringConstants.divassign_name]="op_DivisionAssignment"; //op_Decrement //op_Increment - //names[PascalABCCompiler.TreeConverter.compiler_string_consts.minus_name] ="op_UnaryNegation"; + //names[StringConstants.minus_name] ="op_UnaryNegation"; //op_UnaryPlus //op_OnesComplement diff --git a/NETGenerator/NETGenerator.cs b/NETGenerator/NETGenerator.cs index 94158b49f..357a10dd1 100644 --- a/NETGenerator/NETGenerator.cs +++ b/NETGenerator/NETGenerator.cs @@ -306,7 +306,7 @@ namespace PascalABCCompiler.NETGenerator get { if (fileOfAttributeConstructor != null) return fileOfAttributeConstructor; - TypeBuilder tb = mb.DefineType(PascalABCCompiler.TreeConverter.compiler_string_consts.file_of_attr_name, TypeAttributes.Public | TypeAttributes.BeforeFieldInit, typeof(Attribute)); + TypeBuilder tb = mb.DefineType(StringConstants.file_of_attr_name, TypeAttributes.Public | TypeAttributes.BeforeFieldInit, typeof(Attribute)); types.Add(tb); fileOfAttributeConstructor = tb.DefineConstructor(MethodAttributes.Public, CallingConventions.HasThis, new Type[1] { TypeFactory.ObjectType }); FieldBuilder fld = tb.DefineField("Type", TypeFactory.ObjectType, FieldAttributes.Public); @@ -326,7 +326,7 @@ namespace PascalABCCompiler.NETGenerator get { if (setOfAttributeConstructor != null) return setOfAttributeConstructor; - TypeBuilder tb = mb.DefineType(PascalABCCompiler.TreeConverter.compiler_string_consts.set_of_attr_name, TypeAttributes.Public | TypeAttributes.BeforeFieldInit, typeof(Attribute)); + TypeBuilder tb = mb.DefineType(StringConstants.set_of_attr_name, TypeAttributes.Public | TypeAttributes.BeforeFieldInit, typeof(Attribute)); types.Add(tb); setOfAttributeConstructor = tb.DefineConstructor(MethodAttributes.Public, CallingConventions.HasThis, new Type[1] { TypeFactory.ObjectType }); FieldBuilder fld = tb.DefineField("Type", TypeFactory.ObjectType, FieldAttributes.Public); @@ -347,7 +347,7 @@ namespace PascalABCCompiler.NETGenerator get { if (templateClassAttributeConstructor != null) return templateClassAttributeConstructor; - TypeBuilder tb = mb.DefineType(PascalABCCompiler.TreeConverter.compiler_string_consts.template_class_attr_name, TypeAttributes.Public | TypeAttributes.BeforeFieldInit, typeof(Attribute)); + TypeBuilder tb = mb.DefineType(StringConstants.template_class_attr_name, TypeAttributes.Public | TypeAttributes.BeforeFieldInit, typeof(Attribute)); types.Add(tb); templateClassAttributeConstructor = tb.DefineConstructor(MethodAttributes.Public, CallingConventions.HasThis, new Type[1] { TypeFactory.ByteType.MakeArrayType() }); FieldBuilder fld = tb.DefineField("Tree", TypeFactory.ByteType.MakeArrayType(), FieldAttributes.Public); @@ -368,7 +368,7 @@ namespace PascalABCCompiler.NETGenerator get { if (typeSynonimAttributeConstructor != null) return typeSynonimAttributeConstructor; - TypeBuilder tb = mb.DefineType(PascalABCCompiler.TreeConverter.compiler_string_consts.type_synonim_attr_name, TypeAttributes.Public | TypeAttributes.BeforeFieldInit, typeof(Attribute)); + TypeBuilder tb = mb.DefineType(StringConstants.type_synonim_attr_name, TypeAttributes.Public | TypeAttributes.BeforeFieldInit, typeof(Attribute)); types.Add(tb); typeSynonimAttributeConstructor = tb.DefineConstructor(MethodAttributes.Public, CallingConventions.HasThis, new Type[1] { TypeFactory.ObjectType }); FieldBuilder fld = tb.DefineField("Type", TypeFactory.ObjectType, FieldAttributes.Public); @@ -389,7 +389,7 @@ namespace PascalABCCompiler.NETGenerator get { if (shortStringAttributeConstructor != null) return shortStringAttributeConstructor; - TypeBuilder tb = mb.DefineType(PascalABCCompiler.TreeConverter.compiler_string_consts.short_string_attr_name, TypeAttributes.Public | TypeAttributes.BeforeFieldInit, typeof(Attribute)); + TypeBuilder tb = mb.DefineType(StringConstants.short_string_attr_name, TypeAttributes.Public | TypeAttributes.BeforeFieldInit, typeof(Attribute)); types.Add(tb); shortStringAttributeConstructor = tb.DefineConstructor(MethodAttributes.Public, CallingConventions.HasThis, new Type[1] { TypeFactory.Int32Type }); FieldBuilder fld = tb.DefineField("Length", TypeFactory.Int32Type, FieldAttributes.Public); @@ -463,8 +463,8 @@ namespace PascalABCCompiler.NETGenerator bool IsDllAndSystemNamespace(string name, string DllFileName) { return comp_opt.target == TargetType.Dll && DllFileName != "PABCRtl.dll" && - (name == compiler_string_consts.pascalSystemUnitName || name == compiler_string_consts.pascalExtensionsUnitName || - name.EndsWith(PascalABCCompiler.TreeConverter.compiler_string_consts.ImplementationSectionNamespaceName)); + (name == StringConstants.pascalSystemUnitName || name == StringConstants.pascalExtensionsUnitName || + name.EndsWith(StringConstants.ImplementationSectionNamespaceName)); } bool IsDotnet5() diff --git a/NETGenerator/NETGenerator.csproj b/NETGenerator/NETGenerator.csproj index 382b66cd7..0a3565a78 100644 --- a/NETGenerator/NETGenerator.csproj +++ b/NETGenerator/NETGenerator.csproj @@ -125,6 +125,10 @@ {613E0DDA-AA8A-437C-AC45-507B47429FF9} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + + {e8aefbf9-0113-4fa4-be45-6cda555498b7} + StringConstants + {1C9C945A-586D-42A2-A06B-65D84FA7FF78} TreeConverter diff --git a/Optimizer/Optimizer.cs b/Optimizer/Optimizer.cs index 1e043d823..1435b7124 100644 --- a/Optimizer/Optimizer.cs +++ b/Optimizer/Optimizer.cs @@ -1111,7 +1111,7 @@ namespace PascalABCCompiler private void VisitCommonNamespaceFunctionCall(common_namespace_function_call en) { CheckInfiniteRecursion(en); - if ((en.function_node.name == "Reset" || en.function_node.name == "Rewrite" || en.function_node.name == "Assign") && en.function_node.comprehensive_namespace.namespace_name == compiler_string_consts.pascalSystemUnitName) + if ((en.function_node.name == "Reset" || en.function_node.name == "Rewrite" || en.function_node.name == "Assign") && en.function_node.comprehensive_namespace.namespace_name == StringConstants.pascalSystemUnitName) { expression_node p = en.parameters[0]; switch (p.semantic_node_type) diff --git a/Optimizer/Optimizer.csproj b/Optimizer/Optimizer.csproj index 3cc7ad4a5..ef898db8f 100644 --- a/Optimizer/Optimizer.csproj +++ b/Optimizer/Optimizer.csproj @@ -82,6 +82,10 @@ {613E0DDA-AA8A-437C-AC45-507B47429FF9} SemanticTree + + {e8aefbf9-0113-4fa4-be45-6cda555498b7} + StringConstants + {1C9C945A-586D-42A2-A06B-65D84FA7FF78} TreeConverter diff --git a/ParserTools/ParserTools.csproj b/ParserTools/ParserTools.csproj index d2fcc3419..16a7b49d2 100644 --- a/ParserTools/ParserTools.csproj +++ b/ParserTools/ParserTools.csproj @@ -68,6 +68,7 @@ + diff --git a/ParserTools/ParserTools/BaseParser.cs b/ParserTools/ParserTools/BaseParser.cs index 28de60ab0..67863896b 100644 --- a/ParserTools/ParserTools/BaseParser.cs +++ b/ParserTools/ParserTools/BaseParser.cs @@ -1,6 +1,7 @@ // Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) using System.Collections.Generic; +using System.Text.RegularExpressions; using PascalABCCompiler.Errors; using PascalABCCompiler.SyntaxTree; @@ -111,6 +112,8 @@ namespace PascalABCCompiler.Parsers public string[] SystemUnitNames { get; } + public Dictionary ValidDirectives { get; protected set; } + public SourceFilesProviderDelegate sourceFilesProvider = null; public virtual SourceFilesProviderDelegate SourceFilesProvider { diff --git a/ParserTools/ParserTools/BaseParserTools.cs b/ParserTools/ParserTools/BaseParserTools.cs index 6e01fe671..dbe6fc520 100644 --- a/ParserTools/ParserTools/BaseParserTools.cs +++ b/ParserTools/ParserTools/BaseParserTools.cs @@ -7,6 +7,8 @@ using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using QUT.Gppg; +using PascalABCCompiler.Parsers; +using PascalABCCompiler.ParserTools.Directives; namespace PascalABCCompiler.ParserTools { @@ -37,6 +39,9 @@ namespace PascalABCCompiler.ParserTools public static Dictionary tokenNum; // строки, соответствующие терминалам, для вывода ошибок - SSM + protected BaseParser parserCached; + protected abstract BaseParser ParserCached { get; } + public SourceContext ToSourceContext(LexLocation loc) { if (loc != null) @@ -83,12 +88,96 @@ namespace PascalABCCompiler.ParserTools warnings.Add(new CommonWarning(res, currentFileName, loc.begin_position.line_num, loc.begin_position.column_num)); } - public string ReplaceSpecialSymbols(string text) + protected string ReplaceSpecialSymbols(string text) { text = text.Replace("''", "'"); return text; } + /// + /// Удаление кавычек у параметра директивы + /// + protected string DeleteQuotesFromDirectiveParam(string param) + { + if (param.Length != 1 && param.StartsWith("'") && param.EndsWith("'")) + return param.Substring(1, param.Length - 2); + + return param; + } + + /// + /// Проверка директивы с помощью проверок из Parser.ValidDirectives + /// + public void CheckDirectiveParams(string directiveName, List directiveParams, SourceContext loc) + { + BaseParser parserNeeded = ParserCached; + + // проверка имени директивы + if (!parserNeeded.ValidDirectives.ContainsKey(directiveName)) + { + AddWarningFromResource("UNKNOWN_DIRECTIVE{0}", loc, directiveName); // предупреждение для совместимости с Delphi + return; + } + + var directiveInfo = parserNeeded.ValidDirectives[directiveName]; + + // случай директивы, переданной без параметров + if (directiveParams.Count == 0) + { + // если задан формат параметров и не поддерживается 0 параметров + if (directiveInfo != null && directiveInfo.checkParamsNumNeeded && !directiveInfo.paramsNums.Contains(0)) + { + AddErrorFromResource("MISSING_DIRECTIVE_PARAM{0}", loc, directiveName); + } + return; + } + + // проверка на добавление параметров директиве без параметров + if (directiveInfo == null) + { + AddErrorFromResource("UNNECESSARY_DIRECTIVE_PARAM{0}", loc, directiveName); + return; + } + + // проверка кол-ва параметров директивы (учитывается случай, когда их может не быть) + if (directiveInfo.checkParamsNumNeeded && !directiveInfo.paramsNums.Contains(directiveParams.Count)) + { + AddWrongNumberOfParamsError(directiveName, directiveParams, loc, directiveInfo); + return; + } + + // проверки параметров по отдельности + if (!directiveInfo.ParamsValid(directiveParams, out int indexOfMismatch, out string specificErrorMessage)) + { + AddErrorFromResource("INCORRECT_DIRECTIVE_PARAM{0}{1}{2}", loc, directiveName, directiveParams[indexOfMismatch], specificErrorMessage); + } + } + + /// + /// Формирование ошибки неправильного кол-ва параметров директивы в зависимости от возможных количеств из DirectiveInfo + /// + private void AddWrongNumberOfParamsError(string directiveName, List directiveParams, SourceContext loc, DirectiveInfo directiveInfo) + { + string paramsNumString = ""; + int maxParamsNum = directiveInfo.paramsNums.Max(); + + if (directiveInfo.paramsNums.Length > 1) + { + if (directiveParams.Count > maxParamsNum) + { + string paramString = maxParamsNum > 1 ? GetFromStringResources("PARAM_MULTIPLE1") : GetFromStringResources("PARAM_SINGLE2"); + paramsNumString = GetFromStringResources("NOT_MORE_THAN") + " " + maxParamsNum + " " + paramString; + } + } + else + { + string paramString = directiveInfo.paramsNums[0] > 1 ? GetFromStringResources("PARAM_MULTIPLE2") : GetFromStringResources("PARAM_SINGLE1"); + paramsNumString = GetFromStringResources("EXACTLY") + " " + directiveInfo.paramsNums[0] + " " + paramString; + } + + AddErrorFromResource("DIRECTIVE_WRONG_NUMBER_OF_PARAMS{0}{1}", loc, directiveName, paramsNumString); + } + public char_const create_char_const(string text, SourceContext sc) { string char_text = new string(text.ToCharArray(1, text.Length - 2)); diff --git a/ParserTools/ParserTools/DefaultLanguageInformation.cs b/ParserTools/ParserTools/DefaultLanguageInformation.cs index f9a6b8d13..595f14541 100644 --- a/ParserTools/ParserTools/DefaultLanguageInformation.cs +++ b/ParserTools/ParserTools/DefaultLanguageInformation.cs @@ -1015,7 +1015,7 @@ namespace PascalABCCompiler.Parsers var strrank = rank > 1 ? "[" + new string(',', rank - 1) + "]" : ""; return $"array{strrank}" + " of " + GetShortTypeName(ctn.GetElementType()); } - //if (ctn == Type.GetType("System.Void*")) return PascalABCCompiler.TreeConverter.compiler_string_consts.pointer_type_name; + //if (ctn == Type.GetType("System.Void*")) return StringConstants.pointer_type_name; return ctn.Name; } @@ -3952,7 +3952,7 @@ namespace PascalABCCompiler.Parsers return sb.ToString(); } //if (ctn.IsArray) return "array of "+GetTypeName(ctn.GetElementType()); - //if (ctn == Type.GetType("System.Void*")) return PascalABCCompiler.TreeConverter.compiler_string_consts.pointer_type_name; + //if (ctn == Type.GetType("System.Void*")) return StringConstants.pointer_type_name; return ctn.Name; } diff --git a/ParserTools/ParserTools/DirectiveHelper.cs b/ParserTools/ParserTools/DirectiveHelper.cs new file mode 100644 index 000000000..2594d0c6d --- /dev/null +++ b/ParserTools/ParserTools/DirectiveHelper.cs @@ -0,0 +1,222 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text.RegularExpressions; +using PascalABCCompiler.Errors; + +namespace PascalABCCompiler.ParserTools.Directives +{ + /// + /// Класс для хранения информации о директиве компилятора (количество параметров, проверки для параметров и др.) + /// + public class DirectiveInfo + { + private ParamChecksCollection checks; + + public int[] paramsNums = new int[1] { 1 }; // по умолчанию один параметр + public bool checkParamsNumNeeded; + + // по умолчанию никаких проверок параметров, но включена проверка их кол-ва + public DirectiveInfo(ParamChecksCollection paramChecks = null, bool checkParamsNumNeeded = true, int[] paramsNums = null) + { + this.checks = paramChecks; + if (paramsNums != null) + this.paramsNums = paramsNums; + this.checkParamsNumNeeded = checkParamsNumNeeded; + } + + /// + /// Функция для проверки всех параметров директивы + /// + public bool ParamsValid(List directiveParams, out int indexOfMismatch, out string errorMessage) + { + // если проверки не нужны + if (checks == null) + { + indexOfMismatch = -1; + errorMessage = null; + return true; + } + return checks.CheckParams(directiveParams, out indexOfMismatch, out errorMessage); + } + } + + /// + /// Базовый класс для всех проверок параметров директив + /// + public abstract class ParamCheckBase + { + public int paramsToCheckNum; // кол-во параметров, проверяемых одной проверкой, по умолчанию - 1 + + public string errorMessage = ""; + + public ParamCheckBase(int paramsToCheckNum = 1) + { + this.paramsToCheckNum = paramsToCheckNum; + } + + /// + /// Проверка одного параметра + /// + public abstract bool CheckParam(string param); + + /// + /// Проверка нужного кол-ва параметров + /// + public bool CheckParams(string[] directiveParams, out int indexOfMismatch) + { + for (var i = 0; i < directiveParams.Length; i++) + { + if (!CheckParam(directiveParams[i])) + { + indexOfMismatch = i; + return false; + } + } + + indexOfMismatch = -1; + return true; + } + } + + /// + /// Класс для пользовательской проверки параметров (можно передать лямбду с проверкой) + /// + public sealed class FuncCheck : ParamCheckBase + { + Predicate check; + + public FuncCheck(Predicate pred, string errorMessage = "", int paramsToCheckNum = 1) : base(paramsToCheckNum) + { + this.errorMessage = errorMessage; + check = pred; + } + + public override bool CheckParam(string s) => check(s); + } + + /// + /// Проверка, что параметр имеет формат идентификатора + /// + public class IsValidIdentifierCheck : ParamCheckBase + { + + public IsValidIdentifierCheck(int paramsToCheckNum = 1) : base(paramsToCheckNum) + { + errorMessage = ParserErrorsStringResources.Get("EXPECTED_IDENTIFIER"); + + } + + public override bool CheckParam(string param) + { + return Regex.IsMatch(param, @"^[\p{L}_][\p{L}0-9_]*$"); + } + } + + /// + /// Проверка принадлежности параметра списку возможных вариантов + /// + public class IsAnyOfCheck : ParamCheckBase + { + private string[] paramVariants; + + public IsAnyOfCheck(int paramsToCheckNum = 1, params string[] paramVariants) : base(paramsToCheckNum) + { + this.paramVariants = paramVariants; + + if (paramVariants.Length <= 5) + { + string firstPartOfError = ParserErrorsStringResources.Get("AVAILABLE_PARAM_VARIANTS{0}"); + errorMessage = string.Format(firstPartOfError, string.Join(", ", paramVariants)); + } + else + { + errorMessage = ParserErrorsStringResources.Get("SEE_THE_HELP_FOR_VARIANTS"); + } + } + + public override bool CheckParam(string param) + { + return paramVariants.Contains(param.ToLower()); + } + } + + /// + /// Проверка, что расширение параметра входит в список возможных расширений + /// + public class IsAnyExtensionsOfCheck : ParamCheckBase + { + private string[] extVariants; + + public IsAnyExtensionsOfCheck(int paramsToCheckNum = 1, params string[] extVariants) : base(paramsToCheckNum) + { + this.extVariants = extVariants; + + string firstPartOfError = ParserErrorsStringResources.Get("AVAILABLE_EXT_VARIANTS{0}"); + errorMessage = string.Format(firstPartOfError, string.Join(", ", extVariants)); + } + + public override bool CheckParam(string param) + { + return extVariants.Contains(Path.GetExtension(param.ToLower())); + } + } + + /// + /// Класс для хранения всех проверок одной директивы + /// + public class ParamChecksCollection + { + private readonly ParamCheckBase[] checks; + + public ParamChecksCollection(params ParamCheckBase[] checks) + { + this.checks = checks; + } + + public bool CheckParams(List directiveParams, out int indexOfMismatch, out string errorMessage) + { + int directivesChecked = 0; + for (var i = 0; i < checks.Length; i++) + { + // каждая проверка работает с кол-вом параметров, которое в ней указано + if (!checks[i].CheckParams(directiveParams.Skip(directivesChecked).Take(checks[i].paramsToCheckNum).ToArray(), out int index)) + { + indexOfMismatch = index; + errorMessage = checks[i].errorMessage; + return false; + } + directivesChecked += checks[i].paramsToCheckNum; + } + + indexOfMismatch = -1; + errorMessage = null; + return true; + } + } + + /// + /// Класс вспомогательных методов для работы с директивами + /// + public static class DirectiveHelper + { + #region SINGLE CHECKS WRAPPERS + public static ParamChecksCollection SingleAnyOfCheck(params string[] paramVariants) + { + return new ParamChecksCollection(new IsAnyOfCheck(1, paramVariants)); + } + + public static ParamChecksCollection SingleAnyExtOfCheck(params string[] extVariants) + { + return new ParamChecksCollection(new IsAnyExtensionsOfCheck(1, extVariants)); + } + + public static ParamChecksCollection SingleIsValidIdCheck() + { + return new ParamChecksCollection(new IsValidIdentifierCheck(1)); + } + #endregion + } +} + diff --git a/ParserTools/ParserTools/Errors.cs b/ParserTools/ParserTools/Errors.cs index 6174bbae2..6593c7386 100644 --- a/ParserTools/ParserTools/Errors.cs +++ b/ParserTools/ParserTools/Errors.cs @@ -9,7 +9,7 @@ namespace PascalABCCompiler.Errors { public static string Get(string Id) { - return PascalABCCompiler.StringResources.Get("PARSER_ERRORS_" + Id); + return StringResources.Get("PARSER_ERRORS_" + Id); } } diff --git a/ParserTools/Tools.cs b/ParserTools/Tools.cs index 431b2effa..0a8a4ffc9 100644 --- a/ParserTools/Tools.cs +++ b/ParserTools/Tools.cs @@ -1,13 +1,10 @@ // Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (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.Collections; -using System.Collections.Generic; -using System.Text; using System.IO; namespace PascalABCCompiler { + public enum SourceFileOperation { GetText, GetLastWriteTime, Exists, FileEncoding diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs index e778f0242..1fc6f8b8b 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs @@ -2,7 +2,7 @@ // This CSharp output file generated by Gardens Point LEX // Version: 1.1.3.301 // Machine: DESKTOP-V3E9T2U -// DateTime: 20.04.2024 21:42:54 +// DateTime: 27.04.2024 19:33:37 // UserName: alex // GPLEX input file // GPLEX frame file @@ -136,15 +136,13 @@ namespace GPPGParserScanner const int EXCLUDETEXT = 5; #region user code -public PascalParserTools parsertools; +public PascalParserTools parserTools; Stack buffStack = new Stack(); Stack fNameStack = new Stack(); Stack IfStack = new Stack(); // 0 - if, 1 - else public List Defines = new List(); int IfExclude; string Pars; - string directivename; - string directiveparam; LexLocation currentLexLocation; bool HiddenIdents = false; bool ExprMode = false; @@ -1785,7 +1783,7 @@ yylval = new Union(); yylval.op = new op_type_node(Operators.Division); return ( case 26: case 30: case 32: -parsertools.AddErrorFromResource("UNEXPECTED_SYMBOL{0}",CurrentLexLocation, yytext); +parserTools.AddErrorFromResource("UNEXPECTED_SYMBOL{0}",CurrentLexLocation, yytext); return -1; break; case 3: @@ -1861,9 +1859,9 @@ string cur_yytext = yytext; if (res == (int)Tokens.tkIdentifier) { if (cur_yytext[0] == '!' && !HiddenIdents && !ExprMode) - parsertools.AddErrorFromResource("UNEXPECTED_SYMBOL{0}",CurrentLexLocation, ""+cur_yytext[0]); + parserTools.AddErrorFromResource("UNEXPECTED_SYMBOL{0}",CurrentLexLocation, ""+cur_yytext[0]); yylval = new Union(); - yylval.id = parsertools.create_ident(cur_yytext,currentLexLocation); + yylval.id = parserTools.create_ident(cur_yytext,currentLexLocation); } else switch (res) @@ -2067,33 +2065,33 @@ return (int)Tokens.INVISIBLE; case 31: yylval = new Union(); currentLexLocation = CurrentLexLocation; - yylval.ex = parsertools.create_int_const(yytext,currentLexLocation); + yylval.ex = parserTools.create_int_const(yytext,currentLexLocation); return (int)Tokens.tkInteger; break; case 33: case 34: yylval = new Union(); currentLexLocation = CurrentLexLocation; - yylval.stn = parsertools.create_string_const(yytext,currentLexLocation); + yylval.stn = parserTools.create_string_const(yytext,currentLexLocation); return (int)Tokens.tkStringLiteral; break; case 35: yylval = new Union(); currentLexLocation = CurrentLexLocation; - yylval.stn = parsertools.create_multiline_string_const(yytext,currentLexLocation); + yylval.stn = parserTools.create_multiline_string_const(yytext,currentLexLocation); return (int)Tokens.tkMultilineStringLiteral; break; case 36: yylval = new Union(); currentLexLocation = CurrentLexLocation; - yylval.ex = parsertools.create_bigint_const(yytext,currentLexLocation); + yylval.ex = parserTools.create_bigint_const(yytext,currentLexLocation); return (int)Tokens.tkBigInteger; break; case 37: case 38: yylval = new Union(); currentLexLocation = CurrentLexLocation; - yylval.ex = parsertools.create_double_const(yytext,currentLexLocation); + yylval.ex = parserTools.create_double_const(yytext,currentLexLocation); return (int)Tokens.tkFloat; break; case 39: @@ -2149,7 +2147,7 @@ yylval = new Union(); case 55: yylval = new Union(); currentLexLocation = CurrentLexLocation; - yylval.stn = parsertools.create_sharp_char_const(yytext,currentLexLocation); + yylval.stn = parserTools.create_sharp_char_const(yytext,currentLexLocation); return (int)Tokens.tkAsciiChar; break; case 56: @@ -2170,73 +2168,80 @@ BEGIN(COMMENT1); case 61: yylval = new Union(); currentLexLocation = CurrentLexLocation; - yylval.ex = parsertools.create_hex_const(yytext,currentLexLocation); + yylval.ex = parserTools.create_hex_const(yytext,currentLexLocation); return (int)Tokens.tkHex; break; case 62: yylval = new Union(); currentLexLocation = CurrentLexLocation; - yylval.stn = parsertools.create_format_string_const(yytext,currentLexLocation); + yylval.stn = parserTools.create_format_string_const(yytext,currentLexLocation); return (int)Tokens.tkFormatStringLiteral; break; case 63: -if (parsertools.buildTreeForFormatter) +if (parserTools.buildTreeForFormatter) break; - parsertools.DivideDirectiveOn(yytext,out directivename,out directiveparam); - parsertools.CheckDirectiveParams(directivename,directiveparam); // directivename in UPPERCASE! - if (directivename == "HIDDENIDENTS") + parserTools.ParseDirective(yytext, CurrentLexLocation, out var directiveName, out var directiveParams); + + if (directiveName == null) // сл??ай п?с?ой ди?ек?ив? + break; + + parserTools.CheckDirectiveParams(directiveName, directiveParams, CurrentLexLocation); + + directiveName = directiveName.ToUpper(); + + if (directiveName == "HIDDENIDENTS") { HiddenIdents = true; } - else if (directivename == "INCLUDE") + else if (directiveName == "INCLUDE") { - TryInclude(directiveparam); + TryInclude(directiveParams[0]); } - else if (directivename == "IFDEF") + else if (directiveName == "IFDEF") { IfStack.Push(0); - if (!Defines.Contains(directiveparam)) + if (!Defines.Contains(directiveParams[0])) { BEGIN(EXCLUDETEXT); IfExclude = 1; } } - else if (directivename == "IFNDEF") + else if (directiveName == "IFNDEF") { IfStack.Push(0); - if (Defines.Contains(directiveparam)) + if (Defines.Contains(directiveParams[0])) { BEGIN(EXCLUDETEXT); IfExclude = 1; } } - else if (directivename == "ELSE") + else if (directiveName == "ELSE") { if (IfStack.Count==0) - parsertools.AddErrorFromResource("UNNECESSARY $else",CurrentLexLocation); + parserTools.AddErrorFromResource("UNNECESSARY $else",CurrentLexLocation); if (IfStack.Peek()==1) - parsertools.AddErrorFromResource("UNNECESSARY $else",CurrentLexLocation); + parserTools.AddErrorFromResource("UNNECESSARY $else",CurrentLexLocation); IfStack.Pop(); IfStack.Push(1); BEGIN(EXCLUDETEXT); IfExclude = 1; } - else if (directivename == "ENDIF") + else if (directiveName == "ENDIF") { if (IfStack.Count == 0) - parsertools.AddErrorFromResource("UNNECESSARY $endif",CurrentLexLocation); + parserTools.AddErrorFromResource("UNNECESSARY $endif",CurrentLexLocation); IfStack.Pop(); } - else if (directivename == "DEFINE") + else if (directiveName == "DEFINE") { - if (!Defines.Contains(directiveparam)) - Defines.Add(directiveparam); + if (!Defines.Contains(directiveParams[0])) + Defines.Add(directiveParams[0]); } - else if (directivename == "UNDEF") + else if (directiveName == "UNDEF") { - if (Defines.Contains(directiveparam)) - Defines.Remove(directiveparam); + if (Defines.Contains(directiveParams[0])) + Defines.Remove(directiveParams[0]); } break; case 64: @@ -2269,31 +2274,38 @@ BEGIN(INITIAL); } break; case 74: -parsertools.DivideDirectiveOn(yytext,out directivename,out directiveparam); - parsertools.CheckDirectiveParams(directivename,directiveparam); // directivename in UPPERCASE! - if (directivename == "IFDEF") +parserTools.ParseDirective(yytext, CurrentLexLocation, out directiveName, out directiveParams); + + if (directiveName == null) // сл??ай п?с?ой ди?ек?ив? + break; + + parserTools.CheckDirectiveParams(directiveName, directiveParams, CurrentLexLocation); + + directiveName = directiveName.ToUpper(); + + if (directiveName == "IFDEF") { IfStack.Push(0); IfExclude++; } - else if (directivename == "IFNDEF") + else if (directiveName == "IFNDEF") { IfStack.Push(0); IfExclude++; } - else if (directivename == "ELSE") + else if (directiveName == "ELSE") { if (IfStack.Peek() == 1) - parsertools.AddErrorFromResource("UNNECESSARY $else",CurrentLexLocation); + parserTools.AddErrorFromResource("UNNECESSARY $else",CurrentLexLocation); IfStack.Pop(); IfStack.Push(1); if (IfExclude == 1) BEGIN(INITIAL); } - else if (directivename == "ENDIF") + else if (directiveName == "ENDIF") { if (IfStack.Count==0) - parsertools.AddErrorFromResource("UNNECESSARY $endif",CurrentLexLocation); + parserTools.AddErrorFromResource("UNNECESSARY $endif",CurrentLexLocation); IfStack.Pop(); IfExclude--; if (IfExclude == 0) @@ -2302,17 +2314,17 @@ parsertools.DivideDirectiveOn(yytext,out directivename,out directiveparam); else if (IfExclude > 0) { int ind_to_remove = -1; - for (int i=0; i 0) - parsertools.AddErrorFromResource("ENDIF_ABSENT",CurrentLexLocation); + parserTools.AddErrorFromResource("ENDIF_ABSENT",CurrentLexLocation); BEGIN(INITIAL); if (buffStack.Count == 0) return true; RestoreBuffCtx(buffStack.Pop()); - parsertools.currentFileName = fNameStack.Pop(); + parserTools.currentFileName = fNameStack.Pop(); return false; } public override void yyerror(string format, params object[] args) { - string errorMsg = parsertools.CreateErrorString(yytext,args); - parsertools.AddError(errorMsg,CurrentLexLocation); + string errorMsg = parserTools.CreateErrorString(yytext,args); + parserTools.AddError(errorMsg,CurrentLexLocation); } private void TryInclude(string fName) { if (fName == null || fName.Length == 0) - parsertools.AddErrorFromResource("INCLUDE_EMPTY_FILE",CurrentLexLocation); + parserTools.AddErrorFromResource("INCLUDE_EMPTY_FILE",CurrentLexLocation); else try { if (fName.StartsWith("'")) @@ -2453,22 +2465,22 @@ public LexLocation CurrentLexLocation BufferContext savedCtx = MkBuffCtx(); string full_path = fName; if (!Path.IsPathRooted(full_path)) - full_path = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(parsertools.currentFileName), fName)); + full_path = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(parserTools.currentFileName), fName)); if (fNameStack.Contains(full_path)) { - parsertools.AddErrorFromResource("RECUR_INCLUDE", CurrentLexLocation, fName); + parserTools.AddErrorFromResource("RECUR_INCLUDE", CurrentLexLocation, fName); return; } SetSource(File.ReadAllText(full_path), 0); - fNameStack.Push(parsertools.currentFileName); - parsertools.currentFileName = full_path; + fNameStack.Push(parserTools.currentFileName); + parserTools.currentFileName = full_path; buffStack.Push(savedCtx); } catch { - parsertools.AddErrorFromResource("INCLUDE_COULDNT_OPEN_FILE{0}",CurrentLexLocation,fName); + parserTools.AddErrorFromResource("INCLUDE_COULDNT_OPEN_FILE{0}",CurrentLexLocation,fName); } } diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.lex b/Parsers/PascalABCParserNewSaushkin/ABCPascal.lex index 2e3f0c981..0af9c577b 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.lex +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.lex @@ -1,13 +1,11 @@ %{ - public PascalParserTools parsertools; + public PascalParserTools parserTools; Stack buffStack = new Stack(); Stack fNameStack = new Stack(); Stack IfStack = new Stack(); // 0 - if, 1 - else public List Defines = new List(); int IfExclude; string Pars; - string directivename; - string directiveparam; LexLocation currentLexLocation; bool HiddenIdents = false; bool ExprMode = false; @@ -68,63 +66,70 @@ UNICODEARROW \x890 } {DIRECTIVE} { - if (parsertools.buildTreeForFormatter) + if (parserTools.buildTreeForFormatter) break; - parsertools.DivideDirectiveOn(yytext,out directivename,out directiveparam); - parsertools.CheckDirectiveParams(directivename,directiveparam); // directivename in UPPERCASE! - if (directivename == "HIDDENIDENTS") + parserTools.ParseDirective(yytext, CurrentLexLocation, out var directiveName, out var directiveParams); + + if (directiveName == null) // случай пустой директивы + break; + + parserTools.CheckDirectiveParams(directiveName, directiveParams, CurrentLexLocation); + + directiveName = directiveName.ToUpper(); + + if (directiveName == "HIDDENIDENTS") { HiddenIdents = true; } - else if (directivename == "INCLUDE") + else if (directiveName == "INCLUDE") { - TryInclude(directiveparam); + TryInclude(directiveParams[0]); } - else if (directivename == "IFDEF") + else if (directiveName == "IFDEF") { IfStack.Push(0); - if (!Defines.Contains(directiveparam)) + if (!Defines.Contains(directiveParams[0])) { BEGIN(EXCLUDETEXT); IfExclude = 1; } } - else if (directivename == "IFNDEF") + else if (directiveName == "IFNDEF") { IfStack.Push(0); - if (Defines.Contains(directiveparam)) + if (Defines.Contains(directiveParams[0])) { BEGIN(EXCLUDETEXT); IfExclude = 1; } } - else if (directivename == "ELSE") + else if (directiveName == "ELSE") { if (IfStack.Count==0) - parsertools.AddErrorFromResource("UNNECESSARY $else",CurrentLexLocation); + parserTools.AddErrorFromResource("UNNECESSARY $else",CurrentLexLocation); if (IfStack.Peek()==1) - parsertools.AddErrorFromResource("UNNECESSARY $else",CurrentLexLocation); + parserTools.AddErrorFromResource("UNNECESSARY $else",CurrentLexLocation); IfStack.Pop(); IfStack.Push(1); BEGIN(EXCLUDETEXT); IfExclude = 1; } - else if (directivename == "ENDIF") + else if (directiveName == "ENDIF") { if (IfStack.Count == 0) - parsertools.AddErrorFromResource("UNNECESSARY $endif",CurrentLexLocation); + parserTools.AddErrorFromResource("UNNECESSARY $endif",CurrentLexLocation); IfStack.Pop(); } - else if (directivename == "DEFINE") + else if (directiveName == "DEFINE") { - if (!Defines.Contains(directiveparam)) - Defines.Add(directiveparam); + if (!Defines.Contains(directiveParams[0])) + Defines.Add(directiveParams[0]); } - else if (directivename == "UNDEF") + else if (directiveName == "UNDEF") { - if (Defines.Contains(directiveparam)) - Defines.Remove(directiveparam); + if (Defines.Contains(directiveParams[0])) + Defines.Remove(directiveParams[0]); } } @@ -133,31 +138,39 @@ UNICODEARROW \x890 } {DIRECTIVE} { - parsertools.DivideDirectiveOn(yytext,out directivename,out directiveparam); - parsertools.CheckDirectiveParams(directivename,directiveparam); // directivename in UPPERCASE! - if (directivename == "IFDEF") + + parserTools.ParseDirective(yytext, CurrentLexLocation, out directiveName, out directiveParams); + + if (directiveName == null) // случай пустой директивы + break; + + parserTools.CheckDirectiveParams(directiveName, directiveParams, CurrentLexLocation); + + directiveName = directiveName.ToUpper(); + + if (directiveName == "IFDEF") { IfStack.Push(0); IfExclude++; } - else if (directivename == "IFNDEF") + else if (directiveName == "IFNDEF") { IfStack.Push(0); IfExclude++; } - else if (directivename == "ELSE") + else if (directiveName == "ELSE") { if (IfStack.Peek() == 1) - parsertools.AddErrorFromResource("UNNECESSARY $else",CurrentLexLocation); + parserTools.AddErrorFromResource("UNNECESSARY $else",CurrentLexLocation); IfStack.Pop(); IfStack.Push(1); if (IfExclude == 1) BEGIN(INITIAL); } - else if (directivename == "ENDIF") + else if (directiveName == "ENDIF") { if (IfStack.Count==0) - parsertools.AddErrorFromResource("UNNECESSARY $endif",CurrentLexLocation); + parserTools.AddErrorFromResource("UNNECESSARY $endif",CurrentLexLocation); IfStack.Pop(); IfExclude--; if (IfExclude == 0) @@ -166,17 +179,17 @@ UNICODEARROW \x890 else if (IfExclude > 0) { int ind_to_remove = -1; - for (int i=0; i 0) - parsertools.AddErrorFromResource("ENDIF_ABSENT",CurrentLexLocation); + parserTools.AddErrorFromResource("ENDIF_ABSENT",CurrentLexLocation); BEGIN(INITIAL); if (buffStack.Count == 0) return true; RestoreBuffCtx(buffStack.Pop()); - parsertools.currentFileName = fNameStack.Pop(); + parserTools.currentFileName = fNameStack.Pop(); return false; } public override void yyerror(string format, params object[] args) { - string errorMsg = parsertools.CreateErrorString(yytext,args); - parsertools.AddError(errorMsg,CurrentLexLocation); + string errorMsg = parserTools.CreateErrorString(yytext,args); + parserTools.AddError(errorMsg,CurrentLexLocation); } private void TryInclude(string fName) { if (fName == null || fName.Length == 0) - parsertools.AddErrorFromResource("INCLUDE_EMPTY_FILE",CurrentLexLocation); + parserTools.AddErrorFromResource("INCLUDE_EMPTY_FILE",CurrentLexLocation); else try { if (fName.StartsWith("'")) @@ -581,22 +594,22 @@ UNICODEARROW \x890 BufferContext savedCtx = MkBuffCtx(); string full_path = fName; if (!Path.IsPathRooted(full_path)) - full_path = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(parsertools.currentFileName), fName)); + full_path = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(parserTools.currentFileName), fName)); if (fNameStack.Contains(full_path)) { - parsertools.AddErrorFromResource("RECUR_INCLUDE", CurrentLexLocation, fName); + parserTools.AddErrorFromResource("RECUR_INCLUDE", CurrentLexLocation, fName); return; } SetSource(File.ReadAllText(full_path), 0); - fNameStack.Push(parsertools.currentFileName); - parsertools.currentFileName = full_path; + fNameStack.Push(parserTools.currentFileName); + parserTools.currentFileName = full_path; buffStack.Push(savedCtx); } catch { - parsertools.AddErrorFromResource("INCLUDE_COULDNT_OPEN_FILE{0}",CurrentLexLocation,fName); + parserTools.AddErrorFromResource("INCLUDE_COULDNT_OPEN_FILE{0}",CurrentLexLocation,fName); } } diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascalParserTools.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascalParserTools.cs index ce704aa9f..49c8141c9 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascalParserTools.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascalParserTools.cs @@ -5,6 +5,9 @@ using PascalABCCompiler.SyntaxTree; using System; using System.Linq; using PascalABCCompiler.ParserTools; +using PascalABCCompiler.PascalABCNewParser; +using PascalABCCompiler.Parsers; +using System.Text.RegularExpressions; namespace PascalABCSavParser { @@ -39,6 +42,16 @@ namespace PascalABCSavParser public List pascalABCVarStatements; public List pascalABCTypeDeclarations; + protected override BaseParser ParserCached + { + get + { + if (parserCached == null) + parserCached = Controller.Instance.SelectParser(".pas") as BaseParser; + return parserCached; + } + } + static PascalParserTools() { tokenNum = new Dictionary(); @@ -89,16 +102,47 @@ namespace PascalABCSavParser pascalABCTypeDeclarations = new List(); } - public void DivideDirectiveOn(string yytext, out string directivename, out string directiveparam) + /// + /// Разбор директивы, согласно спецификации языка + /// + public void ParseDirective(string directive, QUT.Gppg.LexLocation location, out string directiveName, out List directiveParams) { - var ind = yytext.IndexOfAny(new char[]{' ','}'}); - directivename = yytext.Substring(2,ind-2).ToUpper().Trim(); - directiveparam = yytext.Substring(ind + 1).TrimEnd('}').Trim(); - } + directiveName = null; + directiveParams = new List(); - public void CheckDirectiveParams(string directivename, string directiveparam) - { + List words = Regex.Split(directive, @"('.*?')|\s+").Where(word => word != "").ToList(); + // подсоединяем } к последнему слову + if (words.Last() == "}") + { + words[words.Count - 2] += "}"; + words.RemoveAt(words.Count - 1); + } + + // пустая директива - ошибка + if (words[0] == "{$}") + { + AddErrorFromResource("EMPTY_DIRECTIVE", location); + return; + } + + // подсоединяем первое слово к {$ + if (words[0] == "{$") + { + words[0] += words[1]; + words.RemoveAt(1); + } + + if (words.Count == 1) + { + directiveName = words[0].Substring(2, words[0].Length - 3); + } + else + { + directiveName = words[0].Substring(2, words[0].Length - 2); + words[words.Count - 1] = words[words.Count - 1].TrimEnd('}'); + directiveParams = words.Skip(1).Select(word => DeleteQuotesFromDirectiveParam(word)).ToList(); + } } protected override string GetFromStringResources(string res) diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs index a65db596f..f48b09194 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs @@ -2,7 +2,7 @@ // GPPG version 1.3.6 // Machine: DESKTOP-V3E9T2U -// DateTime: 20.04.2024 21:42:55 +// DateTime: 23.04.2024 22:43:23 // UserName: alex // Input file diff --git a/Parsers/PascalABCParserNewSaushkin/Parser.cs b/Parsers/PascalABCParserNewSaushkin/Parser.cs index 2a76488a3..97df8f571 100644 --- a/Parsers/PascalABCParserNewSaushkin/Parser.cs +++ b/Parsers/PascalABCParserNewSaushkin/Parser.cs @@ -8,6 +8,8 @@ using PascalABCSavParser; using PascalABCCompiler.Parsers; using GPPGParserScanner; using GPPGPreprocessor3; +using PascalABCCompiler.ParserTools.Directives; +using static PascalABCCompiler.ParserTools.Directives.DirectiveHelper; namespace PascalABCCompiler.PascalABCNewParser { @@ -78,7 +80,7 @@ namespace PascalABCCompiler.PascalABCNewParser Scanner scanner = new Scanner(); scanner.SetSource(Text, 0); - scanner.parsertools = parsertools;// передали parsertools в объект сканера + scanner.parserTools = parsertools;// передали parsertools в объект сканера if (definesList != null) scanner.Defines.AddRange(definesList); GPPGParser parser = new GPPGParser(scanner); @@ -101,21 +103,69 @@ namespace PascalABCCompiler.PascalABCNewParser public PascalABCNewLanguageParser() : base( - name: "PascalABC.NET", - version: "1.2", - copyright: "Copyright © 2005-2024 by Ivan Bondarev, Stanislav Mikhalkovich", - systemUnitNames: new string[] { "PABCSystem", "PABCExtensions" }, + name: "PascalABC.NET", + version: "1.2", + copyright: "Copyright © 2005-2024 by Ivan Bondarev, Stanislav Mikhalkovich", + systemUnitNames: new string[] { "PABCSystem", "PABCExtensions" }, caseSensitive: false, filesExtensions: new string[] { ".pas" }) { + InitializeValidDirectives(); } - + public override void Reset() { CompilerDirectives = new List(); Errors.Clear(); } + + /// + /// Здесь записываются все директивы, поддерживаемые языком, а также правила для проверки их параметров (ограничения, накладываемые со стороны языка) + /// + private void InitializeValidDirectives() + { + #region VALID DIRECTIVES + ValidDirectives = new Dictionary(StringComparer.CurrentCultureIgnoreCase) + { + [StringConstants.compiler_directive_apptype] = new DirectiveInfo(SingleAnyOfCheck("console", "windows", "dll", "pcu")), + [StringConstants.compiler_directive_reference] = new DirectiveInfo(), // нет параметров - никаких проверок + [StringConstants.compiler_directive_include_namespace] = new DirectiveInfo(), + [StringConstants.compiler_directive_savepcu] = new DirectiveInfo(SingleAnyOfCheck("true", "false")), + [StringConstants.compiler_directive_zerobasedstrings] = new DirectiveInfo(SingleAnyOfCheck("on", "off"), paramsNums: new int[2] { 0, 1 }), + [StringConstants.compiler_directive_zerobasedstrings_ON] = null, // от null, скорее всего, придется избавиться, это не лучший подход EVA + [StringConstants.compiler_directive_zerobasedstrings_OFF] = null, + [StringConstants.compiler_directive_nullbasedstrings_ON] = null, + [StringConstants.compiler_directive_nullbasedstrings_OFF] = null, + [StringConstants.compiler_directive_initstring_as_empty_ON] = null, + [StringConstants.compiler_directive_initstring_as_empty_OFF] = null, + [StringConstants.compiler_directive_resource] = new DirectiveInfo(), + [StringConstants.compiler_directive_platformtarget] = new DirectiveInfo(SingleAnyOfCheck("x86", "x64", "anycpu", "dotnet5win", "dotnet5linux", "dotnet5macos", "native")), + [StringConstants.compiler_directive_faststrings] = null, + [StringConstants.compiler_directive_gendoc] = new DirectiveInfo(SingleAnyOfCheck("true", "false")), + [StringConstants.compiler_directive_region] = new DirectiveInfo(checkParamsNumNeeded: false), + [StringConstants.compiler_directive_endregion] = new DirectiveInfo(checkParamsNumNeeded: false), + [StringConstants.compiler_directive_ifdef] = new DirectiveInfo(SingleIsValidIdCheck()), + [StringConstants.compiler_directive_endif] = new DirectiveInfo(SingleIsValidIdCheck(), paramsNums: new int[2] { 0, 1 }), + [StringConstants.compiler_directive_ifndef] = new DirectiveInfo(SingleIsValidIdCheck()), + [StringConstants.compiler_directive_else] = new DirectiveInfo(SingleIsValidIdCheck(), paramsNums: new int[2] { 0, 1 }), + [StringConstants.compiler_directive_undef] = new DirectiveInfo(SingleIsValidIdCheck()), + [StringConstants.compiler_directive_define] = new DirectiveInfo(SingleIsValidIdCheck()), + [StringConstants.compiler_directive_include] = new DirectiveInfo(), + [StringConstants.compiler_directive_targetframework] = new DirectiveInfo(), + [StringConstants.compiler_directive_hidden_idents] = null, + [StringConstants.compiler_directive_version_string] = new DirectiveInfo(), + [StringConstants.compiler_directive_product_string] = new DirectiveInfo(), + [StringConstants.compiler_directive_company_string] = new DirectiveInfo(), + [StringConstants.compiler_directive_trademark_string] = new DirectiveInfo(), + [StringConstants.compiler_directive_main_resource_string] = new DirectiveInfo(), + [StringConstants.compiler_directive_title_string] = new DirectiveInfo(), + [StringConstants.compiler_directive_description_string] = new DirectiveInfo(), + [StringConstants.compiler_directive_omp] = new DirectiveInfo(SingleAnyOfCheck("critical", "parallel"), checkParamsNumNeeded: false) + }; + #endregion + } + public override SourceFilesProviderDelegate SourceFilesProvider { get @@ -186,7 +236,7 @@ namespace PascalABCCompiler.PascalABCNewParser PreprocessorParserHelper preprocessor3 = new PreprocessorParserHelper(Errors, FileName); var b = preprocessor3.Parse(Text); - + if (Errors.Count > 0) return null; @@ -213,7 +263,7 @@ namespace PascalABCCompiler.PascalABCNewParser { if (Text == string.Empty) return null; - // LineCorrection = -1 не забыть + // LineCorrection = -1 не забыть string origText = Text; Text = String.Concat("<>", Environment.NewLine, Text); localparserhelper = new GPPGParserHelper(Errors, Warnings, FileName); @@ -222,7 +272,7 @@ namespace PascalABCCompiler.PascalABCNewParser if (root == null && origText != null && origText.Contains("<")) { Errors.Clear(); - root = localparserhelper.Parse(String.Concat("<>", Environment.NewLine, origText.Replace("<","&<"))); + root = localparserhelper.Parse(String.Concat("<>", Environment.NewLine, origText.Replace("<", "&<"))); } return root as expression; } diff --git a/Parsers/PascalABCParserNewSaushkin/PascalABCSaushkinParser.csproj b/Parsers/PascalABCParserNewSaushkin/PascalABCSaushkinParser.csproj index 1e874d415..6cd7c6963 100644 --- a/Parsers/PascalABCParserNewSaushkin/PascalABCSaushkinParser.csproj +++ b/Parsers/PascalABCParserNewSaushkin/PascalABCSaushkinParser.csproj @@ -125,6 +125,10 @@ {AF2EFD7B-69DD-4B43-AF65-B59B29349C23} ParserTools + + {e8aefbf9-0113-4fa4-be45-6cda555498b7} + StringConstants + {C2CAC65A-B2AE-4CCC-B067-E6B8E75DF73A} SyntaxTree diff --git a/Parsers/PascalABCParserNewSaushkin/SemanticRules.cs b/Parsers/PascalABCParserNewSaushkin/SemanticRules.cs index e8755c750..e0ffaf819 100644 --- a/Parsers/PascalABCParserNewSaushkin/SemanticRules.cs +++ b/Parsers/PascalABCParserNewSaushkin/SemanticRules.cs @@ -404,7 +404,7 @@ namespace GPPGParserScanner parsertools.buildTreeForFormatterStrings = true; Scanner scanner = new Scanner(); scanner.SetSource("<>"+Text, 0); - scanner.parsertools = parsertools;// передали parsertools в объект сканера + scanner.parserTools = parsertools;// передали parsertools в объект сканера GPPGParser parser = new GPPGParser(scanner); parsertools.buildTreeForFormatter = false; parser.lambdaHelper = this.lambdaHelper; diff --git a/Parsers/VBNETParser/LanguageInformation.cs b/Parsers/VBNETParser/LanguageInformation.cs index d2577b966..f62a07abe 100644 --- a/Parsers/VBNETParser/LanguageInformation.cs +++ b/Parsers/VBNETParser/LanguageInformation.cs @@ -737,7 +737,7 @@ namespace PascalABCCompiler.VBNETParser return sb.ToString(); } //if (ctn.IsArray) return "array of "+GetTypeName(ctn.GetElementType()); - //if (ctn == Type.GetType("System.Void*")) return PascalABCCompiler.TreeConverter.compiler_string_consts.pointer_type_name; + //if (ctn == Type.GetType("System.Void*")) return StringConstants.pointer_type_name; return ctn.Name; } diff --git a/PascalABCNET.sln b/PascalABCNET.sln index b4baa9678..8d8618bf0 100644 --- a/PascalABCNET.sln +++ b/PascalABCNET.sln @@ -109,6 +109,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PascalABCSaushkinParser", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LanguageIntegrator", "LanguageIntegrator\LanguageIntegrator.csproj", "{A48D9069-D569-4110-9252-A10F139B669B}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StringConstants", "StringConstants\StringConstants.csproj", "{E8AEFBF9-0113-4FA4-BE45-6CDA555498B7}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -517,6 +519,18 @@ Global {A48D9069-D569-4110-9252-A10F139B669B}.Release|Mixed Platforms.Build.0 = Release|Any CPU {A48D9069-D569-4110-9252-A10F139B669B}.Release|x86.ActiveCfg = Release|Any CPU {A48D9069-D569-4110-9252-A10F139B669B}.Release|x86.Build.0 = Release|Any CPU + {E8AEFBF9-0113-4FA4-BE45-6CDA555498B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E8AEFBF9-0113-4FA4-BE45-6CDA555498B7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E8AEFBF9-0113-4FA4-BE45-6CDA555498B7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {E8AEFBF9-0113-4FA4-BE45-6CDA555498B7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {E8AEFBF9-0113-4FA4-BE45-6CDA555498B7}.Debug|x86.ActiveCfg = Debug|Any CPU + {E8AEFBF9-0113-4FA4-BE45-6CDA555498B7}.Debug|x86.Build.0 = Debug|Any CPU + {E8AEFBF9-0113-4FA4-BE45-6CDA555498B7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E8AEFBF9-0113-4FA4-BE45-6CDA555498B7}.Release|Any CPU.Build.0 = Release|Any CPU + {E8AEFBF9-0113-4FA4-BE45-6CDA555498B7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {E8AEFBF9-0113-4FA4-BE45-6CDA555498B7}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {E8AEFBF9-0113-4FA4-BE45-6CDA555498B7}.Release|x86.ActiveCfg = Release|Any CPU + {E8AEFBF9-0113-4FA4-BE45-6CDA555498B7}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -563,6 +577,7 @@ Global {27D9800E-2689-4AA1-A2D6-128E4A9BAE98} = {F8CE2712-826B-450B-A72F-D32D80C99858} {1443F539-DCC7-4491-B4FD-B716C739DB3C} = {BB6973BA-B3A2-4B31-A986-7CB008F22C4F} {A48D9069-D569-4110-9252-A10F139B669B} = {F8CE2712-826B-450B-A72F-D32D80C99858} + {E8AEFBF9-0113-4FA4-BE45-6CDA555498B7} = {F8CE2712-826B-450B-A72F-D32D80C99858} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {68E993E6-EE86-4DDF-B0A1-4FE884F8AC39} diff --git a/PascalABCNET_40.sln b/PascalABCNET_40.sln index b28a30182..a80a50025 100644 --- a/PascalABCNET_40.sln +++ b/PascalABCNET_40.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.14 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34723.18 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "VisualPascalABCNET", "VisualPascalABCNET", "{26843C5D-9D7E-4C2C-AC14-2D227FA5592E}" EndProject @@ -101,6 +101,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LambdaAnySynToSemConverter" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LanguageIntegrator", "LanguageIntegrator\LanguageIntegrator.csproj", "{A48D9069-D569-4110-9252-A10F139B669B}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StringConstants", "StringConstants\StringConstants.csproj", "{E8AEFBF9-0113-4FA4-BE45-6CDA555498B7}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -459,6 +461,18 @@ Global {A48D9069-D569-4110-9252-A10F139B669B}.Release|Mixed Platforms.Build.0 = Release|Any CPU {A48D9069-D569-4110-9252-A10F139B669B}.Release|x86.ActiveCfg = Release|Any CPU {A48D9069-D569-4110-9252-A10F139B669B}.Release|x86.Build.0 = Release|Any CPU + {E8AEFBF9-0113-4FA4-BE45-6CDA555498B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E8AEFBF9-0113-4FA4-BE45-6CDA555498B7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E8AEFBF9-0113-4FA4-BE45-6CDA555498B7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {E8AEFBF9-0113-4FA4-BE45-6CDA555498B7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {E8AEFBF9-0113-4FA4-BE45-6CDA555498B7}.Debug|x86.ActiveCfg = Debug|Any CPU + {E8AEFBF9-0113-4FA4-BE45-6CDA555498B7}.Debug|x86.Build.0 = Debug|Any CPU + {E8AEFBF9-0113-4FA4-BE45-6CDA555498B7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E8AEFBF9-0113-4FA4-BE45-6CDA555498B7}.Release|Any CPU.Build.0 = Release|Any CPU + {E8AEFBF9-0113-4FA4-BE45-6CDA555498B7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {E8AEFBF9-0113-4FA4-BE45-6CDA555498B7}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {E8AEFBF9-0113-4FA4-BE45-6CDA555498B7}.Release|x86.ActiveCfg = Release|Any CPU + {E8AEFBF9-0113-4FA4-BE45-6CDA555498B7}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -500,6 +514,7 @@ Global {A9AB4282-83B4-41A7-86C3-E5BF6A45E7E2} = {F8CE2712-826B-450B-A72F-D32D80C99858} {3AA92A45-7142-4C59-B12F-56DAE32A40E3} = {EC68A3D8-6D63-4A79-ABA6-BF8E9D7756D7} {27D9800E-2689-4AA1-A2D6-128E4A9BAE98} = {F8CE2712-826B-450B-A72F-D32D80C99858} + {E8AEFBF9-0113-4FA4-BE45-6CDA555498B7} = {F8CE2712-826B-450B-A72F-D32D80C99858} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {97A10B06-9161-4E2B-9C6F-10EEF45013EC} diff --git a/ReleaseGenerators/PascalABCNETConsoleZIP.bat b/ReleaseGenerators/PascalABCNETConsoleZIP.bat index 6835835e3..0e85f1b1d 100644 --- a/ReleaseGenerators/PascalABCNETConsoleZIP.bat +++ b/ReleaseGenerators/PascalABCNETConsoleZIP.bat @@ -1,6 +1,6 @@ cd ..\bin del ..\Release\PACNETConsole.zip -..\utils\pkzipc\pkzipc.exe -add ..\Release\PABCNETC.zip pabcnetc.exe pabcnetcclear.exe Compiler.dll CompilerTools.dll Errors.dll Localization.dll NETGenerator.dll ParserTools.dll ICSharpCode.NRefactory.dll SemanticTree.dll SyntaxTree.dll TreeConverter.dll OptimizerConversion.dll PascalABCParser.dll licence.txt PascalABCNET.chm System.Threading.dll SyntaxTreeConverters.dll YieldHelpers.dll SyntaxVisitors.dll LambdaAnySynToSemConverter.dll LanguageIntegrator.dll +..\utils\pkzipc\pkzipc.exe -add ..\Release\PABCNETC.zip pabcnetc.exe pabcnetcclear.exe Compiler.dll CompilerTools.dll Errors.dll Localization.dll NETGenerator.dll ParserTools.dll ICSharpCode.NRefactory.dll SemanticTree.dll SyntaxTree.dll TreeConverter.dll OptimizerConversion.dll PascalABCParser.dll licence.txt PascalABCNET.chm System.Threading.dll SyntaxTreeConverters.dll YieldHelpers.dll SyntaxVisitors.dll LambdaAnySynToSemConverter.dll LanguageIntegrator.dll StringConstants.dll ..\utils\pkzipc\pkzipc.exe -add -nozip -dir ..\Release\PABCNETC.zip Lib\*.pcu ..\utils\pkzipc\pkzipc.exe -add -nozip -dir ..\Release\PABCNETC.zip Lng\*.dat ..\utils\pkzipc\pkzipc.exe -add -nozip -dir ..\Release\PABCNETC.zip Lng\*.LanguageName diff --git a/ReleaseGenerators/PascalABCNETMonoZIP.bat b/ReleaseGenerators/PascalABCNETMonoZIP.bat index e2c05c510..0489bd216 100644 --- a/ReleaseGenerators/PascalABCNETMonoZIP.bat +++ b/ReleaseGenerators/PascalABCNETMonoZIP.bat @@ -1,6 +1,6 @@ cd ..\bin del ..\Release\PascalABCNETMono.zip -..\utils\pkzipc\pkzipc.exe -add ..\Release\PascalABCNETMono.zip PascalABCNETMono.exe pabcnetc.exe pabcnetc PascalABCNET Compiler.dll CompilerTools.dll Errors.dll Localization.dll NETGenerator.dll ParserTools.dll SyntaxTreeConverters.dll ICSharpCode.NRefactory.dll SemanticTree.dll SyntaxTree.dll TreeConverter.dll OptimizerConversion.dll PascalABCParser.dll licence.txt PascalABCNET.chm System.Threading.dll PluginsSupport.dll InternalErrorReport.dll ICSharpCode.TextEditor.dll ICSharpCode.SharpZipLib.dll CodeCompletion.dll Debugger.Core.dll Mono.Debugger.Soft.dll Mono.Debugging.dll Mono.Debugging.Soft.dll NETXP.Controls.dll NETXP.Controls.Bars.dll NETXP.Library.dll NETXP.Win32.dll WeifenLuo.WinFormsUI.Docking.dll template.pct YieldHelpers.dll LanguageIntegrator.dll +..\utils\pkzipc\pkzipc.exe -add ..\Release\PascalABCNETMono.zip PascalABCNETMono.exe pabcnetc.exe pabcnetc PascalABCNET Compiler.dll CompilerTools.dll Errors.dll Localization.dll NETGenerator.dll ParserTools.dll SyntaxTreeConverters.dll ICSharpCode.NRefactory.dll SemanticTree.dll SyntaxTree.dll TreeConverter.dll OptimizerConversion.dll PascalABCParser.dll licence.txt PascalABCNET.chm System.Threading.dll PluginsSupport.dll InternalErrorReport.dll ICSharpCode.TextEditor.dll ICSharpCode.SharpZipLib.dll CodeCompletion.dll Debugger.Core.dll Mono.Debugger.Soft.dll Mono.Debugging.dll Mono.Debugging.Soft.dll NETXP.Controls.dll NETXP.Controls.Bars.dll NETXP.Library.dll NETXP.Win32.dll WeifenLuo.WinFormsUI.Docking.dll template.pct YieldHelpers.dll LanguageIntegrator.dll StringConstants.dll ..\utils\pkzipc\pkzipc.exe -add -nozip -dir ..\Release\PascalABCNETMono.zip Lib\*.pcu ..\utils\pkzipc\pkzipc.exe -add -nozip -dir ..\Release\PascalABCNETMono.zip Highlighting\*.xshd ..\utils\pkzipc\pkzipc.exe -add -nozip -dir ..\Release\PascalABCNETMono.zip Ico\*.ico diff --git a/ReleaseGenerators/sect_Core.nsh b/ReleaseGenerators/sect_Core.nsh index d92b8f2b1..6da0e7fe7 100644 --- a/ReleaseGenerators/sect_Core.nsh +++ b/ReleaseGenerators/sect_Core.nsh @@ -8,6 +8,7 @@ File "..\bin\Localization.dll" File "..\bin\NETGenerator.dll" File "..\bin\LanguageIntegrator.dll" + File "..\bin\StringConstants.dll" File "..\bin\ParserTools.dll" File "..\bin\SemanticTree.dll" File "..\bin\SyntaxTree.dll" @@ -59,6 +60,7 @@ ${AddFile} "Localization.dll" ${AddFile} "NETGenerator.dll" ${AddFile} "LanguageIntegrator.dll" + ${AddFile} "StringConstants.dll" ${AddFile} "ParserTools.dll" ${AddFile} "SemanticTree.dll" ${AddFile} "SyntaxTree.dll" diff --git a/StringConstants/Properties/AssemblyInfo.cs b/StringConstants/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..fd306c9ad --- /dev/null +++ b/StringConstants/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Общие сведения об этой сборке предоставляются следующим набором +// набора атрибутов. Измените значения этих атрибутов для изменения сведений, +// связанные со сборкой. +[assembly: AssemblyTitle("StringConstants")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("StringConstants")] +[assembly: AssemblyCopyright("Copyright © 2005-2024 by Ivan Bondarev, Stanislav Mikhalkovich")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми +// для компонентов COM. Если необходимо обратиться к типу в этой сборке через +// COM, задайте атрибуту ComVisible значение TRUE для этого типа. +[assembly: ComVisible(false)] + +// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM +[assembly: Guid("e8aefbf9-0113-4fa4-be45-6cda555498b7")] + +// Сведения о версии сборки состоят из указанных ниже четырех значений: +// +// Основной номер версии +// Дополнительный номер версии +// Номер сборки +// Редакция +// +// Можно задать все значения или принять номера сборки и редакции по умолчанию +// используя "*", как показано ниже: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/TreeConverter/TreeConversion/compiler_string_consts.cs b/StringConstants/StringConstants.cs similarity index 93% rename from TreeConverter/TreeConversion/compiler_string_consts.cs rename to StringConstants/StringConstants.cs index 6c3707131..2cfe598fc 100644 --- a/TreeConverter/TreeConversion/compiler_string_consts.cs +++ b/StringConstants/StringConstants.cs @@ -1,18 +1,14 @@ // Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (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.Collections; + using System.Collections.Generic; using System.Text; -using PascalABCCompiler.TreeRealization; +using System; -namespace PascalABCCompiler.TreeConverter +namespace PascalABCCompiler { - - public static class compiler_string_consts + public static class StringConstants { - public static Dictionary oper_names = new Dictionary(); static int tvnc = 0; @@ -21,7 +17,7 @@ namespace PascalABCCompiler.TreeConverter return "$TV" + (tvnc++).ToString() + "$"; } - static compiler_string_consts() + static StringConstants() { oper_names[plus_name] = "op_Addition"; oper_names[minus_name] = "op_Subtraction"; @@ -65,7 +61,7 @@ namespace PascalABCCompiler.TreeConverter return null; } string rez = name; - int ind = name.IndexOf(compiler_string_consts.generic_params_infix); + int ind = name.IndexOf(generic_params_infix); if (ind > 0) { rez = name.Substring(0, ind); @@ -85,8 +81,22 @@ namespace PascalABCCompiler.TreeConverter } + #region INTERNAL FUNCTION NAMES public static string ImplementationSectionNamespaceName = "_implementation______"; + public static readonly string main_function_name = "Main"; + public static readonly string c_main_function_name = "main"; + public static readonly string temp_main_function_name = "$Main"; + public static readonly string initialization_function_name = "$Initialization"; + public static readonly string finalization_function_name = "$Finalization"; + public static readonly string function_return_value_prefix = "$rv_"; + public static readonly string empty_function_name = "empty_function"; + #endregion + public static string CommandLineArgsVariableName = "CommandLineArgs"; + public static string MainArgsParamName = "args"; + public static string IsConsoleApplicationVariableName = "IsConsoleApplication"; + + #region TYPE NAMES public static readonly string bool_type_name = "boolean"; public static readonly string byte_type_name = "byte"; public static readonly string sbyte_type_name = "shortint"; @@ -112,7 +122,9 @@ namespace PascalABCCompiler.TreeConverter public static readonly string void_class_name = "void"; public static string value = "value"; public static readonly string object_equals_name = "Equals"; + #endregion + #region OPERATORS public static readonly string plus_name = "+"; public static readonly string minus_name = "-"; public static readonly string mul_name = "*"; @@ -121,11 +133,6 @@ namespace PascalABCCompiler.TreeConverter public static readonly string mod_name = "mod"; public static readonly string explicit_operator_name = "op_Explicit"; public static readonly string implicit_operator_name = "op_Implicit"; - - //public static string CommandLineArgsVariableName = "CommandLineArgs"; - public static string MainArgsParamName = "args"; - public static string IsConsoleApplicationVariableName = "IsConsoleApplication"; - public static readonly string plusassign_name = "+="; public static readonly string minusassign_name = "-="; public static readonly string multassign_name = "*="; @@ -150,20 +157,12 @@ namespace PascalABCCompiler.TreeConverter public static readonly string shr_name = "shr"; public static readonly string assign_name = ":="; + #endregion public static readonly string unary_param_name = "param"; public static readonly string left_param_name = "left"; public static readonly string right_param_name = "right"; - public static readonly string main_function_name = "Main"; - public static readonly string c_main_function_name = "main"; - public static readonly string temp_main_function_name = "$Main"; - public static readonly string initialization_function_name = "$Initialization"; - public static readonly string finalization_function_name = "$Finalization"; - - public static readonly string function_return_value_prefix = "$rv_"; - public static readonly string empty_function_name = "empty_function"; - public static readonly string break_procedure_name = "break"; public static readonly string continue_procedure_name = "continue"; public static readonly string exit_procedure_name = "exit"; @@ -183,8 +182,6 @@ namespace PascalABCCompiler.TreeConverter public static readonly string set_val_pascal_array_name = "set_val"; public static readonly string index_property_pascal_array_name = "index"; - public static readonly string system_unit_name = "PascalABCSystem"; - public static readonly string delegate_type_name_template = "$delegate"; public static readonly string roof_name = "^"; @@ -319,12 +316,11 @@ namespace PascalABCCompiler.TreeConverter public static string default_constructor_name = "create"; - // SSM - Константы директив компилятора. Вообще разбросаны по коду. Пусть будут здесь (3.1.2011) - #region COMPILER DIRECTIVES + #region PASCAL COMPILER DIRECTIVES public static string compiler_directive_apptype = "apptype"; public static string compiler_directive_reference = "reference"; - public static string include_namespace_directive = "includenamespace"; - public static string compiler_savepcu = "savepcu"; + public static string compiler_directive_include_namespace = "includenamespace"; + public static string compiler_directive_savepcu = "savepcu"; public static string compiler_directive_zerobasedstrings = "zerobasedstrings"; public static string compiler_directive_zerobasedstrings_ON = "string_zerobased+"; public static string compiler_directive_zerobasedstrings_OFF = "string_zerobased-"; @@ -347,24 +343,27 @@ namespace PascalABCCompiler.TreeConverter public static string compiler_directive_include = "include"; public static string compiler_directive_targetframework = "targetframework"; public static string compiler_directive_hidden_idents = "hiddenidents"; - public const string version_string = "version"; - public const string product_string = "product"; - public const string company_string = "company"; - public const string copyright_string = "copyright"; - public const string trademark_string = "trademark"; - public const string main_resource_string = "mainresource"; - public const string title_string = "title"; - public const string description_string = "description"; + public static string compiler_directive_omp = "omp"; + public const string compiler_directive_version_string = "version"; + public const string compiler_directive_product_string = "product"; + public const string compiler_directive_company_string = "company"; + public const string compiler_directive_copyright_string = "copyright"; + public const string compiler_directive_trademark_string = "trademark"; + public const string compiler_directive_main_resource_string = "mainresource"; + public const string compiler_directive_title_string = "title"; + public const string compiler_directive_description_string = "description"; #endregion // SSM (3.1.2011) Перенес эти константы сюда. public static string system_unit_marker = "__IS_SYSTEM_MODULE"; - #region PASCAL LANGUAGE + + #region PASCAL LANGUAGE BASIC NAMES public const string pascalLanguageName = "PascalABC.NET"; public const string pascalSourceFileExtension = ".pas"; public const string pascalCompiledUnitExtension = ".pcu"; - public static string pascalSystemUnitName = "PABCSystem"; - public static string pascalExtensionsUnitName = "PABCExtensions"; + public const string pascalSystemUnitName = "PABCSystem"; + public const string pascalSystemUnitNamespaceName = "PascalABCSystem"; + public const string pascalExtensionsUnitName = "PABCExtensions"; public static readonly string[] pascalDefaultStandardModules = new string[] { pascalSystemUnitName, @@ -416,7 +415,7 @@ namespace PascalABCCompiler.TreeConverter { if (name.IndexOf(".") != -1) { - return string.Format("{0}get_{1}", name.Substring(0, name.LastIndexOf('.') + 1), name.Substring(name.LastIndexOf('.')+1)); + return string.Format("{0}get_{1}", name.Substring(0, name.LastIndexOf('.') + 1), name.Substring(name.LastIndexOf('.') + 1)); } return GetAccessorName("get_{0}", name); } @@ -470,5 +469,4 @@ namespace PascalABCCompiler.TreeConverter public static string StringType = "string"; public static string config_variable_name = "__CONFIG__"; } - } diff --git a/StringConstants/StringConstants.csproj b/StringConstants/StringConstants.csproj new file mode 100644 index 000000000..37aa07259 --- /dev/null +++ b/StringConstants/StringConstants.csproj @@ -0,0 +1,47 @@ + + + + + Debug + AnyCPU + {E8AEFBF9-0113-4FA4-BE45-6CDA555498B7} + Library + Properties + StringConstants + StringConstants + v4.0 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\bin\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SyntaxTree/tree/Tree.cs b/SyntaxTree/tree/Tree.cs index 40b64c375..ac3f0ee58 100644 --- a/SyntaxTree/tree/Tree.cs +++ b/SyntaxTree/tree/Tree.cs @@ -1,6 +1,6 @@ - +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (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.Collections; using System.Collections.Generic; namespace PascalABCCompiler.SyntaxTree diff --git a/TestSuite/CompilationSamples/GOLDParserEngine.pas b/TestSuite/CompilationSamples/GOLDParserEngine.pas index 809ae518b..091d93637 100644 --- a/TestSuite/CompilationSamples/GOLDParserEngine.pas +++ b/TestSuite/CompilationSamples/GOLDParserEngine.pas @@ -1,6 +1,6 @@ -unit GOLDParserEngine; +unit GOLDParserEngine; -{$NullBasedStrings true} +{$zerobasedstrings on} //---------------------------------------------------------------------- // Gold Parser engine for PascalABC.NET, v0.1 diff --git a/TestSuite/formatter_tests/input/GOLDParserEngine.pas b/TestSuite/formatter_tests/input/GOLDParserEngine.pas index 809ae518b..091d93637 100644 --- a/TestSuite/formatter_tests/input/GOLDParserEngine.pas +++ b/TestSuite/formatter_tests/input/GOLDParserEngine.pas @@ -1,6 +1,6 @@ -unit GOLDParserEngine; +unit GOLDParserEngine; -{$NullBasedStrings true} +{$zerobasedstrings on} //---------------------------------------------------------------------- // Gold Parser engine for PascalABC.NET, v0.1 diff --git a/TreeConverter/LambdaExpressions/Closure/CapturedVariablesSubstitutionClassGenerator.cs b/TreeConverter/LambdaExpressions/Closure/CapturedVariablesSubstitutionClassGenerator.cs index ae4d71d4a..d9256066a 100644 --- a/TreeConverter/LambdaExpressions/Closure/CapturedVariablesSubstitutionClassGenerator.cs +++ b/TreeConverter/LambdaExpressions/Closure/CapturedVariablesSubstitutionClassGenerator.cs @@ -171,7 +171,7 @@ namespace TreeConverter.LambdaExpressions.Closure { var varName = ((IVAriableDefinitionNode)symbolInfo.SymbolInfo.sym_info).name.ToLower(); var ff = symbolInfo.SymbolInfo.sym_info.GetType(); - var isSelfWordInClass = scope is CapturedVariablesTreeNodeClassScope && varName == compiler_string_consts.self_word; + var isSelfWordInClass = scope is CapturedVariablesTreeNodeClassScope && varName == PascalABCCompiler.StringConstants.self_word; SourceContext sourceCtxt = null; if (symbolInfo.SymbolInfo.sym_info.location != null) sourceCtxt = new SourceContext(symbolInfo.SymbolInfo.sym_info.location.begin_line_num, symbolInfo.SymbolInfo.sym_info.location.begin_column_num, @@ -401,7 +401,7 @@ namespace TreeConverter.LambdaExpressions.Closure dotnode1 = new dot_node(ClassName, new ident(varName)); else dotnode1 = new dot_node( - new ident(compiler_string_consts.self_word, sourceCtxt), + new ident(PascalABCCompiler.StringConstants.self_word, sourceCtxt), new ident( _capturedVarsClassDefs[upperScopeWhereVarsAreCaptured.ScopeIndex] .GeneratedUpperClassFieldName, sourceCtxt), sourceCtxt); @@ -457,7 +457,7 @@ namespace TreeConverter.LambdaExpressions.Closure else { var dotnode1 = new dot_node( - new ident(compiler_string_consts.self_word, sourceCtxt), + new ident(PascalABCCompiler.StringConstants.self_word, sourceCtxt), new ident(varName, sourceCtxt), sourceCtxt); _lambdaIdReferences.Add(new LambdaReferencesSubstitutionInfo @@ -517,7 +517,7 @@ namespace TreeConverter.LambdaExpressions.Closure } var dotnode1 = new dot_node( - new ident(compiler_string_consts.self_word, sourceCtxt), + new ident(PascalABCCompiler.StringConstants.self_word, sourceCtxt), new ident(varName, sourceCtxt), sourceCtxt); _lambdaIdReferences.Add(new LambdaReferencesSubstitutionInfo @@ -580,7 +580,7 @@ namespace TreeConverter.LambdaExpressions.Closure cl.AssignNodeForUpperClassFieldInitialization = new assign( new dot_node(new ident(cl.GeneratedSubstitutingFieldName),new ident(cl.GeneratedUpperClassFieldName)), - new ident(compiler_string_consts.self_word)); + new ident(PascalABCCompiler.StringConstants.self_word)); } } @@ -685,7 +685,7 @@ namespace TreeConverter.LambdaExpressions.Closure new ScopeClassDefinition(currentNode.CorrespondingSyntaxTreeNode, typeDeclaration, currentNode, - compiler_string_consts.self_word)); + PascalABCCompiler.StringConstants.self_word)); } } else diff --git a/TreeConverter/LambdaExpressions/Closure/CapturedVariablesSubstitutor.cs b/TreeConverter/LambdaExpressions/Closure/CapturedVariablesSubstitutor.cs index 426e0724f..128689ea9 100644 --- a/TreeConverter/LambdaExpressions/Closure/CapturedVariablesSubstitutor.cs +++ b/TreeConverter/LambdaExpressions/Closure/CapturedVariablesSubstitutor.cs @@ -153,8 +153,8 @@ namespace TreeConverter.LambdaExpressions.Closure var semClassField = pair.Value.Item2; var pn = (common_property_node)pair.Value.Item3; - var readFunction = _visitor.GenerateGetMethodForField(pn, compiler_string_consts.GetGetAccessorName(pn.name), semClassField, null); - var writeFunction = _visitor.GenerateSetMethodForField(pn, compiler_string_consts.GetSetAccessorName(pn.name), semClassField, null); + var readFunction = _visitor.GenerateGetMethodForField(pn, PascalABCCompiler.StringConstants.GetGetAccessorName(pn.name), semClassField, null); + var writeFunction = _visitor.GenerateSetMethodForField(pn, PascalABCCompiler.StringConstants.GetSetAccessorName(pn.name), semClassField, null); pn.internal_get_function = readFunction; pn.internal_set_function = writeFunction; diff --git a/TreeConverter/LambdaExpressions/Closure/CapturedVariablesTreeBuilder.cs b/TreeConverter/LambdaExpressions/Closure/CapturedVariablesTreeBuilder.cs index 839426fed..4bc50211e 100644 --- a/TreeConverter/LambdaExpressions/Closure/CapturedVariablesTreeBuilder.cs +++ b/TreeConverter/LambdaExpressions/Closure/CapturedVariablesTreeBuilder.cs @@ -392,7 +392,7 @@ namespace TreeConverter.LambdaExpressions.Closure { /*if (si.sym_info.semantic_node_type == semantic_node_type.local_variable) { - if (!(idName == compiler_string_consts.self_word && si.scope is SymbolTable.ClassMethodScope && _classScope != null) && InLambdaContext) + if (!(idName == PascalABCCompiler.StringConstants.self_word && si.scope is SymbolTable.ClassMethodScope && _classScope != null) && InLambdaContext) { _visitor.AddError(new ThisTypeOfVariablesCannotBeCaptured(_visitor.get_location(id))); } @@ -402,7 +402,7 @@ namespace TreeConverter.LambdaExpressions.Closure _visitor.AddError(new CannotCaptureNonValueParameters(_visitor.get_location(id))); } - if (idName == compiler_string_consts.self_word && si.scope is SymbolTable.ClassMethodScope && + if (idName == PascalABCCompiler.StringConstants.self_word && si.scope is SymbolTable.ClassMethodScope && _classScope != null) { var selfField = _classScope.VariablesDefinedInScope.Find(var => var.SymbolInfo == si); diff --git a/TreeConverter/NetWrappers/NetHelper.cs b/TreeConverter/NetWrappers/NetHelper.cs index c64ad72ab..5d3c65827 100644 --- a/TreeConverter/NetWrappers/NetHelper.cs +++ b/TreeConverter/NetWrappers/NetHelper.cs @@ -212,7 +212,7 @@ namespace PascalABCCompiler.NetHelper { object[] attrs = entry_type.GetCustomAttributes(false); for (int j = 0; j < attrs.Length; j++) - if (attrs[j].GetType().Name == PascalABCCompiler.TreeConverter.compiler_string_consts.global_attr_name) + if (attrs[j].GetType().Name == StringConstants.global_attr_name) { sil = NetHelper.FindName(entry_type, name); if (sil != null) break; @@ -559,7 +559,7 @@ namespace PascalABCCompiler.NetHelper if (members.TryGetValue(tmp, out mht)) { List mis2 = null; - string name = compiler_string_consts.GetNETOperName(mi.Name); + string name = StringConstants.GetNETOperName(mi.Name); if (name == null) name = mi.Name; if (!mht.TryGetValue(name, out mis2)) @@ -578,7 +578,7 @@ namespace PascalABCCompiler.NetHelper if (members.TryGetValue(tt, out mht)) { List mis2 = null; - string name = compiler_string_consts.GetNETOperName(mi.Name); + string name = StringConstants.GetNETOperName(mi.Name); if (name == null) name = mi.Name; if (!mht.TryGetValue(name, out mis2)) @@ -597,7 +597,7 @@ namespace PascalABCCompiler.NetHelper if (members.TryGetValue(arr_t, out mht)) { List mis2 = null; - string name = compiler_string_consts.GetNETOperName(mi.Name); + string name = StringConstants.GetNETOperName(mi.Name); if (name == null) name = mi.Name; if (!mht.TryGetValue(name, out mis2)) @@ -615,7 +615,7 @@ namespace PascalABCCompiler.NetHelper if (members.TryGetValue(gen_t, out mht)) { List mis2 = null; - string name = compiler_string_consts.GetNETOperName(mi.Name); + string name = StringConstants.GetNETOperName(mi.Name); if (name == null) name = mi.Name; if (!mht.TryGetValue(name, out mis2)) @@ -637,7 +637,7 @@ namespace PascalABCCompiler.NetHelper object[] attrs = t.GetCustomAttributes(false); foreach (Attribute attr in attrs) { - if (attr.GetType().Name == PascalABCCompiler.TreeConverter.compiler_string_consts.global_attr_name) + if (attr.GetType().Name == StringConstants.global_attr_name) { entry_type = t; unit_types.Insert(0, t); @@ -645,11 +645,11 @@ namespace PascalABCCompiler.NetHelper break; } - else if (attr.GetType().Name == PascalABCCompiler.TreeConverter.compiler_string_consts.class_unit_attr_name) + else if (attr.GetType().Name == StringConstants.class_unit_attr_name) { - if (_assembly.ManifestModule.ScopeName == compiler_string_consts.pabc_rtl_dll_name) + if (_assembly.ManifestModule.ScopeName == StringConstants.pabc_rtl_dll_name) { - if (t.Name == compiler_string_consts.pascalSystemUnitName) + if (t.Name == StringConstants.pascalSystemUnitName) PABCSystemType = t; else if (t.Name == "PT4") PT4Type = t; @@ -665,7 +665,7 @@ namespace PascalABCCompiler.NetHelper if (attrs.Length == 1) { Type attr_t = attrs[0].GetType(); - if (attr_t.FullName == compiler_string_consts.file_of_attr_name) + if (attr_t.FullName == StringConstants.file_of_attr_name) { object o = attr_t.GetField("Type", BindingFlags.Public | BindingFlags.Instance).GetValue(attrs[0]); if (o is Type) @@ -686,7 +686,7 @@ namespace PascalABCCompiler.NetHelper compiled_pascal_types[t.Namespace + "." + t.Name.Substring(1)] = t; } } - else if (attr_t.FullName == compiler_string_consts.set_of_attr_name) + else if (attr_t.FullName == StringConstants.set_of_attr_name) { object o = attr_t.GetField("Type", BindingFlags.Public | BindingFlags.Instance).GetValue(attrs[0]); if (o is Type) @@ -710,7 +710,7 @@ namespace PascalABCCompiler.NetHelper compiled_pascal_types[t.Namespace + "." + t.Name.Substring(1)] = t; } } - else if (attr_t.FullName == compiler_string_consts.short_string_attr_name) + else if (attr_t.FullName == StringConstants.short_string_attr_name) { int len = (int)attr_t.GetField("Length", BindingFlags.Public | BindingFlags.Instance).GetValue(attrs[0]); if (PascalABCCompiler.TreeConverter.compilation_context.instance != null && PascalABCCompiler.TreeConverter.compilation_context.instance.syntax_tree_visitor.compiled_unit != null && PascalABCCompiler.TreeConverter.compilation_context.instance.converted_namespace != null) @@ -723,11 +723,11 @@ namespace PascalABCCompiler.NetHelper compiled_pascal_types[t.Namespace + "." + t.Name.Substring(1)] = t; } } - else if (attr_t.FullName == compiler_string_consts.template_class_attr_name) + else if (attr_t.FullName == StringConstants.template_class_attr_name) { compiled_pascal_types[t.Namespace + "." + t.Name.Substring(1)] = t; } - else if (attr_t.FullName == compiler_string_consts.type_synonim_attr_name) + else if (attr_t.FullName == StringConstants.type_synonim_attr_name) { object o = attr_t.GetField("Type", BindingFlags.Public | BindingFlags.Instance).GetValue(attrs[0]); if (o is Type) @@ -775,7 +775,7 @@ namespace PascalABCCompiler.NetHelper if (attrs.Length == 1) { Type attr_t = attrs[0].GetType(); - if (attr_t.FullName == compiler_string_consts.file_of_attr_name) + if (attr_t.FullName == StringConstants.file_of_attr_name) { object o = attr_t.GetField("Type", BindingFlags.Public | BindingFlags.Instance).GetValue(attrs[0]); if (o is Type) @@ -792,7 +792,7 @@ namespace PascalABCCompiler.NetHelper } return PascalABCCompiler.TreeConverter.compilation_context.instance.create_typed_file_type(compiled_type_node.get_type_node(attr_t), null); } - else if (attr_t.FullName == compiler_string_consts.set_of_attr_name) + else if (attr_t.FullName == StringConstants.set_of_attr_name) { object o = attr_t.GetField("Type", BindingFlags.Public | BindingFlags.Instance).GetValue(attrs[0]); if (o is Type) @@ -809,12 +809,12 @@ namespace PascalABCCompiler.NetHelper } return PascalABCCompiler.TreeConverter.compilation_context.instance.create_set_type(compiled_type_node.get_type_node(attr_t), null); } - else if (attr_t.FullName == compiler_string_consts.short_string_attr_name) + else if (attr_t.FullName == StringConstants.short_string_attr_name) { int len = (int)attr_t.GetField("Length", BindingFlags.Public | BindingFlags.Instance).GetValue(attrs[0]); return PascalABCCompiler.TreeConverter.compilation_context.instance.create_short_string_type(len, null); } - else if (attr_t.FullName == compiler_string_consts.template_class_attr_name) + else if (attr_t.FullName == StringConstants.template_class_attr_name) { return null; @@ -846,8 +846,8 @@ namespace PascalABCCompiler.NetHelper { object[] attrs = t.GetCustomAttributes(false); for (int j=0; j al = null; - string s = compiler_string_consts.GetNETOperName(mi.Name); + string s = StringConstants.GetNETOperName(mi.Name); if (s == null) s = mi.Name; if (!ht.TryGetValue(s, out al)) @@ -1451,8 +1451,8 @@ namespace PascalABCCompiler.NetHelper public static List FindNameIncludeProtected(Type t, string name) { if (name == null) return null; - if (name == compiler_string_consts.assign_name) return null; - string s = compiler_string_consts.GetNETOperName(name); + if (name == StringConstants.assign_name) return null; + string s = StringConstants.GetNETOperName(name); if (s != null) { if (IsStandType(t)) return null; @@ -1516,8 +1516,8 @@ namespace PascalABCCompiler.NetHelper public static List FindName(Type t, string name) { if (name == null) return null; - if (name == compiler_string_consts.assign_name) return null; - string s = compiler_string_consts.GetNETOperName(name); + if (name == StringConstants.assign_name) return null; + string s = StringConstants.GetNETOperName(name); string tmp_name = name; if (s != null) { @@ -1667,7 +1667,7 @@ namespace PascalABCCompiler.NetHelper for (int i=0; iMaxValue @@ -1095,17 +1095,17 @@ namespace PascalABCCompiler.SystemLibrary basic_function_node inc_method = create_inc_method(SemanticTree.basic_function_type.iinc, _integer_type); basic_function_node dec_method = create_dec_method(SemanticTree.basic_function_type.iinc, _integer_type); - SymbolInfo si = _char_type.find(compiler_string_consts.greq_name); + SymbolInfo si = _char_type.find(StringConstants.greq_name); basic_function_node greq = (basic_function_node)si.sym_info; - si = _char_type.find(compiler_string_consts.smeq_name); + si = _char_type.find(StringConstants.smeq_name); basic_function_node loeq = (basic_function_node)si.sym_info; constant_node cn_max = new char_const_node(char.MaxValue,null); constant_node cn_min = new char_const_node(char.MinValue,null); basic_function_node c2i_method = new basic_function_node(SemanticTree.basic_function_type.chartoi, _integer_type,true); - basic_parameter cp = new basic_parameter(compiler_string_consts.unary_param_name, _char_type, + basic_parameter cp = new basic_parameter(StringConstants.unary_param_name, _char_type, SemanticTree.parameter_type.value, c2i_method); //TODO: Сделано очень плохо. add_stand_type(SemanticTree.basic_function_type.chartoi, c2i_method); @@ -1150,28 +1150,28 @@ namespace PascalABCCompiler.SystemLibrary Decimal signed 128 */ _byte_type = compiled_type_node.get_type_node(typeof(byte), symtab); - _byte_type.SetName(compiler_string_consts.byte_type_name); + _byte_type.SetName(StringConstants.byte_type_name); _sbyte_type = compiled_type_node.get_type_node(typeof(sbyte), symtab); - _sbyte_type.SetName(compiler_string_consts.sbyte_type_name); + _sbyte_type.SetName(StringConstants.sbyte_type_name); _short_type = compiled_type_node.get_type_node(typeof(short), symtab); - _short_type.SetName(compiler_string_consts.short_type_name); + _short_type.SetName(StringConstants.short_type_name); _ushort_type = compiled_type_node.get_type_node(typeof(ushort), symtab); - _ushort_type.SetName(compiler_string_consts.ushort_type_name); + _ushort_type.SetName(StringConstants.ushort_type_name); _integer_type = compiled_type_node.get_type_node(typeof(int), symtab); - _integer_type.SetName(compiler_string_consts.integer_type_name); + _integer_type.SetName(StringConstants.integer_type_name); _uint_type = compiled_type_node.get_type_node(typeof(uint), symtab); - _uint_type.SetName(compiler_string_consts.uint_type_name); + _uint_type.SetName(StringConstants.uint_type_name); _int64_type = compiled_type_node.get_type_node(typeof(long), symtab); - _int64_type.SetName(compiler_string_consts.long_type_name); + _int64_type.SetName(StringConstants.long_type_name); _uint64_type = compiled_type_node.get_type_node(typeof(ulong), symtab); - _uint64_type.SetName(compiler_string_consts.ulong_type_name); + _uint64_type.SetName(StringConstants.ulong_type_name); _icloneable_interface = compiled_type_node.get_type_node(typeof(ICloneable), symtab); _ilist_interface = compiled_type_node.get_type_node(typeof(IList), symtab); @@ -1185,41 +1185,41 @@ namespace PascalABCCompiler.SystemLibrary _ienumerable1_interface = compiled_type_node.get_type_node(typeof(IEnumerable<>)); _assert_method = compiled_function_node.get_compiled_method(typeof(System.Diagnostics.Debug).GetMethod("Assert",new Type[1]{typeof(bool)})); _decimal_type = compiled_type_node.get_type_node(typeof(decimal), symtab); - //_decimal_type.SetName(compiler_string_consts.decimal_type_name); + //_decimal_type.SetName(StringConstants.decimal_type_name); make_assign_operator(_decimal_type, SemanticTree.basic_function_type.objassign); _bool_type = compiled_type_node.get_type_node(typeof(bool), symtab); - _bool_type.SetName(compiler_string_consts.bool_type_name); + _bool_type.SetName(StringConstants.bool_type_name); _double_type = compiled_type_node.get_type_node(typeof(double), symtab); - _double_type.SetName(compiler_string_consts.real_type_name); + _double_type.SetName(StringConstants.real_type_name); _float_type = compiled_type_node.get_type_node(typeof(float), symtab); - _float_type.SetName(compiler_string_consts.float_type_name); + _float_type.SetName(StringConstants.float_type_name); _char_type = compiled_type_node.get_type_node(typeof(char), symtab); - _char_type.SetName(compiler_string_consts.char_type_name); + _char_type.SetName(StringConstants.char_type_name); _string_type = compiled_type_node.get_type_node(typeof(string), symtab); - _string_type.SetName(compiler_string_consts.string_type_name); + _string_type.SetName(StringConstants.string_type_name); _pointer_type = compiled_type_node.get_type_node(NetHelper.NetHelper.void_ptr_type, symtab); - _pointer_type.SetName(compiler_string_consts.pointer_type_name); + _pointer_type.SetName(StringConstants.pointer_type_name); _object_type = compiled_type_node.get_type_node(typeof(object), symtab); - _object_type.SetName(compiler_string_consts.object_type_name); + _object_type.SetName(StringConstants.object_type_name); _complex_type = compiled_type_node.get_type_node(typeof(System.Numerics.Complex), symtab); _complex_type_constructor = compiled_constructor_node.get_compiled_constructor(_complex_type.compiled_type.GetConstructor(new Type[] { typeof(double), typeof(double)})); _enum_base_type = compiled_type_node.get_type_node(typeof(System.Enum), symtab); _delegate_base_type = compiled_type_node.get_type_node(typeof(System.MulticastDelegate), symtab); - _delegate_base_type.SetName(compiler_string_consts.base_delegate_type_name); + _delegate_base_type.SetName(StringConstants.base_delegate_type_name); _system_delegate_type = compiled_type_node.get_type_node(typeof(System.Delegate), symtab); _array_base_type = compiled_type_node.get_type_node(typeof(System.Array), symtab); - _array_base_type.SetName(compiler_string_consts.base_array_type_name); + _array_base_type.SetName(StringConstants.base_array_type_name); _void_type = compiled_type_node.get_type_node(typeof(void), symtab); @@ -1230,24 +1230,24 @@ namespace PascalABCCompiler.SystemLibrary arr_params[0]=delegate_type; arr_params[1]=delegate_type; _delegate_combine_method = - compiled_function_node.get_compiled_method(delegate_type.GetMethod(compiler_string_consts.combine_method_name, arr_params)); + compiled_function_node.get_compiled_method(delegate_type.GetMethod(StringConstants.combine_method_name, arr_params)); _delegate_remove_method = - compiled_function_node.get_compiled_method(delegate_type.GetMethod(compiler_string_consts.remove_method_name, arr_params)); + compiled_function_node.get_compiled_method(delegate_type.GetMethod(StringConstants.remove_method_name, arr_params)); _object_equals_method = - compiled_function_node.get_compiled_method(typeof(object).GetMethod(compiler_string_consts.object_equals_name, new Type[2] { typeof(object), typeof(object) })); + compiled_function_node.get_compiled_method(typeof(object).GetMethod(StringConstants.object_equals_name, new Type[2] { typeof(object), typeof(object) })); //Это для прикола. Убрать! - //make_common_binary_operation(compiler_string_consts.plus_name, _integer_type, _integer_type, _byte_type, SemanticTree.basic_function_type.badd, _byte_type); + //make_common_binary_operation(StringConstants.plus_name, _integer_type, _integer_type, _byte_type, SemanticTree.basic_function_type.badd, _byte_type); //Это нормально? (чтобы работало i:=+15;) /* - make_unary_operator(compiler_string_consts.plus_name, _byte_type, SemanticTree.basic_function_type.none); - make_unary_operator(compiler_string_consts.plus_name, _integer_type, SemanticTree.basic_function_type.none); - make_unary_operator(compiler_string_consts.plus_name, _long_type, SemanticTree.basic_function_type.none); - make_unary_operator(compiler_string_consts.plus_name, _real_type, SemanticTree.basic_function_type.none); + make_unary_operator(StringConstants.plus_name, _byte_type, SemanticTree.basic_function_type.none); + make_unary_operator(StringConstants.plus_name, _integer_type, SemanticTree.basic_function_type.none); + make_unary_operator(StringConstants.plus_name, _long_type, SemanticTree.basic_function_type.none); + make_unary_operator(StringConstants.plus_name, _real_type, SemanticTree.basic_function_type.none); */ //integer type @@ -1266,33 +1266,33 @@ namespace PascalABCCompiler.SystemLibrary //Присваивание для integer. _int_assign=make_assign_operator(_integer_type, SemanticTree.basic_function_type.iassign); //Унарные операции. - _int_unmin=make_unary_operator(compiler_string_consts.minus_name, _integer_type, SemanticTree.basic_function_type.iunmin); - _int_not = make_unary_operator(compiler_string_consts.not_name, _integer_type, SemanticTree.basic_function_type.inot); - make_unary_empty_operator(compiler_string_consts.plus_name, _integer_type, _integer_type); + _int_unmin=make_unary_operator(StringConstants.minus_name, _integer_type, SemanticTree.basic_function_type.iunmin); + _int_not = make_unary_operator(StringConstants.not_name, _integer_type, SemanticTree.basic_function_type.inot); + make_unary_empty_operator(StringConstants.plus_name, _integer_type, _integer_type); //Арифметические операции. - _int_add = make_binary_operator(compiler_string_consts.plus_name, _integer_type, SemanticTree.basic_function_type.iadd); - _int_sub = make_binary_operator(compiler_string_consts.minus_name, _integer_type, SemanticTree.basic_function_type.isub); - _int_mul=make_binary_operator(compiler_string_consts.mul_name, _integer_type, SemanticTree.basic_function_type.imul); - _int_idiv=make_binary_operator(compiler_string_consts.idiv_name, _integer_type, SemanticTree.basic_function_type.idiv); - _int_mod=make_binary_operator(compiler_string_consts.mod_name, _integer_type, SemanticTree.basic_function_type.imod); + _int_add = make_binary_operator(StringConstants.plus_name, _integer_type, SemanticTree.basic_function_type.iadd); + _int_sub = make_binary_operator(StringConstants.minus_name, _integer_type, SemanticTree.basic_function_type.isub); + _int_mul=make_binary_operator(StringConstants.mul_name, _integer_type, SemanticTree.basic_function_type.imul); + _int_idiv=make_binary_operator(StringConstants.idiv_name, _integer_type, SemanticTree.basic_function_type.idiv); + _int_mod=make_binary_operator(StringConstants.mod_name, _integer_type, SemanticTree.basic_function_type.imod); //Операция / для integer. - _int_div = make_common_binary_operation(compiler_string_consts.div_name, _integer_type, _double_type, _double_type, + _int_div = make_common_binary_operation(StringConstants.div_name, _integer_type, _double_type, _double_type, SemanticTree.basic_function_type.ddiv, _double_type); - //_int_div = make_common_binary_operation(compiler_string_consts.div_name, _integer_type, _integer_type, _integer_type, + //_int_div = make_common_binary_operation(StringConstants.div_name, _integer_type, _integer_type, _integer_type, // SemanticTree.basic_function_type.ddiv, _real_type); //Опрерации сравнения. - _int_gr=make_binary_operator(compiler_string_consts.gr_name, _integer_type, SemanticTree.basic_function_type.igr, _bool_type); - _int_greq=make_binary_operator(compiler_string_consts.greq_name, _integer_type, SemanticTree.basic_function_type.igreq, _bool_type); - _int_sm=make_binary_operator(compiler_string_consts.sm_name, _integer_type, SemanticTree.basic_function_type.ism, _bool_type); - _int_smeq=make_binary_operator(compiler_string_consts.smeq_name, _integer_type, SemanticTree.basic_function_type.ismeq, _bool_type); - _int_eq=make_binary_operator(compiler_string_consts.eq_name, _integer_type, SemanticTree.basic_function_type.ieq, _bool_type); - _int_noteq=make_binary_operator(compiler_string_consts.noteq_name, _integer_type, SemanticTree.basic_function_type.inoteq, _bool_type); + _int_gr=make_binary_operator(StringConstants.gr_name, _integer_type, SemanticTree.basic_function_type.igr, _bool_type); + _int_greq=make_binary_operator(StringConstants.greq_name, _integer_type, SemanticTree.basic_function_type.igreq, _bool_type); + _int_sm=make_binary_operator(StringConstants.sm_name, _integer_type, SemanticTree.basic_function_type.ism, _bool_type); + _int_smeq=make_binary_operator(StringConstants.smeq_name, _integer_type, SemanticTree.basic_function_type.ismeq, _bool_type); + _int_eq=make_binary_operator(StringConstants.eq_name, _integer_type, SemanticTree.basic_function_type.ieq, _bool_type); + _int_noteq=make_binary_operator(StringConstants.noteq_name, _integer_type, SemanticTree.basic_function_type.inoteq, _bool_type); //Логические опреции. - _int_and=make_binary_operator(compiler_string_consts.and_name, _integer_type, SemanticTree.basic_function_type.iand); - _int_or=make_binary_operator(compiler_string_consts.or_name, _integer_type, SemanticTree.basic_function_type.ior); - _int_xor=make_binary_operator(compiler_string_consts.xor_name, _integer_type, SemanticTree.basic_function_type.ixor); - _int_shl=make_binary_operator(compiler_string_consts.shl_name, _integer_type, SemanticTree.basic_function_type.ishl); - _int_shr=make_binary_operator(compiler_string_consts.shr_name, _integer_type, SemanticTree.basic_function_type.ishr); + _int_and=make_binary_operator(StringConstants.and_name, _integer_type, SemanticTree.basic_function_type.iand); + _int_or=make_binary_operator(StringConstants.or_name, _integer_type, SemanticTree.basic_function_type.ior); + _int_xor=make_binary_operator(StringConstants.xor_name, _integer_type, SemanticTree.basic_function_type.ixor); + _int_shl=make_binary_operator(StringConstants.shl_name, _integer_type, SemanticTree.basic_function_type.ishl); + _int_shr=make_binary_operator(StringConstants.shr_name, _integer_type, SemanticTree.basic_function_type.ishr); //byte type. @@ -1310,59 +1310,59 @@ namespace PascalABCCompiler.SystemLibrary _byte_to_float = make_type_conversion(_byte_type, _float_type, type_compare.less_type, SemanticTree.basic_function_type.btof); _byte_to_double = make_type_conversion(_byte_type, _double_type, type_compare.less_type, SemanticTree.basic_function_type.btod); //Унарные операции. - _byte_unmin = make_unary_operator(compiler_string_consts.minus_name, _byte_type, SemanticTree.basic_function_type.bunmin, _integer_type); - _byte_not = make_unary_operator(compiler_string_consts.not_name, _byte_type, SemanticTree.basic_function_type.bnot); - make_unary_empty_operator(compiler_string_consts.plus_name, _byte_type, _byte_type); + _byte_unmin = make_unary_operator(StringConstants.minus_name, _byte_type, SemanticTree.basic_function_type.bunmin, _integer_type); + _byte_not = make_unary_operator(StringConstants.not_name, _byte_type, SemanticTree.basic_function_type.bnot); + make_unary_empty_operator(StringConstants.plus_name, _byte_type, _byte_type); //Опрерации сравнения. /* - _byte_gr = make_binary_operator(compiler_string_consts.gr_name, _byte_type, SemanticTree.basic_function_type.bgr, _bool_type); - _byte_greq = make_binary_operator(compiler_string_consts.greq_name, _byte_type, SemanticTree.basic_function_type.bgreq, _bool_type); - _byte_sm = make_binary_operator(compiler_string_consts.sm_name, _byte_type, SemanticTree.basic_function_type.bsm, _bool_type); - _byte_smeq = make_binary_operator(compiler_string_consts.smeq_name, _byte_type, SemanticTree.basic_function_type.bsmeq, _bool_type); - _byte_eq = make_binary_operator(compiler_string_consts.eq_name, _byte_type, SemanticTree.basic_function_type.beq, _bool_type); - _byte_noteq = make_binary_operator(compiler_string_consts.noteq_name, _byte_type, SemanticTree.basic_function_type.bnoteq, _bool_type); + _byte_gr = make_binary_operator(StringConstants.gr_name, _byte_type, SemanticTree.basic_function_type.bgr, _bool_type); + _byte_greq = make_binary_operator(StringConstants.greq_name, _byte_type, SemanticTree.basic_function_type.bgreq, _bool_type); + _byte_sm = make_binary_operator(StringConstants.sm_name, _byte_type, SemanticTree.basic_function_type.bsm, _bool_type); + _byte_smeq = make_binary_operator(StringConstants.smeq_name, _byte_type, SemanticTree.basic_function_type.bsmeq, _bool_type); + _byte_eq = make_binary_operator(StringConstants.eq_name, _byte_type, SemanticTree.basic_function_type.beq, _bool_type); + _byte_noteq = make_binary_operator(StringConstants.noteq_name, _byte_type, SemanticTree.basic_function_type.bnoteq, _bool_type); */ - add_function_to_type(compiler_string_consts.not_name, _byte_type, _int_unmin); + add_function_to_type(StringConstants.not_name, _byte_type, _int_unmin); - add_function_to_type(compiler_string_consts.gr_name, _byte_type, _int_gr); - add_function_to_type(compiler_string_consts.greq_name, _byte_type, _int_greq); - add_function_to_type(compiler_string_consts.sm_name, _byte_type, _int_sm); - add_function_to_type(compiler_string_consts.smeq_name, _byte_type, _int_smeq); - add_function_to_type(compiler_string_consts.eq_name, _byte_type, _int_eq); - add_function_to_type(compiler_string_consts.noteq_name, _byte_type, _int_noteq); + add_function_to_type(StringConstants.gr_name, _byte_type, _int_gr); + add_function_to_type(StringConstants.greq_name, _byte_type, _int_greq); + add_function_to_type(StringConstants.sm_name, _byte_type, _int_sm); + add_function_to_type(StringConstants.smeq_name, _byte_type, _int_smeq); + add_function_to_type(StringConstants.eq_name, _byte_type, _int_eq); + add_function_to_type(StringConstants.noteq_name, _byte_type, _int_noteq); - add_function_to_type(compiler_string_consts.plus_name, _byte_type, _int_add); - add_function_to_type(compiler_string_consts.minus_name, _byte_type, _int_sub); - add_function_to_type(compiler_string_consts.mul_name, _byte_type, _int_mul); - add_function_to_type(compiler_string_consts.div_name, _byte_type, _int_div); - add_function_to_type(compiler_string_consts.idiv_name, _byte_type, _int_idiv); - add_function_to_type(compiler_string_consts.mod_name, _byte_type, _int_mod); + add_function_to_type(StringConstants.plus_name, _byte_type, _int_add); + add_function_to_type(StringConstants.minus_name, _byte_type, _int_sub); + add_function_to_type(StringConstants.mul_name, _byte_type, _int_mul); + add_function_to_type(StringConstants.div_name, _byte_type, _int_div); + add_function_to_type(StringConstants.idiv_name, _byte_type, _int_idiv); + add_function_to_type(StringConstants.mod_name, _byte_type, _int_mod); - /*add_funtion_to_type(compiler_string_consts.and_name, _byte_type, _int_and); - add_funtion_to_type(compiler_string_consts.or_name, _byte_type, _int_or); - add_funtion_to_type(compiler_string_consts.xor_name, _byte_type, _int_xor);*/ + /*add_funtion_to_type(StringConstants.and_name, _byte_type, _int_and); + add_funtion_to_type(StringConstants.or_name, _byte_type, _int_or); + add_funtion_to_type(StringConstants.xor_name, _byte_type, _int_xor);*/ //Арифметические операции. - //_byte_add = make_common_binary_operation(compiler_string_consts.plus_name, _byte_type, _byte_type,_byte_type, SemanticTree.basic_function_type.badd, _integer_type); + //_byte_add = make_common_binary_operation(StringConstants.plus_name, _byte_type, _byte_type,_byte_type, SemanticTree.basic_function_type.badd, _integer_type); /* - _byte_sub = make_common_binary_operation(compiler_string_consts.minus_name, _byte_type, _byte_type, _byte_type, SemanticTree.basic_function_type.bsub, _integer_type); - _byte_mul = make_common_binary_operation(compiler_string_consts.mul_name, _byte_type, _byte_type, _byte_type, SemanticTree.basic_function_type.bmul, _integer_type); - _byte_idiv = make_common_binary_operation(compiler_string_consts.idiv_name, _byte_type, _byte_type, _byte_type, SemanticTree.basic_function_type.bdiv, _integer_type); - _byte_mod = make_common_binary_operation(compiler_string_consts.mod_name, _byte_type, _byte_type, _byte_type, SemanticTree.basic_function_type.bmod, _integer_type); + _byte_sub = make_common_binary_operation(StringConstants.minus_name, _byte_type, _byte_type, _byte_type, SemanticTree.basic_function_type.bsub, _integer_type); + _byte_mul = make_common_binary_operation(StringConstants.mul_name, _byte_type, _byte_type, _byte_type, SemanticTree.basic_function_type.bmul, _integer_type); + _byte_idiv = make_common_binary_operation(StringConstants.idiv_name, _byte_type, _byte_type, _byte_type, SemanticTree.basic_function_type.bdiv, _integer_type); + _byte_mod = make_common_binary_operation(StringConstants.mod_name, _byte_type, _byte_type, _byte_type, SemanticTree.basic_function_type.bmod, _integer_type); */ //Операция / для byte. - _byte_div = make_common_binary_operation(compiler_string_consts.div_name, _byte_type, _double_type, _double_type, + _byte_div = make_common_binary_operation(StringConstants.div_name, _byte_type, _double_type, _double_type, SemanticTree.basic_function_type.ddiv, _double_type); //Логические опреции. - _byte_and = make_common_binary_operation(compiler_string_consts.and_name, _byte_type, _byte_type, _byte_type, SemanticTree.basic_function_type.band, _byte_type); - _byte_or = make_common_binary_operation(compiler_string_consts.or_name, _byte_type, _byte_type, _byte_type, SemanticTree.basic_function_type.bor, _byte_type); - _byte_xor = make_common_binary_operation(compiler_string_consts.xor_name, _byte_type, _byte_type, _byte_type, SemanticTree.basic_function_type.bxor, _byte_type); + _byte_and = make_common_binary_operation(StringConstants.and_name, _byte_type, _byte_type, _byte_type, SemanticTree.basic_function_type.band, _byte_type); + _byte_or = make_common_binary_operation(StringConstants.or_name, _byte_type, _byte_type, _byte_type, SemanticTree.basic_function_type.bor, _byte_type); + _byte_xor = make_common_binary_operation(StringConstants.xor_name, _byte_type, _byte_type, _byte_type, SemanticTree.basic_function_type.bxor, _byte_type); - add_function_to_type(compiler_string_consts.shl_name, _byte_type, _int_shl); - add_function_to_type(compiler_string_consts.shr_name, _byte_type, _int_shr); - //_byte_shl = make_binary_operator(compiler_string_consts.shl_name, _byte_type, SemanticTree.basic_function_type.bshl); - //_byte_shr = make_binary_operator(compiler_string_consts.shr_name, _byte_type, SemanticTree.basic_function_type.bshr); + add_function_to_type(StringConstants.shl_name, _byte_type, _int_shl); + add_function_to_type(StringConstants.shr_name, _byte_type, _int_shr); + //_byte_shl = make_binary_operator(StringConstants.shl_name, _byte_type, SemanticTree.basic_function_type.bshl); + //_byte_shr = make_binary_operator(StringConstants.shr_name, _byte_type, SemanticTree.basic_function_type.bshr); //sbyte type. //Assign. @@ -1379,37 +1379,37 @@ namespace PascalABCCompiler.SystemLibrary _sbyte_to_float = make_type_conversion(_sbyte_type, _float_type, type_compare.less_type, SemanticTree.basic_function_type.sbtof); _sbyte_to_double = make_type_conversion(_sbyte_type, _double_type, type_compare.less_type, SemanticTree.basic_function_type.sbtod); //Унарные операции. - _sbyte_unmin = make_unary_operator(compiler_string_consts.minus_name, _sbyte_type, SemanticTree.basic_function_type.sbunmin, _integer_type); - _sbyte_not = make_unary_operator(compiler_string_consts.not_name, _sbyte_type, SemanticTree.basic_function_type.sbnot); - make_unary_empty_operator(compiler_string_consts.plus_name, _sbyte_type, _sbyte_type); + _sbyte_unmin = make_unary_operator(StringConstants.minus_name, _sbyte_type, SemanticTree.basic_function_type.sbunmin, _integer_type); + _sbyte_not = make_unary_operator(StringConstants.not_name, _sbyte_type, SemanticTree.basic_function_type.sbnot); + make_unary_empty_operator(StringConstants.plus_name, _sbyte_type, _sbyte_type); - add_function_to_type(compiler_string_consts.not_name, _sbyte_type, _int_unmin); + add_function_to_type(StringConstants.not_name, _sbyte_type, _int_unmin); - add_function_to_type(compiler_string_consts.gr_name, _sbyte_type, _int_gr); - add_function_to_type(compiler_string_consts.greq_name, _sbyte_type, _int_greq); - add_function_to_type(compiler_string_consts.sm_name, _sbyte_type, _int_sm); - add_function_to_type(compiler_string_consts.smeq_name, _sbyte_type, _int_smeq); - add_function_to_type(compiler_string_consts.eq_name, _sbyte_type, _int_eq); - add_function_to_type(compiler_string_consts.noteq_name, _sbyte_type, _int_noteq); + add_function_to_type(StringConstants.gr_name, _sbyte_type, _int_gr); + add_function_to_type(StringConstants.greq_name, _sbyte_type, _int_greq); + add_function_to_type(StringConstants.sm_name, _sbyte_type, _int_sm); + add_function_to_type(StringConstants.smeq_name, _sbyte_type, _int_smeq); + add_function_to_type(StringConstants.eq_name, _sbyte_type, _int_eq); + add_function_to_type(StringConstants.noteq_name, _sbyte_type, _int_noteq); - add_function_to_type(compiler_string_consts.plus_name, _sbyte_type, _int_add); - add_function_to_type(compiler_string_consts.minus_name, _sbyte_type, _int_sub); - add_function_to_type(compiler_string_consts.mul_name, _sbyte_type, _int_mul); - add_function_to_type(compiler_string_consts.div_name, _sbyte_type, _int_div); - add_function_to_type(compiler_string_consts.idiv_name, _sbyte_type, _int_idiv); - add_function_to_type(compiler_string_consts.mod_name, _sbyte_type, _int_mod); + add_function_to_type(StringConstants.plus_name, _sbyte_type, _int_add); + add_function_to_type(StringConstants.minus_name, _sbyte_type, _int_sub); + add_function_to_type(StringConstants.mul_name, _sbyte_type, _int_mul); + add_function_to_type(StringConstants.div_name, _sbyte_type, _int_div); + add_function_to_type(StringConstants.idiv_name, _sbyte_type, _int_idiv); + add_function_to_type(StringConstants.mod_name, _sbyte_type, _int_mod); //Операция / для byte. - _sbyte_div = make_common_binary_operation(compiler_string_consts.div_name, _sbyte_type, _double_type, _double_type, + _sbyte_div = make_common_binary_operation(StringConstants.div_name, _sbyte_type, _double_type, _double_type, SemanticTree.basic_function_type.ddiv, _double_type); //Логические опреции. - _sbyte_and = make_common_binary_operation(compiler_string_consts.and_name, _sbyte_type, _sbyte_type, _sbyte_type, SemanticTree.basic_function_type.sband, _sbyte_type); - _sbyte_or = make_common_binary_operation(compiler_string_consts.or_name, _sbyte_type, _sbyte_type, _sbyte_type, SemanticTree.basic_function_type.sbor, _sbyte_type); - _sbyte_xor = make_common_binary_operation(compiler_string_consts.xor_name, _sbyte_type,_sbyte_type, _sbyte_type, SemanticTree.basic_function_type.sbxor, _sbyte_type); + _sbyte_and = make_common_binary_operation(StringConstants.and_name, _sbyte_type, _sbyte_type, _sbyte_type, SemanticTree.basic_function_type.sband, _sbyte_type); + _sbyte_or = make_common_binary_operation(StringConstants.or_name, _sbyte_type, _sbyte_type, _sbyte_type, SemanticTree.basic_function_type.sbor, _sbyte_type); + _sbyte_xor = make_common_binary_operation(StringConstants.xor_name, _sbyte_type,_sbyte_type, _sbyte_type, SemanticTree.basic_function_type.sbxor, _sbyte_type); - add_function_to_type(compiler_string_consts.shl_name, _sbyte_type, _int_shl); - add_function_to_type(compiler_string_consts.shr_name, _sbyte_type, _int_shr); + add_function_to_type(StringConstants.shl_name, _sbyte_type, _int_shl); + add_function_to_type(StringConstants.shr_name, _sbyte_type, _int_shr); //short type. //Assign. @@ -1426,41 +1426,41 @@ namespace PascalABCCompiler.SystemLibrary _short_to_float = make_type_conversion(_short_type, _float_type, type_compare.less_type, SemanticTree.basic_function_type.stof); _short_to_double = make_type_conversion(_short_type, _double_type, type_compare.less_type, SemanticTree.basic_function_type.stod); //Унарные операции. - _short_unmin = make_unary_operator(compiler_string_consts.minus_name, _short_type, SemanticTree.basic_function_type.sunmin,_integer_type); - _short_not = make_unary_operator(compiler_string_consts.not_name, _short_type, SemanticTree.basic_function_type.snot); - make_unary_empty_operator(compiler_string_consts.plus_name, _short_type, _short_type); + _short_unmin = make_unary_operator(StringConstants.minus_name, _short_type, SemanticTree.basic_function_type.sunmin,_integer_type); + _short_not = make_unary_operator(StringConstants.not_name, _short_type, SemanticTree.basic_function_type.snot); + make_unary_empty_operator(StringConstants.plus_name, _short_type, _short_type); - add_function_to_type(compiler_string_consts.not_name, _short_type, _int_unmin); + add_function_to_type(StringConstants.not_name, _short_type, _int_unmin); - add_function_to_type(compiler_string_consts.gr_name, _short_type, _int_gr); - add_function_to_type(compiler_string_consts.greq_name, _short_type, _int_greq); - add_function_to_type(compiler_string_consts.sm_name, _short_type, _int_sm); - add_function_to_type(compiler_string_consts.smeq_name, _short_type, _int_smeq); - add_function_to_type(compiler_string_consts.eq_name, _short_type, _int_eq); - add_function_to_type(compiler_string_consts.noteq_name, _short_type, _int_noteq); + add_function_to_type(StringConstants.gr_name, _short_type, _int_gr); + add_function_to_type(StringConstants.greq_name, _short_type, _int_greq); + add_function_to_type(StringConstants.sm_name, _short_type, _int_sm); + add_function_to_type(StringConstants.smeq_name, _short_type, _int_smeq); + add_function_to_type(StringConstants.eq_name, _short_type, _int_eq); + add_function_to_type(StringConstants.noteq_name, _short_type, _int_noteq); - add_function_to_type(compiler_string_consts.plus_name, _short_type, _int_add); - add_function_to_type(compiler_string_consts.minus_name, _short_type, _int_sub); - add_function_to_type(compiler_string_consts.mul_name, _short_type, _int_mul); - add_function_to_type(compiler_string_consts.div_name, _short_type, _int_div); - add_function_to_type(compiler_string_consts.idiv_name, _short_type, _int_idiv); - add_function_to_type(compiler_string_consts.mod_name, _short_type, _int_mod); + add_function_to_type(StringConstants.plus_name, _short_type, _int_add); + add_function_to_type(StringConstants.minus_name, _short_type, _int_sub); + add_function_to_type(StringConstants.mul_name, _short_type, _int_mul); + add_function_to_type(StringConstants.div_name, _short_type, _int_div); + add_function_to_type(StringConstants.idiv_name, _short_type, _int_idiv); + add_function_to_type(StringConstants.mod_name, _short_type, _int_mod); - /*add_funtion_to_type(compiler_string_consts.and_name, _short_type, _int_and); - add_funtion_to_type(compiler_string_consts.or_name, _short_type, _int_or); - add_funtion_to_type(compiler_string_consts.xor_name, _short_type, _int_xor);*/ + /*add_funtion_to_type(StringConstants.and_name, _short_type, _int_and); + add_funtion_to_type(StringConstants.or_name, _short_type, _int_or); + add_funtion_to_type(StringConstants.xor_name, _short_type, _int_xor);*/ //Операция / для byte. - _short_div = make_common_binary_operation(compiler_string_consts.div_name, _short_type, _double_type, _double_type, + _short_div = make_common_binary_operation(StringConstants.div_name, _short_type, _double_type, _double_type, SemanticTree.basic_function_type.ddiv, _double_type); //Логические опреции. - _short_and = make_common_binary_operation(compiler_string_consts.and_name, _short_type, _short_type, _short_type, SemanticTree.basic_function_type.sand, _short_type); - _short_or = make_common_binary_operation(compiler_string_consts.or_name, _short_type, _short_type, _short_type, SemanticTree.basic_function_type.sor, _short_type); - _short_xor = make_common_binary_operation(compiler_string_consts.xor_name, _short_type, _short_type, _short_type, SemanticTree.basic_function_type.sxor, _short_type); + _short_and = make_common_binary_operation(StringConstants.and_name, _short_type, _short_type, _short_type, SemanticTree.basic_function_type.sand, _short_type); + _short_or = make_common_binary_operation(StringConstants.or_name, _short_type, _short_type, _short_type, SemanticTree.basic_function_type.sor, _short_type); + _short_xor = make_common_binary_operation(StringConstants.xor_name, _short_type, _short_type, _short_type, SemanticTree.basic_function_type.sxor, _short_type); - add_function_to_type(compiler_string_consts.shl_name, _short_type, _int_shl); - add_function_to_type(compiler_string_consts.shr_name, _short_type, _int_shr); + add_function_to_type(StringConstants.shl_name, _short_type, _int_shl); + add_function_to_type(StringConstants.shr_name, _short_type, _int_shr); //ushort type. //Assign. @@ -1477,58 +1477,58 @@ namespace PascalABCCompiler.SystemLibrary _ushort_to_float = make_type_conversion(_ushort_type, _float_type, type_compare.less_type, SemanticTree.basic_function_type.ustof); _ushort_to_double = make_type_conversion(_ushort_type, _double_type, type_compare.less_type, SemanticTree.basic_function_type.ustod); //Унарные операции. - _ushort_unmin = make_unary_operator(compiler_string_consts.minus_name, _ushort_type, SemanticTree.basic_function_type.usunmin, _integer_type); - _ushort_not = make_unary_operator(compiler_string_consts.not_name, _ushort_type, SemanticTree.basic_function_type.usnot); - make_unary_empty_operator(compiler_string_consts.plus_name, _ushort_type, _ushort_type); + _ushort_unmin = make_unary_operator(StringConstants.minus_name, _ushort_type, SemanticTree.basic_function_type.usunmin, _integer_type); + _ushort_not = make_unary_operator(StringConstants.not_name, _ushort_type, SemanticTree.basic_function_type.usnot); + make_unary_empty_operator(StringConstants.plus_name, _ushort_type, _ushort_type); - add_function_to_type(compiler_string_consts.not_name, _ushort_type, _int_unmin); + add_function_to_type(StringConstants.not_name, _ushort_type, _int_unmin); - add_function_to_type(compiler_string_consts.gr_name, _ushort_type, _int_gr); - add_function_to_type(compiler_string_consts.greq_name, _ushort_type, _int_greq); - add_function_to_type(compiler_string_consts.sm_name, _ushort_type, _int_sm); - add_function_to_type(compiler_string_consts.smeq_name, _ushort_type, _int_smeq); - add_function_to_type(compiler_string_consts.eq_name, _ushort_type, _int_eq); - add_function_to_type(compiler_string_consts.noteq_name, _ushort_type, _int_noteq); + add_function_to_type(StringConstants.gr_name, _ushort_type, _int_gr); + add_function_to_type(StringConstants.greq_name, _ushort_type, _int_greq); + add_function_to_type(StringConstants.sm_name, _ushort_type, _int_sm); + add_function_to_type(StringConstants.smeq_name, _ushort_type, _int_smeq); + add_function_to_type(StringConstants.eq_name, _ushort_type, _int_eq); + add_function_to_type(StringConstants.noteq_name, _ushort_type, _int_noteq); - add_function_to_type(compiler_string_consts.plus_name, _ushort_type, _int_add); - add_function_to_type(compiler_string_consts.minus_name, _ushort_type, _int_sub); - add_function_to_type(compiler_string_consts.mul_name, _ushort_type, _int_mul); - add_function_to_type(compiler_string_consts.div_name, _ushort_type, _int_div); - add_function_to_type(compiler_string_consts.idiv_name, _ushort_type, _int_idiv); - add_function_to_type(compiler_string_consts.mod_name, _ushort_type, _int_mod); + add_function_to_type(StringConstants.plus_name, _ushort_type, _int_add); + add_function_to_type(StringConstants.minus_name, _ushort_type, _int_sub); + add_function_to_type(StringConstants.mul_name, _ushort_type, _int_mul); + add_function_to_type(StringConstants.div_name, _ushort_type, _int_div); + add_function_to_type(StringConstants.idiv_name, _ushort_type, _int_idiv); + add_function_to_type(StringConstants.mod_name, _ushort_type, _int_mod); - /*add_funtion_to_type(compiler_string_consts.and_name, _ushort_type, _int_and); - add_funtion_to_type(compiler_string_consts.or_name, _ushort_type, _int_or); - add_funtion_to_type(compiler_string_consts.xor_name, _ushort_type, _int_xor);*/ + /*add_funtion_to_type(StringConstants.and_name, _ushort_type, _int_and); + add_funtion_to_type(StringConstants.or_name, _ushort_type, _int_or); + add_funtion_to_type(StringConstants.xor_name, _ushort_type, _int_xor);*/ //Опрерации сравнения. /* - _ushort_gr = make_binary_operator(compiler_string_consts.gr_name, _ushort_type, SemanticTree.basic_function_type.usgr, _bool_type); - _ushort_greq = make_binary_operator(compiler_string_consts.greq_name, _ushort_type, SemanticTree.basic_function_type.usgreq, _bool_type); - _ushort_sm = make_binary_operator(compiler_string_consts.sm_name, _ushort_type, SemanticTree.basic_function_type.ussm, _bool_type); - _ushort_smeq = make_binary_operator(compiler_string_consts.smeq_name, _ushort_type, SemanticTree.basic_function_type.ussmeq, _bool_type); - _ushort_eq = make_binary_operator(compiler_string_consts.eq_name, _ushort_type, SemanticTree.basic_function_type.useq, _bool_type); - _ushort_noteq = make_binary_operator(compiler_string_consts.noteq_name, _ushort_type, SemanticTree.basic_function_type.usnoteq, _bool_type); + _ushort_gr = make_binary_operator(StringConstants.gr_name, _ushort_type, SemanticTree.basic_function_type.usgr, _bool_type); + _ushort_greq = make_binary_operator(StringConstants.greq_name, _ushort_type, SemanticTree.basic_function_type.usgreq, _bool_type); + _ushort_sm = make_binary_operator(StringConstants.sm_name, _ushort_type, SemanticTree.basic_function_type.ussm, _bool_type); + _ushort_smeq = make_binary_operator(StringConstants.smeq_name, _ushort_type, SemanticTree.basic_function_type.ussmeq, _bool_type); + _ushort_eq = make_binary_operator(StringConstants.eq_name, _ushort_type, SemanticTree.basic_function_type.useq, _bool_type); + _ushort_noteq = make_binary_operator(StringConstants.noteq_name, _ushort_type, SemanticTree.basic_function_type.usnoteq, _bool_type); */ //Арифметические операции. /* - _ushort_add = make_common_binary_operation(compiler_string_consts.plus_name, _ushort_type, _ushort_type, _ushort_type, SemanticTree.basic_function_type.usadd, _integer_type); - _ushort_sub = make_common_binary_operation(compiler_string_consts.minus_name, _ushort_type, _ushort_type, _ushort_type, SemanticTree.basic_function_type.ussub, _integer_type); - _ushort_mul = make_common_binary_operation(compiler_string_consts.mul_name, _ushort_type, _ushort_type, _ushort_type, SemanticTree.basic_function_type.usmul, _integer_type); - _ushort_idiv = make_common_binary_operation(compiler_string_consts.idiv_name, _ushort_type, _ushort_type, _ushort_type, SemanticTree.basic_function_type.usdiv, _integer_type); - _ushort_mod = make_common_binary_operation(compiler_string_consts.mod_name, _ushort_type, _ushort_type, _ushort_type, SemanticTree.basic_function_type.usmod, _integer_type); + _ushort_add = make_common_binary_operation(StringConstants.plus_name, _ushort_type, _ushort_type, _ushort_type, SemanticTree.basic_function_type.usadd, _integer_type); + _ushort_sub = make_common_binary_operation(StringConstants.minus_name, _ushort_type, _ushort_type, _ushort_type, SemanticTree.basic_function_type.ussub, _integer_type); + _ushort_mul = make_common_binary_operation(StringConstants.mul_name, _ushort_type, _ushort_type, _ushort_type, SemanticTree.basic_function_type.usmul, _integer_type); + _ushort_idiv = make_common_binary_operation(StringConstants.idiv_name, _ushort_type, _ushort_type, _ushort_type, SemanticTree.basic_function_type.usdiv, _integer_type); + _ushort_mod = make_common_binary_operation(StringConstants.mod_name, _ushort_type, _ushort_type, _ushort_type, SemanticTree.basic_function_type.usmod, _integer_type); */ //Операция / для byte. - _ushort_div = make_common_binary_operation(compiler_string_consts.div_name, _ushort_type, _double_type, _double_type, + _ushort_div = make_common_binary_operation(StringConstants.div_name, _ushort_type, _double_type, _double_type, SemanticTree.basic_function_type.ddiv, _double_type); //Логические опреции. - _ushort_and = make_common_binary_operation(compiler_string_consts.and_name, _ushort_type, _ushort_type, _ushort_type, SemanticTree.basic_function_type.usand, _ushort_type); - _ushort_or = make_common_binary_operation(compiler_string_consts.or_name, _ushort_type, _ushort_type, _ushort_type, SemanticTree.basic_function_type.usor, _ushort_type); - _ushort_xor = make_common_binary_operation(compiler_string_consts.xor_name, _ushort_type, _ushort_type, _ushort_type, SemanticTree.basic_function_type.usxor, _ushort_type); + _ushort_and = make_common_binary_operation(StringConstants.and_name, _ushort_type, _ushort_type, _ushort_type, SemanticTree.basic_function_type.usand, _ushort_type); + _ushort_or = make_common_binary_operation(StringConstants.or_name, _ushort_type, _ushort_type, _ushort_type, SemanticTree.basic_function_type.usor, _ushort_type); + _ushort_xor = make_common_binary_operation(StringConstants.xor_name, _ushort_type, _ushort_type, _ushort_type, SemanticTree.basic_function_type.usxor, _ushort_type); - add_function_to_type(compiler_string_consts.shl_name, _ushort_type, _int_shl); - add_function_to_type(compiler_string_consts.shr_name, _ushort_type, _int_shr); + add_function_to_type(StringConstants.shl_name, _ushort_type, _int_shl); + add_function_to_type(StringConstants.shr_name, _ushort_type, _int_shr); @@ -1547,50 +1547,50 @@ namespace PascalABCCompiler.SystemLibrary _uint_to_float = make_type_conversion(_uint_type, _float_type, type_compare.less_type, SemanticTree.basic_function_type.uitof); _uint_to_double = make_type_conversion(_uint_type, _double_type, type_compare.less_type, SemanticTree.basic_function_type.uitod); //Унарные операции. - _uint_unmin = make_unary_operator(compiler_string_consts.minus_name, _uint_type, SemanticTree.basic_function_type.uiunmin, _int64_type); - _uint_not = make_unary_operator(compiler_string_consts.not_name, _uint_type, SemanticTree.basic_function_type.uinot); - make_unary_empty_operator(compiler_string_consts.plus_name, _uint_type, _uint_type); + _uint_unmin = make_unary_operator(StringConstants.minus_name, _uint_type, SemanticTree.basic_function_type.uiunmin, _int64_type); + _uint_not = make_unary_operator(StringConstants.not_name, _uint_type, SemanticTree.basic_function_type.uinot); + make_unary_empty_operator(StringConstants.plus_name, _uint_type, _uint_type); //Опрерации сравнения. - _uint_gr = make_binary_operator(compiler_string_consts.gr_name, _uint_type, SemanticTree.basic_function_type.uigr, _bool_type); - _uint_greq = make_binary_operator(compiler_string_consts.greq_name, _uint_type, SemanticTree.basic_function_type.uigreq, _bool_type); - _uint_sm = make_binary_operator(compiler_string_consts.sm_name, _uint_type, SemanticTree.basic_function_type.uism, _bool_type); - _uint_smeq = make_binary_operator(compiler_string_consts.smeq_name, _uint_type, SemanticTree.basic_function_type.uismeq, _bool_type); - _uint_eq = make_binary_operator(compiler_string_consts.eq_name, _uint_type, SemanticTree.basic_function_type.uieq, _bool_type); - _uint_noteq = make_binary_operator(compiler_string_consts.noteq_name, _uint_type, SemanticTree.basic_function_type.uinoteq, _bool_type); + _uint_gr = make_binary_operator(StringConstants.gr_name, _uint_type, SemanticTree.basic_function_type.uigr, _bool_type); + _uint_greq = make_binary_operator(StringConstants.greq_name, _uint_type, SemanticTree.basic_function_type.uigreq, _bool_type); + _uint_sm = make_binary_operator(StringConstants.sm_name, _uint_type, SemanticTree.basic_function_type.uism, _bool_type); + _uint_smeq = make_binary_operator(StringConstants.smeq_name, _uint_type, SemanticTree.basic_function_type.uismeq, _bool_type); + _uint_eq = make_binary_operator(StringConstants.eq_name, _uint_type, SemanticTree.basic_function_type.uieq, _bool_type); + _uint_noteq = make_binary_operator(StringConstants.noteq_name, _uint_type, SemanticTree.basic_function_type.uinoteq, _bool_type); //Арифметические операции. - /*_uint_add = make_common_binary_operation(compiler_string_consts.plus_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uiadd, _uint_type); - _uint_sub = make_common_binary_operation(compiler_string_consts.minus_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uisub, _uint_type); - _uint_mul = make_common_binary_operation(compiler_string_consts.mul_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uimul, _uint_type); - _uint_idiv = make_common_binary_operation(compiler_string_consts.idiv_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uidiv, _uint_type); - _uint_mod = make_common_binary_operation(compiler_string_consts.mod_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uimod, _uint_type); + /*_uint_add = make_common_binary_operation(StringConstants.plus_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uiadd, _uint_type); + _uint_sub = make_common_binary_operation(StringConstants.minus_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uisub, _uint_type); + _uint_mul = make_common_binary_operation(StringConstants.mul_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uimul, _uint_type); + _uint_idiv = make_common_binary_operation(StringConstants.idiv_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uidiv, _uint_type); + _uint_mod = make_common_binary_operation(StringConstants.mod_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uimod, _uint_type); //Операция / для byte. - _uint_div = make_common_binary_operation(compiler_string_consts.div_name, _uint_type, _real_type, _real_type, + _uint_div = make_common_binary_operation(StringConstants.div_name, _uint_type, _real_type, _real_type, SemanticTree.basic_function_type.ddiv, _real_type); //Логические опреции. - _uint_and = make_common_binary_operation(compiler_string_consts.and_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uiand, _uint_type); - _uint_or = make_common_binary_operation(compiler_string_consts.or_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uior, _uint_type); - _uint_xor = make_common_binary_operation(compiler_string_consts.xor_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uixor, _uint_type); - //add_funtion_to_type(compiler_string_consts.shl_name, _uint_type, _int_shl); - //add_funtion_to_type(compiler_string_consts.shr_name, _uint_type, _int_shr); - _uint_shl = make_common_binary_operation(compiler_string_consts.shl_name, _uint_type, _uint_type, _integer_type, SemanticTree.basic_function_type.uishl,_uint_type); - _uint_shr = make_common_binary_operation(compiler_string_consts.shr_name, _uint_type, _uint_type, _integer_type, SemanticTree.basic_function_type.uishr, _uint_type);*/ + _uint_and = make_common_binary_operation(StringConstants.and_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uiand, _uint_type); + _uint_or = make_common_binary_operation(StringConstants.or_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uior, _uint_type); + _uint_xor = make_common_binary_operation(StringConstants.xor_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uixor, _uint_type); + //add_funtion_to_type(StringConstants.shl_name, _uint_type, _int_shl); + //add_funtion_to_type(StringConstants.shr_name, _uint_type, _int_shr); + _uint_shl = make_common_binary_operation(StringConstants.shl_name, _uint_type, _uint_type, _integer_type, SemanticTree.basic_function_type.uishl,_uint_type); + _uint_shr = make_common_binary_operation(StringConstants.shr_name, _uint_type, _uint_type, _integer_type, SemanticTree.basic_function_type.uishr, _uint_type);*/ - _uint_add = make_common_binary_operation(compiler_string_consts.plus_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uiadd, _int64_type); - _uint_sub = make_common_binary_operation(compiler_string_consts.minus_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uisub, _int64_type); - _uint_mul = make_common_binary_operation(compiler_string_consts.mul_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uimul, _int64_type); - _uint_idiv = make_common_binary_operation(compiler_string_consts.idiv_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uidiv, _int64_type); - _uint_mod = make_common_binary_operation(compiler_string_consts.mod_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uimod, _int64_type); + _uint_add = make_common_binary_operation(StringConstants.plus_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uiadd, _int64_type); + _uint_sub = make_common_binary_operation(StringConstants.minus_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uisub, _int64_type); + _uint_mul = make_common_binary_operation(StringConstants.mul_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uimul, _int64_type); + _uint_idiv = make_common_binary_operation(StringConstants.idiv_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uidiv, _int64_type); + _uint_mod = make_common_binary_operation(StringConstants.mod_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uimod, _int64_type); //Операция / для byte. - _uint_div = make_common_binary_operation(compiler_string_consts.div_name, _uint_type, _double_type, _double_type, + _uint_div = make_common_binary_operation(StringConstants.div_name, _uint_type, _double_type, _double_type, SemanticTree.basic_function_type.ddiv, _double_type); //Логические опреции. - _uint_and = make_common_binary_operation(compiler_string_consts.and_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uiand, _uint_type); - _uint_or = make_common_binary_operation(compiler_string_consts.or_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uior, _uint_type); - _uint_xor = make_common_binary_operation(compiler_string_consts.xor_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uixor, _uint_type); - //add_funtion_to_type(compiler_string_consts.shl_name, _uint_type, _int_shl); - //add_funtion_to_type(compiler_string_consts.shr_name, _uint_type, _int_shr); - _uint_shl = make_common_binary_operation(compiler_string_consts.shl_name, _uint_type, _uint_type, _integer_type, SemanticTree.basic_function_type.uishl,_uint_type); - _uint_shr = make_common_binary_operation(compiler_string_consts.shr_name, _uint_type, _uint_type, _integer_type, SemanticTree.basic_function_type.uishr, _uint_type); + _uint_and = make_common_binary_operation(StringConstants.and_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uiand, _uint_type); + _uint_or = make_common_binary_operation(StringConstants.or_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uior, _uint_type); + _uint_xor = make_common_binary_operation(StringConstants.xor_name, _uint_type, _uint_type, _uint_type, SemanticTree.basic_function_type.uixor, _uint_type); + //add_funtion_to_type(StringConstants.shl_name, _uint_type, _int_shl); + //add_funtion_to_type(StringConstants.shr_name, _uint_type, _int_shr); + _uint_shl = make_common_binary_operation(StringConstants.shl_name, _uint_type, _uint_type, _integer_type, SemanticTree.basic_function_type.uishl,_uint_type); + _uint_shr = make_common_binary_operation(StringConstants.shr_name, _uint_type, _uint_type, _integer_type, SemanticTree.basic_function_type.uishr, _uint_type); /*make_function_comparison(_int_add, _uint_add, function_compare.greater); make_function_comparison(_int_sub, _uint_sub, function_compare.greater); @@ -1637,33 +1637,33 @@ namespace PascalABCCompiler.SystemLibrary _long_to_float = make_type_conversion(_int64_type, _float_type, type_compare.less_type, SemanticTree.basic_function_type.ltof); _long_to_double = make_type_conversion(_int64_type, _double_type, type_compare.less_type, SemanticTree.basic_function_type.ltod); //Унарные операции. - _long_unmin = make_unary_operator(compiler_string_consts.minus_name, _int64_type, SemanticTree.basic_function_type.lunmin); - _long_not = make_unary_operator(compiler_string_consts.not_name, _int64_type, SemanticTree.basic_function_type.lnot); - make_unary_empty_operator(compiler_string_consts.plus_name, _int64_type, _int64_type); + _long_unmin = make_unary_operator(StringConstants.minus_name, _int64_type, SemanticTree.basic_function_type.lunmin); + _long_not = make_unary_operator(StringConstants.not_name, _int64_type, SemanticTree.basic_function_type.lnot); + make_unary_empty_operator(StringConstants.plus_name, _int64_type, _int64_type); //Опрерации сравнения. - _long_gr = make_binary_operator(compiler_string_consts.gr_name, _int64_type, SemanticTree.basic_function_type.lgr, _bool_type); - _long_greq = make_binary_operator(compiler_string_consts.greq_name, _int64_type, SemanticTree.basic_function_type.lgreq, _bool_type); - _long_sm = make_binary_operator(compiler_string_consts.sm_name, _int64_type, SemanticTree.basic_function_type.lsm, _bool_type); - _long_smeq = make_binary_operator(compiler_string_consts.smeq_name, _int64_type, SemanticTree.basic_function_type.lsmeq, _bool_type); - _long_eq = make_binary_operator(compiler_string_consts.eq_name, _int64_type, SemanticTree.basic_function_type.leq, _bool_type); - _long_noteq = make_binary_operator(compiler_string_consts.noteq_name, _int64_type, SemanticTree.basic_function_type.lnoteq, _bool_type); + _long_gr = make_binary_operator(StringConstants.gr_name, _int64_type, SemanticTree.basic_function_type.lgr, _bool_type); + _long_greq = make_binary_operator(StringConstants.greq_name, _int64_type, SemanticTree.basic_function_type.lgreq, _bool_type); + _long_sm = make_binary_operator(StringConstants.sm_name, _int64_type, SemanticTree.basic_function_type.lsm, _bool_type); + _long_smeq = make_binary_operator(StringConstants.smeq_name, _int64_type, SemanticTree.basic_function_type.lsmeq, _bool_type); + _long_eq = make_binary_operator(StringConstants.eq_name, _int64_type, SemanticTree.basic_function_type.leq, _bool_type); + _long_noteq = make_binary_operator(StringConstants.noteq_name, _int64_type, SemanticTree.basic_function_type.lnoteq, _bool_type); //Арифметические операции. - _long_add = make_common_binary_operation(compiler_string_consts.plus_name, _int64_type, _int64_type, _int64_type, SemanticTree.basic_function_type.ladd, _int64_type); - _long_sub = make_common_binary_operation(compiler_string_consts.minus_name, _int64_type, _int64_type, _int64_type, SemanticTree.basic_function_type.lsub, _int64_type); - _long_mul = make_common_binary_operation(compiler_string_consts.mul_name, _int64_type, _int64_type, _int64_type, SemanticTree.basic_function_type.lmul, _int64_type); - _long_idiv = make_common_binary_operation(compiler_string_consts.idiv_name, _int64_type, _int64_type, _int64_type, SemanticTree.basic_function_type.ldiv, _int64_type); - _long_mod = make_common_binary_operation(compiler_string_consts.mod_name, _int64_type, _int64_type, _int64_type, SemanticTree.basic_function_type.lmod, _int64_type); + _long_add = make_common_binary_operation(StringConstants.plus_name, _int64_type, _int64_type, _int64_type, SemanticTree.basic_function_type.ladd, _int64_type); + _long_sub = make_common_binary_operation(StringConstants.minus_name, _int64_type, _int64_type, _int64_type, SemanticTree.basic_function_type.lsub, _int64_type); + _long_mul = make_common_binary_operation(StringConstants.mul_name, _int64_type, _int64_type, _int64_type, SemanticTree.basic_function_type.lmul, _int64_type); + _long_idiv = make_common_binary_operation(StringConstants.idiv_name, _int64_type, _int64_type, _int64_type, SemanticTree.basic_function_type.ldiv, _int64_type); + _long_mod = make_common_binary_operation(StringConstants.mod_name, _int64_type, _int64_type, _int64_type, SemanticTree.basic_function_type.lmod, _int64_type); //Операция / для byte. - _long_div = make_common_binary_operation(compiler_string_consts.div_name, _int64_type, _double_type, _double_type, + _long_div = make_common_binary_operation(StringConstants.div_name, _int64_type, _double_type, _double_type, SemanticTree.basic_function_type.ddiv, _double_type); //Логические опреции. - _long_and = make_common_binary_operation(compiler_string_consts.and_name, _int64_type, _int64_type, _int64_type, SemanticTree.basic_function_type.land, _int64_type); - _long_or = make_common_binary_operation(compiler_string_consts.or_name, _int64_type, _int64_type, _int64_type, SemanticTree.basic_function_type.lor, _int64_type); - _long_xor = make_common_binary_operation(compiler_string_consts.xor_name, _int64_type, _int64_type, _int64_type, SemanticTree.basic_function_type.lxor, _int64_type); - //add_funtion_to_type(compiler_string_consts.shl_name, _long_type, _int_shl); - //add_funtion_to_type(compiler_string_consts.shr_name, _long_type, _int_shr); - _long_shl = make_common_binary_operation(compiler_string_consts.shl_name, _int64_type, _int64_type, _integer_type, SemanticTree.basic_function_type.lshl, _int64_type); - _long_shr = make_common_binary_operation(compiler_string_consts.shr_name, _int64_type, _int64_type, _integer_type, SemanticTree.basic_function_type.lshr, _int64_type); + _long_and = make_common_binary_operation(StringConstants.and_name, _int64_type, _int64_type, _int64_type, SemanticTree.basic_function_type.land, _int64_type); + _long_or = make_common_binary_operation(StringConstants.or_name, _int64_type, _int64_type, _int64_type, SemanticTree.basic_function_type.lor, _int64_type); + _long_xor = make_common_binary_operation(StringConstants.xor_name, _int64_type, _int64_type, _int64_type, SemanticTree.basic_function_type.lxor, _int64_type); + //add_funtion_to_type(StringConstants.shl_name, _long_type, _int_shl); + //add_funtion_to_type(StringConstants.shr_name, _long_type, _int_shr); + _long_shl = make_common_binary_operation(StringConstants.shl_name, _int64_type, _int64_type, _integer_type, SemanticTree.basic_function_type.lshl, _int64_type); + _long_shr = make_common_binary_operation(StringConstants.shr_name, _int64_type, _int64_type, _integer_type, SemanticTree.basic_function_type.lshr, _int64_type); make_function_comparison(_long_add, _uint_add, function_compare.greater); make_function_comparison(_long_sub, _uint_sub, function_compare.greater); @@ -1710,33 +1710,33 @@ namespace PascalABCCompiler.SystemLibrary _ulong_to_float = make_type_conversion(_uint64_type, _float_type, type_compare.less_type, SemanticTree.basic_function_type.ultof); _ulong_to_double = make_type_conversion(_uint64_type, _double_type, type_compare.less_type, SemanticTree.basic_function_type.ultod); //Унарные операции. - _ulong_unmin = make_unary_operator(compiler_string_consts.minus_name, _uint64_type, SemanticTree.basic_function_type.ulunmin, _uint64_type); - _ulong_not = make_unary_operator(compiler_string_consts.not_name, _uint64_type, SemanticTree.basic_function_type.ulnot); - make_unary_empty_operator(compiler_string_consts.plus_name, _uint64_type, _uint64_type); + _ulong_unmin = make_unary_operator(StringConstants.minus_name, _uint64_type, SemanticTree.basic_function_type.ulunmin, _uint64_type); + _ulong_not = make_unary_operator(StringConstants.not_name, _uint64_type, SemanticTree.basic_function_type.ulnot); + make_unary_empty_operator(StringConstants.plus_name, _uint64_type, _uint64_type); //Опрерации сравнения. - _ulong_gr = make_binary_operator(compiler_string_consts.gr_name, _uint64_type, SemanticTree.basic_function_type.ulgr, _bool_type); - _ulong_greq = make_binary_operator(compiler_string_consts.greq_name, _uint64_type, SemanticTree.basic_function_type.ulgreq, _bool_type); - _ulong_sm = make_binary_operator(compiler_string_consts.sm_name, _uint64_type, SemanticTree.basic_function_type.ulsm, _bool_type); - _ulong_smeq = make_binary_operator(compiler_string_consts.smeq_name, _uint64_type, SemanticTree.basic_function_type.ulsmeq, _bool_type); - _ulong_eq = make_binary_operator(compiler_string_consts.eq_name, _uint64_type, SemanticTree.basic_function_type.uleq, _bool_type); - _ulong_noteq = make_binary_operator(compiler_string_consts.noteq_name, _uint64_type, SemanticTree.basic_function_type.ulnoteq, _bool_type); + _ulong_gr = make_binary_operator(StringConstants.gr_name, _uint64_type, SemanticTree.basic_function_type.ulgr, _bool_type); + _ulong_greq = make_binary_operator(StringConstants.greq_name, _uint64_type, SemanticTree.basic_function_type.ulgreq, _bool_type); + _ulong_sm = make_binary_operator(StringConstants.sm_name, _uint64_type, SemanticTree.basic_function_type.ulsm, _bool_type); + _ulong_smeq = make_binary_operator(StringConstants.smeq_name, _uint64_type, SemanticTree.basic_function_type.ulsmeq, _bool_type); + _ulong_eq = make_binary_operator(StringConstants.eq_name, _uint64_type, SemanticTree.basic_function_type.uleq, _bool_type); + _ulong_noteq = make_binary_operator(StringConstants.noteq_name, _uint64_type, SemanticTree.basic_function_type.ulnoteq, _bool_type); //Арифметические операции. - _ulong_add = make_common_binary_operation(compiler_string_consts.plus_name, _uint64_type, _uint64_type, _uint64_type, SemanticTree.basic_function_type.uladd, _uint64_type); - _ulong_sub = make_common_binary_operation(compiler_string_consts.minus_name, _uint64_type, _uint64_type, _uint64_type, SemanticTree.basic_function_type.ulsub, _uint64_type); - _ulong_mul = make_common_binary_operation(compiler_string_consts.mul_name, _uint64_type, _uint64_type, _uint64_type, SemanticTree.basic_function_type.ulmul, _uint64_type); - _ulong_idiv = make_common_binary_operation(compiler_string_consts.idiv_name, _uint64_type, _uint64_type, _uint64_type, SemanticTree.basic_function_type.uldiv, _uint64_type); - _ulong_mod = make_common_binary_operation(compiler_string_consts.mod_name, _uint64_type, _uint64_type, _uint64_type, SemanticTree.basic_function_type.ulmod, _uint64_type); + _ulong_add = make_common_binary_operation(StringConstants.plus_name, _uint64_type, _uint64_type, _uint64_type, SemanticTree.basic_function_type.uladd, _uint64_type); + _ulong_sub = make_common_binary_operation(StringConstants.minus_name, _uint64_type, _uint64_type, _uint64_type, SemanticTree.basic_function_type.ulsub, _uint64_type); + _ulong_mul = make_common_binary_operation(StringConstants.mul_name, _uint64_type, _uint64_type, _uint64_type, SemanticTree.basic_function_type.ulmul, _uint64_type); + _ulong_idiv = make_common_binary_operation(StringConstants.idiv_name, _uint64_type, _uint64_type, _uint64_type, SemanticTree.basic_function_type.uldiv, _uint64_type); + _ulong_mod = make_common_binary_operation(StringConstants.mod_name, _uint64_type, _uint64_type, _uint64_type, SemanticTree.basic_function_type.ulmod, _uint64_type); //Операция / для byte. - _ulong_div = make_common_binary_operation(compiler_string_consts.div_name, _uint64_type, _double_type, _double_type, + _ulong_div = make_common_binary_operation(StringConstants.div_name, _uint64_type, _double_type, _double_type, SemanticTree.basic_function_type.ddiv, _double_type); //Логические опреции. - _ulong_and = make_common_binary_operation(compiler_string_consts.and_name, _uint64_type, _uint64_type, _uint64_type, SemanticTree.basic_function_type.uland, _uint64_type); - _ulong_or = make_common_binary_operation(compiler_string_consts.or_name, _uint64_type, _uint64_type, _uint64_type, SemanticTree.basic_function_type.ulor, _uint64_type); - _ulong_xor = make_common_binary_operation(compiler_string_consts.xor_name, _uint64_type, _uint64_type, _uint64_type, SemanticTree.basic_function_type.ulxor, _uint64_type); - //add_funtion_to_type(compiler_string_consts.shl_name, _ulong_type, _int_shl); - //add_funtion_to_type(compiler_string_consts.shr_name, _ulong_type, _int_shr); - _ulong_shl = make_common_binary_operation(compiler_string_consts.shl_name, _uint64_type, _uint64_type, _integer_type, SemanticTree.basic_function_type.ulshl, _uint64_type); - _ulong_shr = make_common_binary_operation(compiler_string_consts.shr_name, _uint64_type, _uint64_type, _integer_type, SemanticTree.basic_function_type.ulshr, _uint64_type); + _ulong_and = make_common_binary_operation(StringConstants.and_name, _uint64_type, _uint64_type, _uint64_type, SemanticTree.basic_function_type.uland, _uint64_type); + _ulong_or = make_common_binary_operation(StringConstants.or_name, _uint64_type, _uint64_type, _uint64_type, SemanticTree.basic_function_type.ulor, _uint64_type); + _ulong_xor = make_common_binary_operation(StringConstants.xor_name, _uint64_type, _uint64_type, _uint64_type, SemanticTree.basic_function_type.ulxor, _uint64_type); + //add_funtion_to_type(StringConstants.shl_name, _ulong_type, _int_shl); + //add_funtion_to_type(StringConstants.shr_name, _ulong_type, _int_shr); + _ulong_shl = make_common_binary_operation(StringConstants.shl_name, _uint64_type, _uint64_type, _integer_type, SemanticTree.basic_function_type.ulshl, _uint64_type); + _ulong_shr = make_common_binary_operation(StringConstants.shr_name, _uint64_type, _uint64_type, _integer_type, SemanticTree.basic_function_type.ulshr, _uint64_type); /*make_function_comparison(_long_add, _ulong_add, function_compare.greater); make_function_comparison(_long_sub, _ulong_sub, function_compare.greater); @@ -1834,43 +1834,43 @@ namespace PascalABCCompiler.SystemLibrary _double_to_int = make_type_conversion(_double_type, _integer_type, type_compare.greater_type, SemanticTree.basic_function_type.dtoi, false); _double_to_float = make_type_conversion(_double_type, _float_type, type_compare.greater_type, SemanticTree.basic_function_type.dtof); //Унарные операции. - _real_unmin = make_unary_operator(compiler_string_consts.minus_name, _double_type, SemanticTree.basic_function_type.dunmin); - //make_empty_operator(compiler_string_consts.plus_name, _real_type); - make_unary_empty_operator(compiler_string_consts.plus_name, _double_type, _double_type); + _real_unmin = make_unary_operator(StringConstants.minus_name, _double_type, SemanticTree.basic_function_type.dunmin); + //make_empty_operator(StringConstants.plus_name, _real_type); + make_unary_empty_operator(StringConstants.plus_name, _double_type, _double_type); //Арифметические операции. - _real_add=make_binary_operator(compiler_string_consts.plus_name, _double_type, SemanticTree.basic_function_type.dadd); - _real_sub=make_binary_operator(compiler_string_consts.minus_name, _double_type, SemanticTree.basic_function_type.dsub); - _real_mul=make_binary_operator(compiler_string_consts.mul_name, _double_type, SemanticTree.basic_function_type.dmul); - _real_div=make_binary_operator(compiler_string_consts.div_name, _double_type, SemanticTree.basic_function_type.ddiv); + _real_add=make_binary_operator(StringConstants.plus_name, _double_type, SemanticTree.basic_function_type.dadd); + _real_sub=make_binary_operator(StringConstants.minus_name, _double_type, SemanticTree.basic_function_type.dsub); + _real_mul=make_binary_operator(StringConstants.mul_name, _double_type, SemanticTree.basic_function_type.dmul); + _real_div=make_binary_operator(StringConstants.div_name, _double_type, SemanticTree.basic_function_type.ddiv); //Опрерации сравнения. - _real_gr=make_binary_operator(compiler_string_consts.gr_name, _double_type, SemanticTree.basic_function_type.dgr, _bool_type); - _real_greq=make_binary_operator(compiler_string_consts.greq_name, _double_type, SemanticTree.basic_function_type.dgreq, _bool_type); - _real_sm=make_binary_operator(compiler_string_consts.sm_name, _double_type, SemanticTree.basic_function_type.dsm, _bool_type); - _real_smeq=make_binary_operator(compiler_string_consts.smeq_name, _double_type, SemanticTree.basic_function_type.dsmeq, _bool_type); - _real_eq=make_binary_operator(compiler_string_consts.eq_name, _double_type, SemanticTree.basic_function_type.deq, _bool_type); - _real_noteq=make_binary_operator(compiler_string_consts.noteq_name, _double_type, SemanticTree.basic_function_type.dnoteq, _bool_type); + _real_gr=make_binary_operator(StringConstants.gr_name, _double_type, SemanticTree.basic_function_type.dgr, _bool_type); + _real_greq=make_binary_operator(StringConstants.greq_name, _double_type, SemanticTree.basic_function_type.dgreq, _bool_type); + _real_sm=make_binary_operator(StringConstants.sm_name, _double_type, SemanticTree.basic_function_type.dsm, _bool_type); + _real_smeq=make_binary_operator(StringConstants.smeq_name, _double_type, SemanticTree.basic_function_type.dsmeq, _bool_type); + _real_eq=make_binary_operator(StringConstants.eq_name, _double_type, SemanticTree.basic_function_type.deq, _bool_type); + _real_noteq=make_binary_operator(StringConstants.noteq_name, _double_type, SemanticTree.basic_function_type.dnoteq, _bool_type); //float type _float_assign = make_assign_operator(_float_type, SemanticTree.basic_function_type.fassign); _float_to_double = make_type_conversion(_float_type, _double_type, type_compare.less_type, SemanticTree.basic_function_type.ftod); //Унарные операции. - _float_unmin = make_unary_operator(compiler_string_consts.minus_name, _float_type, SemanticTree.basic_function_type.funmin); - //make_empty_operator(compiler_string_consts.plus_name, _real_type); - make_unary_empty_operator(compiler_string_consts.plus_name, _float_type, _float_type); + _float_unmin = make_unary_operator(StringConstants.minus_name, _float_type, SemanticTree.basic_function_type.funmin); + //make_empty_operator(StringConstants.plus_name, _real_type); + make_unary_empty_operator(StringConstants.plus_name, _float_type, _float_type); //Арифметические операции. - _float_add = make_binary_operator(compiler_string_consts.plus_name, _float_type, SemanticTree.basic_function_type.fadd); - _float_sub = make_binary_operator(compiler_string_consts.minus_name, _float_type, SemanticTree.basic_function_type.fsub); - _float_mul = make_binary_operator(compiler_string_consts.mul_name, _float_type, SemanticTree.basic_function_type.fmul); - _float_div = make_binary_operator(compiler_string_consts.div_name, _float_type, SemanticTree.basic_function_type.fdiv); + _float_add = make_binary_operator(StringConstants.plus_name, _float_type, SemanticTree.basic_function_type.fadd); + _float_sub = make_binary_operator(StringConstants.minus_name, _float_type, SemanticTree.basic_function_type.fsub); + _float_mul = make_binary_operator(StringConstants.mul_name, _float_type, SemanticTree.basic_function_type.fmul); + _float_div = make_binary_operator(StringConstants.div_name, _float_type, SemanticTree.basic_function_type.fdiv); //Опрерации сравнения. - _float_gr = make_binary_operator(compiler_string_consts.gr_name, _float_type, SemanticTree.basic_function_type.fgr, _bool_type); - _float_greq = make_binary_operator(compiler_string_consts.greq_name, _float_type, SemanticTree.basic_function_type.fgreq, _bool_type); - _float_sm = make_binary_operator(compiler_string_consts.sm_name, _float_type, SemanticTree.basic_function_type.fsm, _bool_type); - _float_smeq = make_binary_operator(compiler_string_consts.smeq_name, _float_type, SemanticTree.basic_function_type.fsmeq, _bool_type); - _float_eq = make_binary_operator(compiler_string_consts.eq_name, _float_type, SemanticTree.basic_function_type.feq, _bool_type); - _float_noteq = make_binary_operator(compiler_string_consts.noteq_name, _float_type, SemanticTree.basic_function_type.fnoteq, _bool_type); + _float_gr = make_binary_operator(StringConstants.gr_name, _float_type, SemanticTree.basic_function_type.fgr, _bool_type); + _float_greq = make_binary_operator(StringConstants.greq_name, _float_type, SemanticTree.basic_function_type.fgreq, _bool_type); + _float_sm = make_binary_operator(StringConstants.sm_name, _float_type, SemanticTree.basic_function_type.fsm, _bool_type); + _float_smeq = make_binary_operator(StringConstants.smeq_name, _float_type, SemanticTree.basic_function_type.fsmeq, _bool_type); + _float_eq = make_binary_operator(StringConstants.eq_name, _float_type, SemanticTree.basic_function_type.feq, _bool_type); + _float_noteq = make_binary_operator(StringConstants.noteq_name, _float_type, SemanticTree.basic_function_type.fnoteq, _bool_type); make_function_comparison(_real_add, _float_add, function_compare.greater); make_function_comparison(_real_sub, _float_sub, function_compare.greater); @@ -1897,12 +1897,12 @@ namespace PascalABCCompiler.SystemLibrary _char_to_float = make_type_conversion(_char_type, _float_type, type_compare.less_type, SemanticTree.basic_function_type.chartof, false); _char_to_double = make_type_conversion(_char_type, _double_type, type_compare.less_type, SemanticTree.basic_function_type.chartod, false); //Опрерации сравнения. - _char_gr = make_binary_operator(compiler_string_consts.gr_name, _char_type, SemanticTree.basic_function_type.chargr, _bool_type); - _char_greq = make_binary_operator(compiler_string_consts.greq_name, _char_type, SemanticTree.basic_function_type.chargreq, _bool_type); - _char_sm = make_binary_operator(compiler_string_consts.sm_name, _char_type, SemanticTree.basic_function_type.charsm, _bool_type); - _char_smeq = make_binary_operator(compiler_string_consts.smeq_name, _char_type, SemanticTree.basic_function_type.charsmeq, _bool_type); - _char_eq = make_binary_operator(compiler_string_consts.eq_name, _char_type, SemanticTree.basic_function_type.chareq, _bool_type); - _char_noteq = make_binary_operator(compiler_string_consts.noteq_name, _char_type, SemanticTree.basic_function_type.charnoteq, _bool_type); + _char_gr = make_binary_operator(StringConstants.gr_name, _char_type, SemanticTree.basic_function_type.chargr, _bool_type); + _char_greq = make_binary_operator(StringConstants.greq_name, _char_type, SemanticTree.basic_function_type.chargreq, _bool_type); + _char_sm = make_binary_operator(StringConstants.sm_name, _char_type, SemanticTree.basic_function_type.charsm, _bool_type); + _char_smeq = make_binary_operator(StringConstants.smeq_name, _char_type, SemanticTree.basic_function_type.charsmeq, _bool_type); + _char_eq = make_binary_operator(StringConstants.eq_name, _char_type, SemanticTree.basic_function_type.chareq, _bool_type); + _char_noteq = make_binary_operator(StringConstants.noteq_name, _char_type, SemanticTree.basic_function_type.charnoteq, _bool_type); //boolean type. @@ -1911,20 +1911,20 @@ namespace PascalABCCompiler.SystemLibrary //Логические операции. //Унарные операции. - _bool_not=make_unary_operator(compiler_string_consts.not_name, _bool_type, SemanticTree.basic_function_type.boolnot); + _bool_not=make_unary_operator(StringConstants.not_name, _bool_type, SemanticTree.basic_function_type.boolnot); //Логическме операции. - _bool_and=make_binary_operator(compiler_string_consts.and_name, _bool_type, SemanticTree.basic_function_type.booland); - _bool_or=make_binary_operator(compiler_string_consts.or_name, _bool_type, SemanticTree.basic_function_type.boolor); - _bool_xor=make_binary_operator(compiler_string_consts.xor_name, _bool_type, SemanticTree.basic_function_type.boolxor); + _bool_and=make_binary_operator(StringConstants.and_name, _bool_type, SemanticTree.basic_function_type.booland); + _bool_or=make_binary_operator(StringConstants.or_name, _bool_type, SemanticTree.basic_function_type.boolor); + _bool_xor=make_binary_operator(StringConstants.xor_name, _bool_type, SemanticTree.basic_function_type.boolxor); //Опрерации сравнения. - _bool_gr=make_binary_operator(compiler_string_consts.gr_name, _bool_type, SemanticTree.basic_function_type.boolgr); - _bool_greq=make_binary_operator(compiler_string_consts.greq_name, _bool_type, SemanticTree.basic_function_type.boolgreq); - _bool_sm=make_binary_operator(compiler_string_consts.sm_name, _bool_type, SemanticTree.basic_function_type.boolsm); - _bool_smeq=make_binary_operator(compiler_string_consts.smeq_name, _bool_type, SemanticTree.basic_function_type.boolsmeq); - _bool_eq=make_binary_operator(compiler_string_consts.eq_name, _bool_type, SemanticTree.basic_function_type.booleq); - _bool_noteq=make_binary_operator(compiler_string_consts.noteq_name, _bool_type, SemanticTree.basic_function_type.boolnoteq); + _bool_gr=make_binary_operator(StringConstants.gr_name, _bool_type, SemanticTree.basic_function_type.boolgr); + _bool_greq=make_binary_operator(StringConstants.greq_name, _bool_type, SemanticTree.basic_function_type.boolgreq); + _bool_sm=make_binary_operator(StringConstants.sm_name, _bool_type, SemanticTree.basic_function_type.boolsm); + _bool_smeq=make_binary_operator(StringConstants.smeq_name, _bool_type, SemanticTree.basic_function_type.boolsmeq); + _bool_eq=make_binary_operator(StringConstants.eq_name, _bool_type, SemanticTree.basic_function_type.booleq); + _bool_noteq=make_binary_operator(StringConstants.noteq_name, _bool_type, SemanticTree.basic_function_type.boolnoteq); _bool_to_int=make_type_conversion(_bool_type, _integer_type, type_compare.less_type, SemanticTree.basic_function_type.booltoi, false); _bool_to_byte = make_type_conversion(_bool_type, _byte_type, type_compare.greater_type, SemanticTree.basic_function_type.booltob, false); _bool_to_sbyte = make_type_conversion(_bool_type, _sbyte_type, type_compare.greater_type, SemanticTree.basic_function_type.booltosb, false); @@ -1939,8 +1939,8 @@ namespace PascalABCCompiler.SystemLibrary //TODO: Закончить с инициализацией строк. make_assign_operator(_string_type, SemanticTree.basic_function_type.objassign); - _string_add = make_binary_compiled_operator(_string_type, compiler_string_consts.string_concat_method_name, compiler_string_consts.plus_name); - _char_add = make_binary_compiled_operator(_string_type, _char_type, compiler_string_consts.string_concat_method_name, compiler_string_consts.plus_name, _char_type); + _string_add = make_binary_compiled_operator(_string_type, StringConstants.string_concat_method_name, StringConstants.plus_name); + _char_add = make_binary_compiled_operator(_string_type, _char_type, StringConstants.string_concat_method_name, StringConstants.plus_name, _char_type); init_reference_type(_object_type); @@ -1950,55 +1950,55 @@ namespace PascalABCCompiler.SystemLibrary //+= -= *= /= - _byte_plusassign = make_binary_operator(compiler_string_consts.plusassign_name, _byte_type); - _byte_minusassign = make_binary_operator(compiler_string_consts.minusassign_name, _byte_type); - _byte_multassign = make_binary_operator(compiler_string_consts.multassign_name, _byte_type); - _byte_divassign = make_binary_operator(compiler_string_consts.divassign_name, _byte_type); + _byte_plusassign = make_binary_operator(StringConstants.plusassign_name, _byte_type); + _byte_minusassign = make_binary_operator(StringConstants.minusassign_name, _byte_type); + _byte_multassign = make_binary_operator(StringConstants.multassign_name, _byte_type); + _byte_divassign = make_binary_operator(StringConstants.divassign_name, _byte_type); - _sbyte_plusassign = make_binary_operator(compiler_string_consts.plusassign_name, _sbyte_type); - _sbyte_minusassign = make_binary_operator(compiler_string_consts.minusassign_name, _sbyte_type); - _sbyte_multassign = make_binary_operator(compiler_string_consts.multassign_name, _sbyte_type); - _sbyte_divassign = make_binary_operator(compiler_string_consts.divassign_name, _sbyte_type); + _sbyte_plusassign = make_binary_operator(StringConstants.plusassign_name, _sbyte_type); + _sbyte_minusassign = make_binary_operator(StringConstants.minusassign_name, _sbyte_type); + _sbyte_multassign = make_binary_operator(StringConstants.multassign_name, _sbyte_type); + _sbyte_divassign = make_binary_operator(StringConstants.divassign_name, _sbyte_type); - _short_plusassign = make_binary_operator(compiler_string_consts.plusassign_name, _short_type); - _short_minusassign = make_binary_operator(compiler_string_consts.minusassign_name, _short_type); - _short_multassign = make_binary_operator(compiler_string_consts.multassign_name, _short_type); - _short_divassign = make_binary_operator(compiler_string_consts.divassign_name, _short_type); + _short_plusassign = make_binary_operator(StringConstants.plusassign_name, _short_type); + _short_minusassign = make_binary_operator(StringConstants.minusassign_name, _short_type); + _short_multassign = make_binary_operator(StringConstants.multassign_name, _short_type); + _short_divassign = make_binary_operator(StringConstants.divassign_name, _short_type); - _ushort_plusassign = make_binary_operator(compiler_string_consts.plusassign_name, _ushort_type); - _ushort_minusassign = make_binary_operator(compiler_string_consts.minusassign_name, _ushort_type); - _ushort_multassign = make_binary_operator(compiler_string_consts.multassign_name, _ushort_type); - _ushort_divassign = make_binary_operator(compiler_string_consts.divassign_name, _ushort_type); + _ushort_plusassign = make_binary_operator(StringConstants.plusassign_name, _ushort_type); + _ushort_minusassign = make_binary_operator(StringConstants.minusassign_name, _ushort_type); + _ushort_multassign = make_binary_operator(StringConstants.multassign_name, _ushort_type); + _ushort_divassign = make_binary_operator(StringConstants.divassign_name, _ushort_type); - _int_plusassign = make_binary_operator(compiler_string_consts.plusassign_name, _integer_type); - _int_minusassign = make_binary_operator(compiler_string_consts.minusassign_name, _integer_type); - _int_multassign = make_binary_operator(compiler_string_consts.multassign_name, _integer_type); - _int_divassign = make_binary_operator(compiler_string_consts.divassign_name, _integer_type); + _int_plusassign = make_binary_operator(StringConstants.plusassign_name, _integer_type); + _int_minusassign = make_binary_operator(StringConstants.minusassign_name, _integer_type); + _int_multassign = make_binary_operator(StringConstants.multassign_name, _integer_type); + _int_divassign = make_binary_operator(StringConstants.divassign_name, _integer_type); - _uint_plusassign = make_binary_operator(compiler_string_consts.plusassign_name, _uint_type); - _uint_minusassign = make_binary_operator(compiler_string_consts.minusassign_name, _uint_type); - _uint_multassign = make_binary_operator(compiler_string_consts.multassign_name, _uint_type); - _uint_divassign = make_binary_operator(compiler_string_consts.divassign_name, _uint_type); + _uint_plusassign = make_binary_operator(StringConstants.plusassign_name, _uint_type); + _uint_minusassign = make_binary_operator(StringConstants.minusassign_name, _uint_type); + _uint_multassign = make_binary_operator(StringConstants.multassign_name, _uint_type); + _uint_divassign = make_binary_operator(StringConstants.divassign_name, _uint_type); - _long_plusassign = make_binary_operator(compiler_string_consts.plusassign_name, _int64_type); - _long_minusassign = make_binary_operator(compiler_string_consts.minusassign_name, _int64_type); - _long_multassign = make_binary_operator(compiler_string_consts.multassign_name, _int64_type); - _long_divassign = make_binary_operator(compiler_string_consts.divassign_name, _int64_type); + _long_plusassign = make_binary_operator(StringConstants.plusassign_name, _int64_type); + _long_minusassign = make_binary_operator(StringConstants.minusassign_name, _int64_type); + _long_multassign = make_binary_operator(StringConstants.multassign_name, _int64_type); + _long_divassign = make_binary_operator(StringConstants.divassign_name, _int64_type); - _ulong_plusassign = make_binary_operator(compiler_string_consts.plusassign_name, _uint64_type); - _ulong_minusassign = make_binary_operator(compiler_string_consts.minusassign_name, _uint64_type); - _ulong_multassign = make_binary_operator(compiler_string_consts.multassign_name, _uint64_type); - _ulong_divassign = make_binary_operator(compiler_string_consts.divassign_name, _uint64_type); + _ulong_plusassign = make_binary_operator(StringConstants.plusassign_name, _uint64_type); + _ulong_minusassign = make_binary_operator(StringConstants.minusassign_name, _uint64_type); + _ulong_multassign = make_binary_operator(StringConstants.multassign_name, _uint64_type); + _ulong_divassign = make_binary_operator(StringConstants.divassign_name, _uint64_type); - _float_plusassign = make_binary_operator(compiler_string_consts.plusassign_name, _float_type); - _float_minusassign = make_binary_operator(compiler_string_consts.minusassign_name, _float_type); - _float_multassign = make_binary_operator(compiler_string_consts.multassign_name, _float_type); - _float_divassign = make_binary_operator(compiler_string_consts.divassign_name, _float_type); + _float_plusassign = make_binary_operator(StringConstants.plusassign_name, _float_type); + _float_minusassign = make_binary_operator(StringConstants.minusassign_name, _float_type); + _float_multassign = make_binary_operator(StringConstants.multassign_name, _float_type); + _float_divassign = make_binary_operator(StringConstants.divassign_name, _float_type); - _double_plusassign = make_binary_operator(compiler_string_consts.plusassign_name, _double_type); - _double_minusassign = make_binary_operator(compiler_string_consts.minusassign_name, _double_type); - _double_multassign = make_binary_operator(compiler_string_consts.multassign_name, _double_type); - _double_divassign = make_binary_operator(compiler_string_consts.divassign_name, _double_type); + _double_plusassign = make_binary_operator(StringConstants.plusassign_name, _double_type); + _double_minusassign = make_binary_operator(StringConstants.minusassign_name, _double_type); + _double_multassign = make_binary_operator(StringConstants.multassign_name, _double_type); + _double_divassign = make_binary_operator(StringConstants.divassign_name, _double_type); @@ -2090,7 +2090,7 @@ namespace PascalABCCompiler.SystemLibrary wait_add_ref_list.Clear(); _exception_base_type = compiled_type_node.get_type_node(typeof(System.Exception), symtab); - _exception_base_type.SetName(compiler_string_consts.base_exception_class_name); + _exception_base_type.SetName(StringConstants.base_exception_class_name); _int64_to_pointer = make_type_conversion(_int64_type, _pointer_type, type_compare.greater_type, SemanticTree.basic_function_type.ltop, false); _pointer_to_int64 = make_type_conversion(_pointer_type, _int64_type, type_compare.less_type, SemanticTree.basic_function_type.ptol, false); } @@ -2123,7 +2123,7 @@ namespace PascalABCCompiler.SystemLibrary Type t = typeof(char); Type[] types = new Type[1]; types[0] = typeof(char); - System.Reflection.MethodInfo mi = t.GetMethod(compiler_string_consts.to_string_method_name, types); + System.Reflection.MethodInfo mi = t.GetMethod(StringConstants.to_string_method_name, types); compiled_function_node cfn = compiled_function_node.get_compiled_method(mi); inter.another_to_this = new type_conversion(cfn); @@ -2157,32 +2157,32 @@ namespace PascalABCCompiler.SystemLibrary /*public static void RestoreStandartNames() { - _bool_type.SetName(compiler_string_consts.bool_type_name); - _byte_type.SetName(compiler_string_consts.byte_type_name); - _sbyte_type.SetName(compiler_string_consts.sbyte_type_name); - _short_type.SetName(compiler_string_consts.short_type_name); - _ushort_type.SetName(compiler_string_consts.ushort_type_name); - _integer_type.SetName(compiler_string_consts.integer_type_name); ; - _uint_type.SetName(compiler_string_consts.uint_type_name); - _int64_type.SetName(compiler_string_consts.long_type_name); - _uint64_type.SetName(compiler_string_consts.ulong_type_name); - _double_type.SetName(compiler_string_consts.real_type_name); - _float_type.SetName(compiler_string_consts.float_type_name); - _char_type.SetName(compiler_string_consts.char_type_name); - _string_type.SetName(compiler_string_consts.string_type_name); - _object_type.SetName(compiler_string_consts.object_type_name); - _exception_base_type.SetName(compiler_string_consts.base_exception_class_name); - _array_base_type.SetName(compiler_string_consts.base_array_type_name); - _delegate_base_type.SetName(compiler_string_consts.base_delegate_type_name); - _enum_base_type.SetName(compiler_string_consts.base_enum_class_name); - _pointer_type.SetName(compiler_string_consts.pointer_type_name); - _void_type.SetName(compiler_string_consts.void_class_name); + _bool_type.SetName(StringConstants.bool_type_name); + _byte_type.SetName(StringConstants.byte_type_name); + _sbyte_type.SetName(StringConstants.sbyte_type_name); + _short_type.SetName(StringConstants.short_type_name); + _ushort_type.SetName(StringConstants.ushort_type_name); + _integer_type.SetName(StringConstants.integer_type_name); ; + _uint_type.SetName(StringConstants.uint_type_name); + _int64_type.SetName(StringConstants.long_type_name); + _uint64_type.SetName(StringConstants.ulong_type_name); + _double_type.SetName(StringConstants.real_type_name); + _float_type.SetName(StringConstants.float_type_name); + _char_type.SetName(StringConstants.char_type_name); + _string_type.SetName(StringConstants.string_type_name); + _object_type.SetName(StringConstants.object_type_name); + _exception_base_type.SetName(StringConstants.base_exception_class_name); + _array_base_type.SetName(StringConstants.base_array_type_name); + _delegate_base_type.SetName(StringConstants.base_delegate_type_name); + _enum_base_type.SetName(StringConstants.base_enum_class_name); + _pointer_type.SetName(StringConstants.pointer_type_name); + _void_type.SetName(StringConstants.void_class_name); }*/ private static void make_methods() { _empty_method = new basic_function_node(SemanticTree.basic_function_type.none, null, true); - basic_parameter bp = new basic_parameter(compiler_string_consts.unary_param_name, null, + basic_parameter bp = new basic_parameter(StringConstants.unary_param_name, null, SemanticTree.parameter_type.value, _empty_method); _empty_method.parameters.AddElement(bp); _empty_method.compile_time_executor = delegated_empty_method; @@ -2212,9 +2212,9 @@ namespace PascalABCCompiler.SystemLibrary string name, type_node ret_type, SemanticTree.parameter_type first_parameter_type) { basic_function_node bfn = new basic_function_node(bas_ft, ret_type,true,name); - basic_parameter to = new basic_parameter(compiler_string_consts.left_param_name, ctn, + basic_parameter to = new basic_parameter(StringConstants.left_param_name, ctn, first_parameter_type, bfn); - basic_parameter from = new basic_parameter(compiler_string_consts.right_param_name, ctn, + basic_parameter from = new basic_parameter(StringConstants.right_param_name, ctn, SemanticTree.parameter_type.value, bfn); bfn.parameters.AddElement(to); bfn.parameters.AddElement(from); @@ -2231,7 +2231,7 @@ namespace PascalABCCompiler.SystemLibrary public static basic_function_node make_assign_operator(type_node ctn,SemanticTree.basic_function_type assign_method) { - basic_function_node ret = make_object_operator(ctn, assign_method, compiler_string_consts.assign_name, + basic_function_node ret = make_object_operator(ctn, assign_method, StringConstants.assign_name, ctn, SemanticTree.parameter_type.var); ret.operation_kind = special_operation_kind.assign; return ret; @@ -2244,12 +2244,12 @@ namespace PascalABCCompiler.SystemLibrary public static basic_function_node make_equivalence_operator(type_node ctn) { - return make_object_operator(ctn, SemanticTree.basic_function_type.objeq, compiler_string_consts.eq_name, _bool_type); + return make_object_operator(ctn, SemanticTree.basic_function_type.objeq, StringConstants.eq_name, _bool_type); } public static basic_function_node make_not_equivalence_operator(type_node ctn) { - return make_object_operator(ctn, SemanticTree.basic_function_type.objnoteq, compiler_string_consts.noteq_name, _bool_type); + return make_object_operator(ctn, SemanticTree.basic_function_type.objnoteq, StringConstants.noteq_name, _bool_type); } public static void init_reference_type(type_node tn) diff --git a/TreeConverter/SystemLib/SystemLibInitializer.cs b/TreeConverter/SystemLib/SystemLibInitializer.cs index b5ddd6bdb..b0d2a44e3 100644 --- a/TreeConverter/SystemLib/SystemLibInitializer.cs +++ b/TreeConverter/SystemLib/SystemLibInitializer.cs @@ -36,7 +36,7 @@ namespace PascalABCCompiler.SystemLibrary { compiled_type_node ctn = compiled_type_node.get_type_node(NetHelper.NetHelper.PABCSystemType); _notCreatedSymbolInfo = ctn.find_in_type(name); - /*if (name == TreeConverter.compiler_string_consts.read_procedure_name || name == TreeConverter.compiler_string_consts.readln_procedure_name) + /*if (name == StringConstants.read_procedure_name || name == StringConstants.readln_procedure_name) { compiled_type_node ctn2 = compiled_type_node.get_type_node(NetHelper.NetHelper.PT4Type); TreeConverter.SymbolInfo si = ctn2.find_in_type(name); @@ -94,7 +94,7 @@ namespace PascalABCCompiler.SystemLibrary { compiled_type_node ctn = compiled_type_node.get_type_node(NetHelper.NetHelper.PABCSystemType); symbolInfo = ctn.find_in_type(name); - /*if (name == TreeConverter.compiler_string_consts.read_procedure_name || name == TreeConverter.compiler_string_consts.readln_procedure_name) + /*if (name == StringConstants.read_procedure_name || name == StringConstants.readln_procedure_name) { compiled_type_node ctn2 = compiled_type_node.get_type_node(NetHelper.NetHelper.PT4Type); TreeConverter.SymbolInfo si = ctn2.find_in_type(name); @@ -114,31 +114,31 @@ namespace PascalABCCompiler.SystemLibrary common_type_node tctn = symbolInfo.FirstOrDefault().sym_info as common_type_node; tctn.type_special_kind = SemanticTree.type_special_kind.base_set_type; - tctn.scope.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name, SystemLibInitializer.SetUnionProcedure.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.mul_name, SystemLibInitializer.SetIntersectProcedure.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.in_name, SystemLibInitializer.InSetProcedure.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.minus_name, SystemLibInitializer.SetSubtractProcedure.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.gr_name, SystemLibInitializer.CompareSetGreater.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.greq_name, SystemLibInitializer.CompareSetGreaterEqual.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.sm_name, SystemLibInitializer.CompareSetLess.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.smeq_name, SystemLibInitializer.CompareSetLessEqual.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name, SystemLibInitializer.CompareSetEquals.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.noteq_name, SystemLibInitializer.CompareSetInEquals.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.plus_name, SystemLibInitializer.SetUnionProcedure.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.mul_name, SystemLibInitializer.SetIntersectProcedure.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.in_name, SystemLibInitializer.InSetProcedure.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.minus_name, SystemLibInitializer.SetSubtractProcedure.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.gr_name, SystemLibInitializer.CompareSetGreater.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.greq_name, SystemLibInitializer.CompareSetGreaterEqual.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.sm_name, SystemLibInitializer.CompareSetLess.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.smeq_name, SystemLibInitializer.CompareSetLessEqual.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.eq_name, SystemLibInitializer.CompareSetEquals.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.noteq_name, SystemLibInitializer.CompareSetInEquals.SymbolInfo.FirstOrDefault()); } else { compiled_type_node tctn = symbolInfo.FirstOrDefault().sym_info as compiled_type_node; tctn.type_special_kind = SemanticTree.type_special_kind.base_set_type; - tctn.scope.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name, SystemLibInitializer.SetUnionProcedure.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.mul_name, SystemLibInitializer.SetIntersectProcedure.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.in_name, SystemLibInitializer.InSetProcedure.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.minus_name, SystemLibInitializer.SetSubtractProcedure.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.gr_name, SystemLibInitializer.CompareSetGreater.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.greq_name, SystemLibInitializer.CompareSetGreaterEqual.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.sm_name, SystemLibInitializer.CompareSetLess.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.smeq_name, SystemLibInitializer.CompareSetLessEqual.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name, SystemLibInitializer.CompareSetEquals.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.noteq_name,SystemLibInitializer.CompareSetInEquals.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.plus_name, SystemLibInitializer.SetUnionProcedure.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.mul_name, SystemLibInitializer.SetIntersectProcedure.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.in_name, SystemLibInitializer.InSetProcedure.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.minus_name, SystemLibInitializer.SetSubtractProcedure.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.gr_name, SystemLibInitializer.CompareSetGreater.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.greq_name, SystemLibInitializer.CompareSetGreaterEqual.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.sm_name, SystemLibInitializer.CompareSetLess.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.smeq_name, SystemLibInitializer.CompareSetLessEqual.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.eq_name, SystemLibInitializer.CompareSetEquals.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.noteq_name,SystemLibInitializer.CompareSetInEquals.SymbolInfo.FirstOrDefault()); } } else if (symbolInfo != null && SystemLibInitializer.TextFileType.Equal(symbolInfo)) @@ -154,7 +154,7 @@ namespace PascalABCCompiler.SystemLibrary tctn.type_special_kind = PascalABCCompiler.SemanticTree.type_special_kind.text_file; } } - else if (symbolInfo != null && string.Compare(name,PascalABCCompiler.TreeConverter.compiler_string_consts.ArrayCopyFunction,true)==0) + else if (symbolInfo != null && string.Compare(name,StringConstants.ArrayCopyFunction,true)==0) { while ((symbolInfo[0].sym_info as function_node).parameters.Count != 1) { @@ -413,15 +413,15 @@ namespace PascalABCCompiler.SystemLibrary //SymbolTable.Scope sc = system_namespace.scope; SymbolTable.Scope sc = where_add; namespace_constant_definition _true_constant_definition = new namespace_constant_definition( - PascalABCCompiler.TreeConverter.compiler_string_consts.true_const_name, SystemLibrary.true_constant, system_unit_location, system_namespace); + StringConstants.true_const_name, SystemLibrary.true_constant, system_unit_location, system_namespace); system_namespace.constants.AddElement(_true_constant_definition); namespace_constant_definition _false_constant_definition = new namespace_constant_definition( - PascalABCCompiler.TreeConverter.compiler_string_consts.false_const_name, SystemLibrary.false_constant, system_unit_location, system_namespace); + StringConstants.false_const_name, SystemLibrary.false_constant, system_unit_location, system_namespace); system_namespace.constants.AddElement(_false_constant_definition); - sc.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.true_const_name, new PascalABCCompiler.TreeConverter.SymbolInfo(_true_constant_definition)); - sc.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.false_const_name, new PascalABCCompiler.TreeConverter.SymbolInfo(_false_constant_definition)); + sc.AddSymbol(StringConstants.true_const_name, new PascalABCCompiler.TreeConverter.SymbolInfo(_true_constant_definition)); + sc.AddSymbol(StringConstants.false_const_name, new PascalABCCompiler.TreeConverter.SymbolInfo(_false_constant_definition)); //TODO: Сделано по быстрому. Переделать. Можно просто один раз сериализовать модуль system и не инициализировать его всякий раз подобным образом. Неплохо-бы использовать NetHelper.GetMethod. @@ -431,7 +431,7 @@ namespace PascalABCCompiler.SystemLibrary System.Reflection.MethodInfo mi; //TODO: Сделать узел или базовый метод создания и удаления объекта. - common_namespace_function_node cnfn = new common_namespace_function_node(TreeConverter.compiler_string_consts.new_procedure_name, null, null, system_namespace, null); + common_namespace_function_node cnfn = new common_namespace_function_node(StringConstants.new_procedure_name, null, null, system_namespace, null); cnfn.parameters.AddElement(new common_parameter("ptr", SystemLibrary.pointer_type, SemanticTree.parameter_type.value, cnfn, concrete_parameter_type.cpt_var, null, null)); cnfn.SpecialFunctionKind = SemanticTree.SpecialFunctionKind.New; @@ -439,9 +439,9 @@ namespace PascalABCCompiler.SystemLibrary _NewProcedure.symbol_kind = PascalABCCompiler.TreeConverter.symbol_kind.sk_overload_function; _NewProcedure.access_level = PascalABCCompiler.TreeConverter.access_level.al_public; _NewProcedureDecl = cnfn; - sc.AddSymbol(TreeConverter.compiler_string_consts.new_procedure_name,_NewProcedure); + sc.AddSymbol(StringConstants.new_procedure_name,_NewProcedure); - cnfn = new common_namespace_function_node(TreeConverter.compiler_string_consts.dispose_procedure_name, null, null, system_namespace, null); + cnfn = new common_namespace_function_node(StringConstants.dispose_procedure_name, null, null, system_namespace, null); cnfn.parameters.AddElement(new common_parameter("ptr", SystemLibrary.pointer_type, SemanticTree.parameter_type.value, cnfn, concrete_parameter_type.cpt_var, null, null)); _DisposeProcedure = new PascalABCCompiler.TreeConverter.SymbolInfo(cnfn); @@ -449,9 +449,9 @@ namespace PascalABCCompiler.SystemLibrary _DisposeProcedure.access_level = PascalABCCompiler.TreeConverter.access_level.al_public; _DisposeProcedureDecl = cnfn; cnfn.SpecialFunctionKind = SemanticTree.SpecialFunctionKind.Dispose; - sc.AddSymbol(TreeConverter.compiler_string_consts.dispose_procedure_name, _DisposeProcedure); + sc.AddSymbol(StringConstants.dispose_procedure_name, _DisposeProcedure); - cnfn = new common_namespace_function_node(TreeConverter.compiler_string_consts.new_array_procedure_name, compiled_type_node.get_type_node(typeof(Array)), null, system_namespace, null); + cnfn = new common_namespace_function_node(StringConstants.new_array_procedure_name, compiled_type_node.get_type_node(typeof(Array)), null, system_namespace, null); cnfn.parameters.AddElement(new common_parameter("t", compiled_type_node.get_type_node(typeof(Type)), SemanticTree.parameter_type.value, cnfn, concrete_parameter_type.cpt_none, null, null)); cnfn.parameters.AddElement(new common_parameter("n", SystemLibrary.integer_type, SemanticTree.parameter_type.value, cnfn, @@ -459,24 +459,24 @@ namespace PascalABCCompiler.SystemLibrary cnfn.SpecialFunctionKind = SemanticTree.SpecialFunctionKind.NewArray; _NewArrayProcedure = new PascalABCCompiler.TreeConverter.SymbolInfo(cnfn); _NewArrayProcedureDecl = cnfn; - //sc.AddSymbol(TreeConverter.compiler_string_consts.new_procedure_name, _NewProcedure); + //sc.AddSymbol(StringConstants.new_procedure_name, _NewProcedure); basic_function_node break_procedure = new basic_function_node(SemanticTree.basic_function_type.none, - null, true, PascalABCCompiler.TreeConverter.compiler_string_consts.break_procedure_name); + null, true, StringConstants.break_procedure_name); break_procedure.compile_time_executor = initialization_properties.break_executor; - sc.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.break_procedure_name, new PascalABCCompiler.TreeConverter.SymbolInfo(break_procedure)); + sc.AddSymbol(StringConstants.break_procedure_name, new PascalABCCompiler.TreeConverter.SymbolInfo(break_procedure)); basic_function_node continue_procedure = new basic_function_node(SemanticTree.basic_function_type.none, - null, true, PascalABCCompiler.TreeConverter.compiler_string_consts.continue_procedure_name); + null, true, StringConstants.continue_procedure_name); continue_procedure.compile_time_executor = initialization_properties.continue_executor; - sc.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.continue_procedure_name, new PascalABCCompiler.TreeConverter.SymbolInfo(continue_procedure)); + sc.AddSymbol(StringConstants.continue_procedure_name, new PascalABCCompiler.TreeConverter.SymbolInfo(continue_procedure)); basic_function_node exit_procedure = new basic_function_node(SemanticTree.basic_function_type.none, - null, true, PascalABCCompiler.TreeConverter.compiler_string_consts.exit_procedure_name); + null, true, StringConstants.exit_procedure_name); exit_procedure.compile_time_executor = initialization_properties.exit_executor; - sc.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.exit_procedure_name, new PascalABCCompiler.TreeConverter.SymbolInfo(exit_procedure)); + sc.AddSymbol(StringConstants.exit_procedure_name, new PascalABCCompiler.TreeConverter.SymbolInfo(exit_procedure)); - sc.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.set_length_procedure_name, + sc.AddSymbol(StringConstants.set_length_procedure_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.resize_func, PascalABCCompiler.TreeConverter.access_level.al_public, PascalABCCompiler.TreeConverter.symbol_kind.sk_overload_function)); } @@ -490,34 +490,34 @@ namespace PascalABCCompiler.SystemLibrary new SymbolTable.Scope[0]); common_unit_node _system_unit = new common_unit_node(main_scope,impl_scope,null,null); - common_namespace_node cnn = new common_namespace_node(null, _system_unit, PascalABCCompiler.TreeConverter.compiler_string_consts.system_unit_name, + common_namespace_node cnn = new common_namespace_node(null, _system_unit, StringConstants.pascalSystemUnitNamespaceName, symbol_table.CreateScope(main_scope),system_unit_location); - main_scope.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.system_unit_name, new PascalABCCompiler.TreeConverter.SymbolInfo(cnn)); + main_scope.AddSymbol(StringConstants.pascalSystemUnitNamespaceName, new PascalABCCompiler.TreeConverter.SymbolInfo(cnn)); //SymbolTable.Scope sc = cnn.scope; SymbolTable.Scope sc = main_scope; //Добавляем типы. - sc.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.byte_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.byte_type)); - //sc.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.decimal_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.decimal_type)); - sc.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.sbyte_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.sbyte_type)); - sc.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.short_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.short_type)); - sc.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.ushort_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.ushort_type)); - sc.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.integer_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.integer_type)); - sc.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.uint_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.uint_type)); - sc.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.long_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.int64_type)); - sc.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.ulong_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.uint64_type)); - sc.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.float_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.float_type)); - sc.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.real_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.double_type)); - sc.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.char_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.char_type)); - sc.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.bool_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.bool_type)); - sc.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.string_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.string_type)); - //sc.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.object_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.object_type)); - sc.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.pointer_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.pointer_type)); - //sc.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.base_exception_class_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.exception_base_type)); - sc.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.base_array_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.array_base_type)); - sc.AddSymbol(PascalABCCompiler.TreeConverter.compiler_string_consts.base_delegate_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.delegate_base_type)); + sc.AddSymbol(StringConstants.byte_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.byte_type)); + //sc.AddSymbol(StringConstants.decimal_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.decimal_type)); + sc.AddSymbol(StringConstants.sbyte_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.sbyte_type)); + sc.AddSymbol(StringConstants.short_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.short_type)); + sc.AddSymbol(StringConstants.ushort_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.ushort_type)); + sc.AddSymbol(StringConstants.integer_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.integer_type)); + sc.AddSymbol(StringConstants.uint_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.uint_type)); + sc.AddSymbol(StringConstants.long_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.int64_type)); + sc.AddSymbol(StringConstants.ulong_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.uint64_type)); + sc.AddSymbol(StringConstants.float_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.float_type)); + sc.AddSymbol(StringConstants.real_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.double_type)); + sc.AddSymbol(StringConstants.char_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.char_type)); + sc.AddSymbol(StringConstants.bool_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.bool_type)); + sc.AddSymbol(StringConstants.string_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.string_type)); + //sc.AddSymbol(StringConstants.object_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.object_type)); + sc.AddSymbol(StringConstants.pointer_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.pointer_type)); + //sc.AddSymbol(StringConstants.base_exception_class_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.exception_base_type)); + sc.AddSymbol(StringConstants.base_array_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.array_base_type)); + sc.AddSymbol(StringConstants.base_delegate_type_name, new PascalABCCompiler.TreeConverter.SymbolInfo(SystemLibrary.delegate_base_type)); //TODO: Переделать. Пусть таблица символов создается одна. Как статическая. compiled_type_node comp_byte_type = ((compiled_type_node)SystemLibrary.byte_type); diff --git a/TreeConverter/SystemLib/static_executors.cs b/TreeConverter/SystemLib/static_executors.cs index 5ec026e62..9d10cb6be 100644 --- a/TreeConverter/SystemLib/static_executors.cs +++ b/TreeConverter/SystemLib/static_executors.cs @@ -413,7 +413,7 @@ namespace PascalABCCompiler.SystemLibrary { //return inline_assign_operator(SystemLibrary._byte_plusassign, SystemLibrary.byte_assign, SystemLibrary.int_add, call_location, parameters); if (!SemanticRules.UseExtendedAssignmentOperatorsForPrimitiveTypes) - SystemLibrary.syn_visitor.AddError(new OperatorCanNotBeAppliedToThisType(compiler_string_consts.plusassign_name, parameters[0])); + SystemLibrary.syn_visitor.AddError(new OperatorCanNotBeAppliedToThisType(StringConstants.plusassign_name, parameters[0])); //basic_function_call operationc = new basic_function_call((basic_function_node)operation, call_location); base_function_call cnfc = null; if (SystemLibInitializer.SetUnionProcedure.sym_info is common_namespace_function_node) @@ -423,7 +423,7 @@ namespace PascalABCCompiler.SystemLibrary cnfc.parameters.AddElement(parameters[0]); cnfc.parameters.AddElement(parameters[1]); //operationc.parameters.AddElement(SystemLibrary.syn_visitor.convertion_data_and_alghoritms.convert_type(parameters[1], parameters[0].type)); - basic_function_call assignc = new basic_function_call(parameters[0].type.find_first_in_type(compiler_string_consts.assign_name).sym_info as basic_function_node, call_location); + basic_function_call assignc = new basic_function_call(parameters[0].type.find_first_in_type(StringConstants.assign_name).sym_info as basic_function_node, call_location); assignc.parameters.AddElement(parameters[0]); assignc.parameters.AddElement(cnfc); //assignc.parameters.AddElement(SystemLibrary.syn_visitor.convertion_data_and_alghoritms.convert_type(operationc, parameters[0].type)); @@ -433,11 +433,11 @@ namespace PascalABCCompiler.SystemLibrary public static expression_node short_string_addassign_executor(location call_location, params expression_node[] parameters) { if (!SemanticRules.UseExtendedAssignmentOperatorsForPrimitiveTypes) - SystemLibrary.syn_visitor.AddError(new OperatorCanNotBeAppliedToThisType(compiler_string_consts.plusassign_name, parameters[0])); + SystemLibrary.syn_visitor.AddError(new OperatorCanNotBeAppliedToThisType(StringConstants.plusassign_name, parameters[0])); compiled_static_method_call csmc = new compiled_static_method_call(SystemLibrary.string_add as compiled_function_node, call_location); csmc.parameters.AddElement(parameters[0]); csmc.parameters.AddElement(parameters[1]); - basic_function_call assignc = new basic_function_call(parameters[0].type.find_first_in_type(compiler_string_consts.assign_name).sym_info as basic_function_node, call_location); + basic_function_call assignc = new basic_function_call(parameters[0].type.find_first_in_type(StringConstants.assign_name).sym_info as basic_function_node, call_location); assignc.parameters.AddElement(parameters[0]); base_function_call cnfc = null; if (SystemLibInitializer.ClipShortStringProcedure.sym_info is common_namespace_function_node) @@ -454,7 +454,7 @@ namespace PascalABCCompiler.SystemLibrary { //return inline_assign_operator(SystemLibrary._byte_plusassign, SystemLibrary.byte_assign, SystemLibrary.int_add, call_location, parameters); if (!SemanticRules.UseExtendedAssignmentOperatorsForPrimitiveTypes) - SystemLibrary.syn_visitor.AddError(new OperatorCanNotBeAppliedToThisType(compiler_string_consts.plusassign_name, parameters[0])); + SystemLibrary.syn_visitor.AddError(new OperatorCanNotBeAppliedToThisType(StringConstants.plusassign_name, parameters[0])); //basic_function_call operationc = new basic_function_call((basic_function_node)operation, call_location); base_function_call cnfc = null; if (SystemLibInitializer.SetSubtractProcedure.sym_info is common_namespace_function_node) @@ -464,7 +464,7 @@ namespace PascalABCCompiler.SystemLibrary cnfc.parameters.AddElement(parameters[0]); cnfc.parameters.AddElement(parameters[1]); //operationc.parameters.AddElement(SystemLibrary.syn_visitor.convertion_data_and_alghoritms.convert_type(parameters[1], parameters[0].type)); - basic_function_call assignc = new basic_function_call(parameters[0].type.find_first_in_type(compiler_string_consts.assign_name).sym_info as basic_function_node, call_location); + basic_function_call assignc = new basic_function_call(parameters[0].type.find_first_in_type(StringConstants.assign_name).sym_info as basic_function_node, call_location); assignc.parameters.AddElement(parameters[0]); assignc.parameters.AddElement(cnfc); //assignc.parameters.AddElement(SystemLibrary.syn_visitor.convertion_data_and_alghoritms.convert_type(operationc, parameters[0].type)); @@ -475,7 +475,7 @@ namespace PascalABCCompiler.SystemLibrary { //return inline_assign_operator(SystemLibrary._byte_plusassign, SystemLibrary.byte_assign, SystemLibrary.int_add, call_location, parameters); if (!SemanticRules.UseExtendedAssignmentOperatorsForPrimitiveTypes) - SystemLibrary.syn_visitor.AddError(new OperatorCanNotBeAppliedToThisType(compiler_string_consts.plusassign_name, parameters[0])); + SystemLibrary.syn_visitor.AddError(new OperatorCanNotBeAppliedToThisType(StringConstants.plusassign_name, parameters[0])); //basic_function_call operationc = new basic_function_call((basic_function_node)operation, call_location); base_function_call cnfc = null; if (SystemLibInitializer.SetIntersectProcedure.sym_info is common_namespace_function_node) @@ -485,7 +485,7 @@ namespace PascalABCCompiler.SystemLibrary cnfc.parameters.AddElement(parameters[0]); cnfc.parameters.AddElement(parameters[1]); //operationc.parameters.AddElement(SystemLibrary.syn_visitor.convertion_data_and_alghoritms.convert_type(parameters[1], parameters[0].type)); - basic_function_call assignc = new basic_function_call(parameters[0].type.find_first_in_type(compiler_string_consts.assign_name).sym_info as basic_function_node, call_location); + basic_function_call assignc = new basic_function_call(parameters[0].type.find_first_in_type(StringConstants.assign_name).sym_info as basic_function_node, call_location); assignc.parameters.AddElement(parameters[0]); assignc.parameters.AddElement(cnfc); //assignc.parameters.AddElement(SystemLibrary.syn_visitor.convertion_data_and_alghoritms.convert_type(operationc, parameters[0].type)); diff --git a/TreeConverter/TreeConversion/CompilationErrors.cs b/TreeConverter/TreeConversion/CompilationErrors.cs index 413a5676f..69d340d6d 100644 --- a/TreeConverter/TreeConversion/CompilationErrors.cs +++ b/TreeConverter/TreeConversion/CompilationErrors.cs @@ -1907,11 +1907,11 @@ namespace PascalABCCompiler.TreeConverter public CanNotReferenceToNonStaticMethodWithType(string meth_name, location loc) : base(loc) { - if (meth_name.Contains(compiler_string_consts.event_add_method_prefix) || - meth_name.Contains(compiler_string_consts.event_remove_method_prefix)) + if (meth_name.Contains(StringConstants.event_add_method_prefix) || + meth_name.Contains(StringConstants.event_remove_method_prefix)) { - meth_name = meth_name.Replace(compiler_string_consts.event_add_method_prefix, ""); - meth_name = meth_name.Replace(compiler_string_consts.event_remove_method_prefix, ""); + meth_name = meth_name.Replace(StringConstants.event_add_method_prefix, ""); + meth_name = meth_name.Replace(StringConstants.event_remove_method_prefix, ""); message = "CAN_NOT_REFERENCE_TO_NONSTATIC_EVENT_{0}_WITH_TYPE"; } name=meth_name; @@ -1934,11 +1934,11 @@ namespace PascalABCCompiler.TreeConverter { case general_node_type.function_node: meth_name = (dn as function_node).name; - if (meth_name.Contains(compiler_string_consts.event_add_method_prefix) || - meth_name.Contains(compiler_string_consts.event_remove_method_prefix)) + if (meth_name.Contains(StringConstants.event_add_method_prefix) || + meth_name.Contains(StringConstants.event_remove_method_prefix)) { - meth_name = meth_name.Replace(compiler_string_consts.event_add_method_prefix, ""); - meth_name = meth_name.Replace(compiler_string_consts.event_remove_method_prefix, ""); + meth_name = meth_name.Replace(StringConstants.event_add_method_prefix, ""); + meth_name = meth_name.Replace(StringConstants.event_remove_method_prefix, ""); message = "CAN_NOT_REFERENCE_TO_NONSTATIC_EVENT_{0}_FROM_STATIC_METHOD"; } break; @@ -1971,11 +1971,11 @@ namespace PascalABCCompiler.TreeConverter { case general_node_type.function_node: meth_name = (dn as function_node).name; - if (meth_name.Contains(compiler_string_consts.event_add_method_prefix) || - meth_name.Contains(compiler_string_consts.event_remove_method_prefix)) + if (meth_name.Contains(StringConstants.event_add_method_prefix) || + meth_name.Contains(StringConstants.event_remove_method_prefix)) { - meth_name = meth_name.Replace(compiler_string_consts.event_add_method_prefix, ""); - meth_name = meth_name.Replace(compiler_string_consts.event_remove_method_prefix, ""); + meth_name = meth_name.Replace(StringConstants.event_add_method_prefix, ""); + meth_name = meth_name.Replace(StringConstants.event_remove_method_prefix, ""); message = "CAN_NOT_REFERENCE_TO_NONSTATIC_EVENT_{0}_FROM_STATIC_INITIALIZER"; } break; diff --git a/TreeConverter/TreeConversion/SyntaxTreeVisitorNodes/Assign.cs b/TreeConverter/TreeConversion/SyntaxTreeVisitorNodes/Assign.cs index c6fd13b2f..f3913d040 100644 --- a/TreeConverter/TreeConversion/SyntaxTreeVisitorNodes/Assign.cs +++ b/TreeConverter/TreeConversion/SyntaxTreeVisitorNodes/Assign.cs @@ -90,7 +90,7 @@ namespace PascalABCCompiler.TreeConverter expr, ind_expr, new int_const_node((expr.type as short_string_type_node).Length, null), from); - return_value(find_operator(compiler_string_consts.assign_name, expr, ind_expr, get_location(_assign))); + return_value(find_operator(StringConstants.assign_name, expr, ind_expr, get_location(_assign))); return true; } if (to.type.type_special_kind == type_special_kind.short_string) @@ -103,7 +103,7 @@ namespace PascalABCCompiler.TreeConverter convertion_data_and_alghoritms.convert_type(from, SystemLibrary.SystemLibrary.string_type), new int_const_node((to.type as short_string_type_node).Length, null)); - statement_node en = find_operator(compiler_string_consts.assign_name, to, clip_expr, get_location(_assign)); + statement_node en = find_operator(StringConstants.assign_name, to, clip_expr, get_location(_assign)); return_value(en); return true; } diff --git a/TreeConverter/TreeConversion/SyntaxTreeVisitorNodes/ForLoop.cs b/TreeConverter/TreeConversion/SyntaxTreeVisitorNodes/ForLoop.cs index a03cde181..ab5816b05 100644 --- a/TreeConverter/TreeConversion/SyntaxTreeVisitorNodes/ForLoop.cs +++ b/TreeConverter/TreeConversion/SyntaxTreeVisitorNodes/ForLoop.cs @@ -103,14 +103,14 @@ namespace PascalABCCompiler.TreeConverter right = finishValue; if (right is typed_expression) right = convert_typed_expression_to_function_call(right as typed_expression); - res = find_operator(compiler_string_consts.assign_name, left, right, finishValueLocation); + res = find_operator(StringConstants.assign_name, left, right, finishValueLocation); head_stmts.statements.AddElement(res); if (!early_init_loop_variable) // SSM 25/05/16 - for var i := f1() to f2() do без этой правки дважды вызывал f1() { left = create_variable_reference(vdn, loopVariableLocation); right = initialValue; - res = find_operator(compiler_string_consts.assign_name, left, right, loopVariableLocation); + res = find_operator(StringConstants.assign_name, left, right, loopVariableLocation); head_stmts.statements.AddElement(res); } diff --git a/TreeConverter/TreeConversion/SyntaxTreeVisitorNodes/Patterns.cs b/TreeConverter/TreeConversion/SyntaxTreeVisitorNodes/Patterns.cs index b9741cb4b..6e7275d16 100644 --- a/TreeConverter/TreeConversion/SyntaxTreeVisitorNodes/Patterns.cs +++ b/TreeConverter/TreeConversion/SyntaxTreeVisitorNodes/Patterns.cs @@ -32,7 +32,7 @@ namespace PascalABCCompiler.TreeConverter var parameterTypes = variableDefinitions.Select(x => x.vars_type == null ? null : convert_strong(x.vars_type)).ToArray(); List candidates = new List(); List deducedParametersList = new List(); - var allDeconstructs = patternInstance.type.find_in_type(compiler_string_consts.deconstruct_method_name, context.CurrentScope); + var allDeconstructs = patternInstance.type.find_in_type(StringConstants.deconstruct_method_name, context.CurrentScope); if (allDeconstructs == null) { AddError(get_location(deconstruction), "NO_DECONSTRUCT_FOUND"); @@ -158,7 +158,7 @@ namespace PascalABCCompiler.TreeConverter type2 != null && convertion_data_and_alghoritms.possible_equal_types(type1, type2); - private bool IsSelfParameter(parameter parameter) => parameter.name.ToLower() == compiler_string_consts.self_word; + private bool IsSelfParameter(parameter parameter) => parameter.name.ToLower() == StringConstants.self_word; private void RemoveDefaultDeconstruct(List candidates) { diff --git a/TreeConverter/TreeConversion/compilation_context.cs b/TreeConverter/TreeConversion/compilation_context.cs index 540d686d6..15499d5de 100644 --- a/TreeConverter/TreeConversion/compilation_context.cs +++ b/TreeConverter/TreeConversion/compilation_context.cs @@ -477,27 +477,27 @@ namespace PascalABCCompiler.TreeConverter { if (instance.TypedSets.ContainsKey(tctn.element_type)) return instance.TypedSets[tctn.element_type]; instance.TypedSets.Add(tctn.element_type,tctn); - tctn.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(tctn,PascalABCCompiler.SemanticTree.basic_function_type.objassign))); - tctn.scope.AddSymbol(compiler_string_consts.plus_name, SystemLibrary.SystemLibInitializer.SetUnionProcedure.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.mul_name, SystemLibrary.SystemLibInitializer.SetIntersectProcedure.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.in_name, SystemLibrary.SystemLibInitializer.InSetProcedure.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.minus_name, SystemLibrary.SystemLibInitializer.SetSubtractProcedure.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.eq_name, SystemLibrary.SystemLibInitializer.CompareSetEquals.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.noteq_name, SystemLibrary.SystemLibInitializer.CompareSetInEquals.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.sm_name, SystemLibrary.SystemLibInitializer.CompareSetLess.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.smeq_name, SystemLibrary.SystemLibInitializer.CompareSetLessEqual.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.gr_name, SystemLibrary.SystemLibInitializer.CompareSetGreater.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.greq_name, SystemLibrary.SystemLibInitializer.CompareSetGreaterEqual.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.plusassign_name,new SymbolInfo(make_set_plus_assign(tctn))); - tctn.scope.AddSymbol(compiler_string_consts.minusassign_name,new SymbolInfo(make_set_minus_assign(tctn))); - tctn.scope.AddSymbol(compiler_string_consts.multassign_name,new SymbolInfo(make_set_mult_assign(tctn))); + tctn.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(tctn,PascalABCCompiler.SemanticTree.basic_function_type.objassign))); + tctn.scope.AddSymbol(StringConstants.plus_name, SystemLibrary.SystemLibInitializer.SetUnionProcedure.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.mul_name, SystemLibrary.SystemLibInitializer.SetIntersectProcedure.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.in_name, SystemLibrary.SystemLibInitializer.InSetProcedure.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.minus_name, SystemLibrary.SystemLibInitializer.SetSubtractProcedure.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.eq_name, SystemLibrary.SystemLibInitializer.CompareSetEquals.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.noteq_name, SystemLibrary.SystemLibInitializer.CompareSetInEquals.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.sm_name, SystemLibrary.SystemLibInitializer.CompareSetLess.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.smeq_name, SystemLibrary.SystemLibInitializer.CompareSetLessEqual.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.gr_name, SystemLibrary.SystemLibInitializer.CompareSetGreater.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.greq_name, SystemLibrary.SystemLibInitializer.CompareSetGreaterEqual.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.plusassign_name,new SymbolInfo(make_set_plus_assign(tctn))); + tctn.scope.AddSymbol(StringConstants.minusassign_name,new SymbolInfo(make_set_minus_assign(tctn))); + tctn.scope.AddSymbol(StringConstants.multassign_name,new SymbolInfo(make_set_mult_assign(tctn))); return tctn; } public static void AddTypeToShortStringTypeList(type_node tn) { instance.ShortStringTypes.Add((tn as short_string_type_node).Length,tn as short_string_type_node); - tn.add_name(compiler_string_consts.plus_name,new SymbolInfo(SystemLibrary.SystemLibrary.string_add)); + tn.add_name(StringConstants.plus_name,new SymbolInfo(SystemLibrary.SystemLibrary.string_add)); } public void pop_top_function() @@ -926,9 +926,9 @@ namespace PascalABCCompiler.TreeConverter var ntr = new SyntaxTree.named_type_reference(); for (var i = 0; i < meth_name.ln.Count; i++) ntr.Add(meth_name.ln[i]); - if (num_template_args>0 && ! ntr.names[meth_name.ln.Count-1].name.Contains(compiler_string_consts.generic_params_infix)) + if (num_template_args>0 && ! ntr.names[meth_name.ln.Count-1].name.Contains(StringConstants.generic_params_infix)) { - ntr.names[meth_name.ln.Count-1].name += compiler_string_consts.generic_params_infix + num_template_args; + ntr.names[meth_name.ln.Count-1].name += StringConstants.generic_params_infix + num_template_args; } sil = find_definition_node(ntr, loc); // если не нашли, то ошибка будет неправильной с неправильным именем - надо исправить @@ -937,11 +937,11 @@ namespace PascalABCCompiler.TreeConverter { if (num_template_args != 0) { - string template_type_name = type_name + compiler_string_consts.generic_params_infix + num_template_args.ToString(); + string template_type_name = type_name + StringConstants.generic_params_infix + num_template_args.ToString(); sil = find(template_type_name); /*if (si == null || si.sym_info.general_node_type != general_node_type.template_type) { - type_name = type_name + compiler_string_consts.generic_params_infix + num_template_args.ToString(); + type_name = type_name + StringConstants.generic_params_infix + num_template_args.ToString(); si = null; }*/ } @@ -1042,7 +1042,7 @@ namespace PascalABCCompiler.TreeConverter internal void add_notequal_operator_if_need(bool not_add_body= false) { - List si_list = _ctn.find_in_type(compiler_string_consts.noteq_name); + List si_list = _ctn.find_in_type(StringConstants.noteq_name); common_method_node cmn = null; common_parameter prm1 = null; common_parameter prm2 = null; @@ -1059,7 +1059,7 @@ namespace PascalABCCompiler.TreeConverter SymbolTable.ClassMethodScope scope = convertion_data_and_alghoritms.symbol_table.CreateClassMethodScope(_ctn.scope, _cmn.scope, null, si.ToString()); if (cmn == null) { - cmn = new common_method_node(compiler_string_consts.GetNETOperName(compiler_string_consts.noteq_name), SystemLibrary.SystemLibrary.bool_type, null, _ctn, + cmn = new common_method_node(StringConstants.GetNETOperName(StringConstants.noteq_name), SystemLibrary.SystemLibrary.bool_type, null, _ctn, SemanticTree.polymorphic_state.ps_static, SemanticTree.field_access_level.fal_public, scope); cmn.IsOperator = true; prm1 = new common_parameter("a", _ctn, SemanticTree.parameter_type.value, cmn, concrete_parameter_type.cpt_none, null, null); @@ -1068,7 +1068,7 @@ namespace PascalABCCompiler.TreeConverter cmn.parameters.AddElement(prm2); cmn.is_overload = true; _ctn.methods.AddElement(cmn); - _ctn.Scope.AddSymbol(compiler_string_consts.noteq_name, new SymbolInfo(cmn)); + _ctn.Scope.AddSymbol(StringConstants.noteq_name, new SymbolInfo(cmn)); } else { @@ -1084,7 +1084,7 @@ namespace PascalABCCompiler.TreeConverter continue; expression_node left = new class_field_reference(cf,new common_parameter_reference(prm1,0,null),null); expression_node right = new class_field_reference(cf,new common_parameter_reference(prm2,0,null),null); - expression_node cond = SystemLibrary.SystemLibrary.syn_visitor.find_operator(compiler_string_consts.noteq_name, + expression_node cond = SystemLibrary.SystemLibrary.syn_visitor.find_operator(StringConstants.noteq_name, left,right,null); //basic_function_call bfc = new basic_function_call(SystemLibrary.SystemLibrary.bool_not as basic_function_node,null); //bfc.parameters.AddElement(cond); @@ -1098,7 +1098,7 @@ namespace PascalABCCompiler.TreeConverter internal void add_equal_operator_if_need(bool not_add_body=false) { - List si_list = _ctn.find_in_type(compiler_string_consts.eq_name); + List si_list = _ctn.find_in_type(StringConstants.eq_name); common_method_node cmn = null; common_parameter prm1 = null; common_parameter prm2 = null; @@ -1115,7 +1115,7 @@ namespace PascalABCCompiler.TreeConverter SymbolTable.ClassMethodScope scope = convertion_data_and_alghoritms.symbol_table.CreateClassMethodScope( _ctn.scope, _cmn.scope, null, si.ToString()); if (cmn == null) { - cmn = new common_method_node(compiler_string_consts.GetNETOperName(compiler_string_consts.eq_name), SystemLibrary.SystemLibrary.bool_type, null, _ctn, + cmn = new common_method_node(StringConstants.GetNETOperName(StringConstants.eq_name), SystemLibrary.SystemLibrary.bool_type, null, _ctn, SemanticTree.polymorphic_state.ps_static, SemanticTree.field_access_level.fal_public, scope); cmn.IsOperator = true; prm1 = new common_parameter("a", _ctn, SemanticTree.parameter_type.value, cmn, concrete_parameter_type.cpt_none, null, null); @@ -1124,7 +1124,7 @@ namespace PascalABCCompiler.TreeConverter cmn.parameters.AddElement(prm2); cmn.is_overload = true; _ctn.methods.AddElement(cmn); - _ctn.Scope.AddSymbol(compiler_string_consts.eq_name, new SymbolInfo(cmn)); + _ctn.Scope.AddSymbol(StringConstants.eq_name, new SymbolInfo(cmn)); } else { @@ -1140,7 +1140,7 @@ namespace PascalABCCompiler.TreeConverter continue; expression_node left = new class_field_reference(cf,new common_parameter_reference(prm1,0,null),null); expression_node right = new class_field_reference(cf,new common_parameter_reference(prm2,0,null),null); - expression_node cond = SystemLibrary.SystemLibrary.syn_visitor.find_operator(compiler_string_consts.eq_name, + expression_node cond = SystemLibrary.SystemLibrary.syn_visitor.find_operator(StringConstants.eq_name, left,right,null); basic_function_call bfc = new basic_function_call(SystemLibrary.SystemLibrary.bool_not as basic_function_node,null); bfc.parameters.AddElement(cond); @@ -1175,7 +1175,7 @@ namespace PascalABCCompiler.TreeConverter public SymbolInfo create_special_names() { SymbolInfo si= new SymbolInfo(top_function.return_variable); - top_function.scope.AddSymbol(compiler_string_consts.result_variable_name, si); + top_function.scope.AddSymbol(StringConstants.result_variable_name, si); return si; } @@ -1337,7 +1337,7 @@ namespace PascalABCCompiler.TreeConverter } case block_type.compiled_type_block: { - //string cname = compiler_string_consts.GetConnectedFunctionName(_compiled_tn.name, name); + //string cname = StringConstants.GetConnectedFunctionName(_compiled_tn.name, name); common_namespace_function_node cnfnn; SymbolTable.Scope scope = convertion_data_and_alghoritms.symbol_table.CreateClassMethodScope(_compiled_tn.scope, _cmn.scope, null, name); cnfnn = new common_namespace_function_node(name, def_loc, _cmn, scope); @@ -1475,7 +1475,7 @@ namespace PascalABCCompiler.TreeConverter { if (TypedFiles.ContainsKey(elem_type)) return TypedFiles[elem_type]; - string name = compiler_string_consts.GetTypedFileTypeName(elem_type.name); + string name = StringConstants.GetTypedFileTypeName(elem_type.name); type_node base_type = SystemLibrary.SystemLibInitializer.TypedFileType.sym_info as type_node; //check_name_free(name, def_loc); SymbolTable.ClassScope scope = convertion_data_and_alghoritms.symbol_table.CreateClassScope(_cmn.scope, null, name); @@ -1499,7 +1499,7 @@ namespace PascalABCCompiler.TreeConverter { if (TypedSets.ContainsKey(elem_type)) return TypedSets[elem_type]; - string name = compiler_string_consts.GetSetTypeName(elem_type.name); + string name = StringConstants.GetSetTypeName(elem_type.name); type_node base_type = SystemLibrary.SystemLibInitializer.TypedSetType.sym_info as type_node; //check_name_free(name, def_loc); SymbolTable.ClassScope scope = convertion_data_and_alghoritms.symbol_table.CreateClassScope(_cmn.scope, null, "set_type " + name); @@ -1512,21 +1512,21 @@ namespace PascalABCCompiler.TreeConverter tctn.internal_is_value = base_type.is_value; tctn.is_class = base_type.is_class; tctn.SetBaseType(base_type); - tctn.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(tctn,PascalABCCompiler.SemanticTree.basic_function_type.objassign))); - tctn.ImplementingInterfaces.Add(compiled_type_node.get_type_node(NetHelper.NetHelper.FindType(compiler_string_consts.IEnumerableInterfaceName))); - tctn.scope.AddSymbol(compiler_string_consts.plus_name, SystemLibrary.SystemLibInitializer.SetUnionProcedure.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.mul_name, SystemLibrary.SystemLibInitializer.SetIntersectProcedure.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.in_name, SystemLibrary.SystemLibInitializer.InSetProcedure.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.minus_name, SystemLibrary.SystemLibInitializer.SetSubtractProcedure.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.eq_name, SystemLibrary.SystemLibInitializer.CompareSetEquals.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.noteq_name, SystemLibrary.SystemLibInitializer.CompareSetInEquals.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.sm_name, SystemLibrary.SystemLibInitializer.CompareSetLess.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.smeq_name, SystemLibrary.SystemLibInitializer.CompareSetLessEqual.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.gr_name, SystemLibrary.SystemLibInitializer.CompareSetGreater.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.greq_name, SystemLibrary.SystemLibInitializer.CompareSetGreaterEqual.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.plusassign_name,new SymbolInfo(make_set_plus_assign(tctn))); - tctn.scope.AddSymbol(compiler_string_consts.minusassign_name,new SymbolInfo(make_set_minus_assign(tctn))); - tctn.scope.AddSymbol(compiler_string_consts.multassign_name,new SymbolInfo(make_set_mult_assign(tctn))); + tctn.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(tctn,PascalABCCompiler.SemanticTree.basic_function_type.objassign))); + tctn.ImplementingInterfaces.Add(compiled_type_node.get_type_node(NetHelper.NetHelper.FindType(StringConstants.IEnumerableInterfaceName))); + tctn.scope.AddSymbol(StringConstants.plus_name, SystemLibrary.SystemLibInitializer.SetUnionProcedure.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.mul_name, SystemLibrary.SystemLibInitializer.SetIntersectProcedure.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.in_name, SystemLibrary.SystemLibInitializer.InSetProcedure.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.minus_name, SystemLibrary.SystemLibInitializer.SetSubtractProcedure.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.eq_name, SystemLibrary.SystemLibInitializer.CompareSetEquals.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.noteq_name, SystemLibrary.SystemLibInitializer.CompareSetInEquals.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.sm_name, SystemLibrary.SystemLibInitializer.CompareSetLess.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.smeq_name, SystemLibrary.SystemLibInitializer.CompareSetLessEqual.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.gr_name, SystemLibrary.SystemLibInitializer.CompareSetGreater.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.greq_name, SystemLibrary.SystemLibInitializer.CompareSetGreaterEqual.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.plusassign_name,new SymbolInfo(make_set_plus_assign(tctn))); + tctn.scope.AddSymbol(StringConstants.minusassign_name,new SymbolInfo(make_set_minus_assign(tctn))); + tctn.scope.AddSymbol(StringConstants.multassign_name,new SymbolInfo(make_set_mult_assign(tctn))); converted_namespace.types.AddElement(tctn); TypedSets.Add(elem_type, tctn); return tctn; @@ -1535,7 +1535,7 @@ namespace PascalABCCompiler.TreeConverter private static basic_function_node make_set_plus_assign(common_type_node ctn) { //basic_function_node bfn = new basic_function_node(SemanticTree.basic_function_type.objassign,ctn,false); - basic_function_node bfn = SystemLibrary.SystemLibrary.make_binary_operator(compiler_string_consts.plusassign_name,ctn,SemanticTree.basic_function_type.objassign); + basic_function_node bfn = SystemLibrary.SystemLibrary.make_binary_operator(StringConstants.plusassign_name,ctn,SemanticTree.basic_function_type.objassign); bfn.compile_time_executor = SystemLibrary.static_executors.set_plusassign_executor; return bfn; } @@ -1543,7 +1543,7 @@ namespace PascalABCCompiler.TreeConverter private static basic_function_node make_set_minus_assign(common_type_node ctn) { //basic_function_node bfn = new basic_function_node(SemanticTree.basic_function_type.objassign,ctn,false); - basic_function_node bfn = SystemLibrary.SystemLibrary.make_binary_operator(compiler_string_consts.minusassign_name,ctn,SemanticTree.basic_function_type.objassign); + basic_function_node bfn = SystemLibrary.SystemLibrary.make_binary_operator(StringConstants.minusassign_name,ctn,SemanticTree.basic_function_type.objassign); bfn.compile_time_executor = SystemLibrary.static_executors.set_subassign_executor; return bfn; } @@ -1551,14 +1551,14 @@ namespace PascalABCCompiler.TreeConverter private static basic_function_node make_set_mult_assign(common_type_node ctn) { //basic_function_node bfn = new basic_function_node(SemanticTree.basic_function_type.objassign,ctn,false); - basic_function_node bfn = SystemLibrary.SystemLibrary.make_binary_operator(compiler_string_consts.multassign_name,ctn,SemanticTree.basic_function_type.objassign); + basic_function_node bfn = SystemLibrary.SystemLibrary.make_binary_operator(StringConstants.multassign_name,ctn,SemanticTree.basic_function_type.objassign); bfn.compile_time_executor = SystemLibrary.static_executors.set_multassign_executor; return bfn; } private static basic_function_node make_short_string_plus_assign(short_string_type_node ctn) { - basic_function_node bfn = SystemLibrary.SystemLibrary.make_binary_operator(compiler_string_consts.plusassign_name,ctn,SemanticTree.basic_function_type.objassign); + basic_function_node bfn = SystemLibrary.SystemLibrary.make_binary_operator(StringConstants.plusassign_name,ctn,SemanticTree.basic_function_type.objassign); bfn.compile_time_executor = SystemLibrary.static_executors.short_string_addassign_executor; return bfn; } @@ -1591,9 +1591,9 @@ namespace PascalABCCompiler.TreeConverter SymbolTable.ClassScope scope = convertion_data_and_alghoritms.symbol_table.CreateClassScope(null, SystemLibrary.SystemLibrary.string_type.Scope, "short_string_type"); short_string_type_node tctn = new short_string_type_node(//SemanticTree.type_access_level.tal_public, _cmn, scope, def_loc, length); - tctn.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(tctn,PascalABCCompiler.SemanticTree.basic_function_type.objassign))); - tctn.add_name(compiler_string_consts.plus_name,new SymbolInfo(SystemLibrary.SystemLibrary.string_add)); - tctn.scope.AddSymbol(compiler_string_consts.plusassign_name,new SymbolInfo(make_short_string_plus_assign(tctn))); + tctn.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(tctn,PascalABCCompiler.SemanticTree.basic_function_type.objassign))); + tctn.add_name(StringConstants.plus_name,new SymbolInfo(SystemLibrary.SystemLibrary.string_add)); + tctn.scope.AddSymbol(StringConstants.plusassign_name,new SymbolInfo(make_short_string_plus_assign(tctn))); type_intersection_node inter = new type_intersection_node(type_compare.greater_type); inter.another_to_this = new type_conversion(SystemLibrary.SystemLibrary.char_to_string); tctn.add_intersection_node(SystemLibrary.SystemLibrary.char_type, inter,false); @@ -1628,7 +1628,7 @@ namespace PascalABCCompiler.TreeConverter public void create_generic_indicator(common_type_node generic) { generic_indicator gi = new generic_indicator(generic); - int pos = generic.name.LastIndexOf(compiler_string_consts.generic_params_infix); + int pos = generic.name.LastIndexOf(StringConstants.generic_params_infix); string name = generic.name.Substring(0, pos); _cmn.scope.AddSymbol(name, new SymbolInfo(gi, access_level.al_public, symbol_kind.sk_none)); } @@ -1698,7 +1698,7 @@ namespace PascalABCCompiler.TreeConverter { namespace_variable nv = new namespace_variable(name + "$", tn, converted_namespace, loc); common_namespace_event cne = new common_namespace_event(name, tn, converted_namespace, null, null, null, loc); - common_namespace_function_node add_func = new common_namespace_function_node(compiler_string_consts.GetAddHandler(name), + common_namespace_function_node add_func = new common_namespace_function_node(StringConstants.GetAddHandler(name), null, this.converted_namespace, null); common_parameter cp = new common_parameter("value", tn, SemanticTree.parameter_type.value, add_func, concrete_parameter_type.cpt_none, null, null); add_func.parameters.AddElement(cp); @@ -1706,18 +1706,18 @@ namespace PascalABCCompiler.TreeConverter fld_ref = new namespace_variable_reference(nv, null); expression_node en = this.syntax_tree_visitor.convertion_data_and_alghoritms.type_constructor.delegate_add_assign_compile_time_executor (null, new expression_node[2] { fld_ref, new common_parameter_reference(cp, 0, null) }); - //en = this.syntax_tree_visitor.convertion_data_and_alghoritms.create_simple_function_call(tn.find_in_type(compiler_string_consts.assign_name).sym_info as function_node,null, + //en = this.syntax_tree_visitor.convertion_data_and_alghoritms.create_simple_function_call(tn.find_in_type(StringConstants.assign_name).sym_info as function_node,null, // fld_ref,en); add_func.function_code = new statements_list(null); (add_func.function_code as statements_list).statements.AddElement(en); //remove - common_namespace_function_node remove_func = new common_namespace_function_node(compiler_string_consts.GetRemoveHandler(name), null, this.converted_namespace, null); + common_namespace_function_node remove_func = new common_namespace_function_node(StringConstants.GetRemoveHandler(name), null, this.converted_namespace, null); cp = new common_parameter("value", tn, SemanticTree.parameter_type.value, add_func, concrete_parameter_type.cpt_none, null, null); remove_func.parameters.AddElement(cp); en = this.syntax_tree_visitor.convertion_data_and_alghoritms.type_constructor.delegate_sub_assign_compile_time_executor (null, new expression_node[2] { fld_ref, new common_parameter_reference(cp, 0, null) }); - //en = this.syntax_tree_visitor.convertion_data_and_alghoritms.create_simple_function_call(tn.find_in_type(compiler_string_consts.assign_name).sym_info as function_node,null, + //en = this.syntax_tree_visitor.convertion_data_and_alghoritms.create_simple_function_call(tn.find_in_type(StringConstants.assign_name).sym_info as function_node,null, // fld_ref,en); remove_func.function_code = new statements_list(null); (remove_func.function_code as statements_list).statements.AddElement(en); @@ -1737,7 +1737,7 @@ namespace PascalABCCompiler.TreeConverter class_field cf = new class_field(name + "$", tn, converted_type, ps, _fal, loc); common_event ce = new common_event(name, tn, converted_type, null, null, null, _fal, ps, loc); //add - common_method_node add_meth = new common_method_node(compiler_string_consts.GetAddHandler(name), null, this.converted_type, + common_method_node add_meth = new common_method_node(StringConstants.GetAddHandler(name), null, this.converted_type, ps, SemanticTree.field_access_level.fal_public, null); common_parameter cp = new common_parameter("value", tn, SemanticTree.parameter_type.value, add_meth, concrete_parameter_type.cpt_none, null, null); add_meth.parameters.AddElement(cp); @@ -1754,7 +1754,7 @@ namespace PascalABCCompiler.TreeConverter } converted_type.scope.AddSymbol(add_meth.name, new SymbolInfo(add_meth)); //remove - common_method_node remove_meth = new common_method_node(compiler_string_consts.GetRemoveHandler(name), null, this.converted_type, + common_method_node remove_meth = new common_method_node(StringConstants.GetRemoveHandler(name), null, this.converted_type, ps, SemanticTree.field_access_level.fal_public, null); cp = new common_parameter("value", tn, SemanticTree.parameter_type.value, add_meth, concrete_parameter_type.cpt_none, null, null); @@ -1949,13 +1949,13 @@ namespace PascalABCCompiler.TreeConverter public string get_delegate_type_name() { - return (compiler_string_consts.delegate_type_name_template + _num_for_delegates++); + return (StringConstants.delegate_type_name_template + _num_for_delegates++); } public var_definition_node create_for_temp_variable(type_node type,location loc) { num_of_for_cycles=num_of_for_cycles+1; - string name=compiler_string_consts.temp_for_variable_name+num_of_for_cycles.ToString(); + string name=StringConstants.temp_for_variable_name+num_of_for_cycles.ToString(); //return create_temp_variable(name,type,loc); return add_var_definition(name, loc, type, SemanticTree.polymorphic_state.ps_common); } @@ -2048,10 +2048,10 @@ namespace PascalABCCompiler.TreeConverter public static void add_convertions_to_enum_type(common_type_node tctn) { - SystemLibrary.SystemLibrary.make_binary_operator(compiler_string_consts.gr_name,tctn,SemanticTree.basic_function_type.enumgr,SystemLibrary.SystemLibrary.bool_type); - SystemLibrary.SystemLibrary.make_binary_operator(compiler_string_consts.greq_name,tctn,SemanticTree.basic_function_type.enumgreq,SystemLibrary.SystemLibrary.bool_type); - SystemLibrary.SystemLibrary.make_binary_operator(compiler_string_consts.sm_name,tctn,SemanticTree.basic_function_type.enumsm,SystemLibrary.SystemLibrary.bool_type); - SystemLibrary.SystemLibrary.make_binary_operator(compiler_string_consts.smeq_name,tctn,SemanticTree.basic_function_type.enumsmeq,SystemLibrary.SystemLibrary.bool_type); + SystemLibrary.SystemLibrary.make_binary_operator(StringConstants.gr_name,tctn,SemanticTree.basic_function_type.enumgr,SystemLibrary.SystemLibrary.bool_type); + SystemLibrary.SystemLibrary.make_binary_operator(StringConstants.greq_name,tctn,SemanticTree.basic_function_type.enumgreq,SystemLibrary.SystemLibrary.bool_type); + SystemLibrary.SystemLibrary.make_binary_operator(StringConstants.sm_name,tctn,SemanticTree.basic_function_type.enumsm,SystemLibrary.SystemLibrary.bool_type); + SystemLibrary.SystemLibrary.make_binary_operator(StringConstants.smeq_name,tctn,SemanticTree.basic_function_type.enumsmeq,SystemLibrary.SystemLibrary.bool_type); SystemLibrary.SystemLibrary.make_generated_type_conversion(tctn,SystemLibrary.SystemLibrary.byte_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.itob,false); SystemLibrary.SystemLibrary.make_generated_type_conversion(tctn,SystemLibrary.SystemLibrary.sbyte_type,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.itosb,false); @@ -2163,12 +2163,12 @@ namespace PascalABCCompiler.TreeConverter { for (int i = 0; i < arr.element_values.Count; i++) { - //arr.element_values[i] = syntax_tree_visitor.find_operator(compiler_string_consts.assign_name, varref2, arr.element_values[i], null); + //arr.element_values[i] = syntax_tree_visitor.find_operator(StringConstants.assign_name, varref2, arr.element_values[i], null); arr.element_values[i] = convertion_data_and_alghoritms.create_simple_function_call(SystemLibrary.SystemLibInitializer.ClipShortStringProcedure.sym_info as function_node, null, convertion_data_and_alghoritms.convert_type(arr.element_values[i], SystemLibrary.SystemLibrary.string_type), new int_const_node((vdn.type.element_type as short_string_type_node).Length, null)); } } } - CurrentStatementList.statements.AddElement(syntax_tree_visitor.find_operator(compiler_string_consts.assign_name, expr, userInitalValue, lid)); + CurrentStatementList.statements.AddElement(syntax_tree_visitor.find_operator(StringConstants.assign_name, expr, userInitalValue, lid)); if (vdn.type.type_special_kind == SemanticTree.type_special_kind.set_type) { expr.type = SystemLibrary.SystemLibInitializer.TypedSetType.sym_info as type_node; @@ -2184,7 +2184,7 @@ namespace PascalABCCompiler.TreeConverter if (vdn.type.type_special_kind == SemanticTree.type_special_kind.short_string) { expression_node varref2 = convertion_data_and_alghoritms.CreateVariableReference(vdn, null); - userInitalValue = syntax_tree_visitor.find_operator(compiler_string_consts.assign_name, varref2, userInitalValue, null); + userInitalValue = syntax_tree_visitor.find_operator(StringConstants.assign_name, varref2, userInitalValue, null); } return userInitalValue; } @@ -2196,7 +2196,7 @@ namespace PascalABCCompiler.TreeConverter expression_node varref2 = convertion_data_and_alghoritms.CreateVariableReference(vdn, null); for (int i=0; i sil = generic_def.scope.FindOnlyInScope(stat_ctor_name); common_method_node stat_ctor; if (sil == null) @@ -3282,7 +3282,7 @@ namespace PascalABCCompiler.TreeConverter } if (convertion_data_and_alghoritms.function_eq_params(fn, compar, false) && fn.is_extension_method == compar.is_extension_method) { - if (fn.IsOperator && (fn.name == compiler_string_consts.explicit_operator_name || fn.name == compiler_string_consts.implicit_operator_name)) + if (fn.IsOperator && (fn.name == StringConstants.explicit_operator_name || fn.name == StringConstants.implicit_operator_name)) { if (convertion_data_and_alghoritms.function_eq_params_and_result(fn, compar)) AddError(new FunctionDuplicateDefinition(compar, fn)); @@ -3395,7 +3395,7 @@ namespace PascalABCCompiler.TreeConverter common_method_node cmnode = compar as common_method_node; if (cmnode != null) { - List si_local = cfn11.scope.FindOnlyInScope(compiler_string_consts.self_word); + List si_local = cfn11.scope.FindOnlyInScope(StringConstants.self_word); if (si_local != null) { si_local.FirstOrDefault().sym_info = cmnode.self_variable; @@ -3577,7 +3577,7 @@ namespace PascalABCCompiler.TreeConverter } if (convertion_data_and_alghoritms.function_eq_params(fn,compar,false)) { - if (fn.IsOperator && (fn.name == compiler_string_consts.explicit_operator_name || fn.name == compiler_string_consts.implicit_operator_name)) + if (fn.IsOperator && (fn.name == StringConstants.explicit_operator_name || fn.name == StringConstants.implicit_operator_name)) { if (convertion_data_and_alghoritms.function_eq_params_and_result(fn,compar)) AddError(new FunctionDuplicateDefinition(compar, fn)); diff --git a/TreeConverter/TreeConversion/convertion_data_and_alghoritms.cs b/TreeConverter/TreeConversion/convertion_data_and_alghoritms.cs index c32141694..523849a21 100644 --- a/TreeConverter/TreeConversion/convertion_data_and_alghoritms.cs +++ b/TreeConverter/TreeConversion/convertion_data_and_alghoritms.cs @@ -1085,7 +1085,7 @@ namespace PascalABCCompiler.TreeConverter internal_interface ii = cmc.obj.type.get_internal_interface(internal_interface_kind.bounded_array_interface); if (ii != null) { - if (cmc.function_node.name == compiler_string_consts.get_val_pascal_array_name) + if (cmc.function_node.name == StringConstants.get_val_pascal_array_name) { bounded_array_interface bai = (bounded_array_interface)ii; class_field cf = bai.int_array; @@ -1160,7 +1160,7 @@ namespace PascalABCCompiler.TreeConverter expression_node to = new simple_array_indexing(tc.var_ref,//factparams[formalparams.Count - 1], new int_const_node(i - formalparams.Count + 1, factparams[i].location), aii.element_type, factparams[i].location); expression_node from = factparams[i]; - statement_node stat = syntax_tree_visitor.find_operator(compiler_string_consts.assign_name, to, from, factparams[i].location); + statement_node stat = syntax_tree_visitor.find_operator(StringConstants.assign_name, to, from, factparams[i].location); tc.snl.AddElement(stat); } @@ -1195,7 +1195,7 @@ namespace PascalABCCompiler.TreeConverter expression_node to = new simple_array_indexing(tc.var_ref,//factparams[formalparams.Count - 1], new int_const_node(i - formalparams.Count + 1, factparams[i].location), aii.element_type, factparams[i].location); expression_node from = factparams[i]; - statement_node stat = syntax_tree_visitor.find_operator(compiler_string_consts.assign_name, to, from, factparams[i].location); + statement_node stat = syntax_tree_visitor.find_operator(StringConstants.assign_name, to, from, factparams[i].location); tc.snl.AddElement(stat); } @@ -1270,7 +1270,7 @@ namespace PascalABCCompiler.TreeConverter new int_const_node(i - formalparams.Count + 1, factparams[i].location), aii.element_type, factparams[i].location); expression_node from = create_simple_function_call(ptc.first.convertion_method, factparams[i].location, factparams[i]); - statement_node stat = syntax_tree_visitor.find_operator(compiler_string_consts.assign_name, to, from, factparams[i].location); + statement_node stat = syntax_tree_visitor.find_operator(StringConstants.assign_name, to, from, factparams[i].location); tc.snl.AddElement(stat); } } @@ -2187,8 +2187,8 @@ namespace PascalABCCompiler.TreeConverter bool is_alone_method_defined = (functions.Count() == 1); function_node first_function = functions.FirstOrDefault().sym_info as function_node; - bool _is_assigment = first_function.name == compiler_string_consts.assign_name; - bool is_op = compiler_string_consts.GetNETOperName(first_function.name) != null || first_function.name.ToLower() == "in"; + bool _is_assigment = first_function.name == StringConstants.assign_name; + bool is_op = StringConstants.GetNETOperName(first_function.name) != null || first_function.name.ToLower() == "in"; basic_function_node _tmp_bfn = functions.FirstOrDefault().sym_info as basic_function_node; List indefinits = new List(); @@ -2197,7 +2197,7 @@ namespace PascalABCCompiler.TreeConverter { if (function.sym_info is compiled_function_node cfn0 && cfn0.comperehensive_type is compiled_type_node ctn0 && - (ctn0.compiled_type.Name == compiler_string_consts.pascalSystemUnitName + compiler_string_consts.ImplementationSectionNamespaceName || ctn0.compiled_type.Name == compiler_string_consts.pascalExtensionsUnitName + compiler_string_consts.ImplementationSectionNamespaceName) + (ctn0.compiled_type.Name == StringConstants.pascalSystemUnitName + StringConstants.ImplementationSectionNamespaceName || ctn0.compiled_type.Name == StringConstants.pascalExtensionsUnitName + StringConstants.ImplementationSectionNamespaceName) && !ctn0.compiled_type.Assembly.FullName.StartsWith("PABCRtl")) // пропустить функции (методы расширения), определенные в сборке в ПИ PABCSystem, но не в PABCRtl.dll continue; // В режиме only_from_not_extensions пропускать все extensions @@ -3185,7 +3185,7 @@ namespace PascalABCCompiler.TreeConverter private string get_return_variable_name(string function_name) { - return (compiler_string_consts.function_return_value_prefix+function_name); + return (StringConstants.function_return_value_prefix+function_name); } public void create_function_return_variable(common_function_node cfn, SymbolInfo ret_var) diff --git a/TreeConverter/TreeConversion/name_reflector.cs b/TreeConverter/TreeConversion/name_reflector.cs index 47ef49765..337bbe13a 100644 --- a/TreeConverter/TreeConversion/name_reflector.cs +++ b/TreeConverter/TreeConversion/name_reflector.cs @@ -14,61 +14,61 @@ namespace PascalABCCompiler.TreeConverter static name_reflector() { - ht.Add(((int)(SyntaxTree.Operators.LogicalAND)),compiler_string_consts.and_name); - ht.Add(((int)(SyntaxTree.Operators.Division)),compiler_string_consts.div_name); - ht.Add(((int)(SyntaxTree.Operators.IntegerDivision)),compiler_string_consts.idiv_name); - ht.Add(((int)(SyntaxTree.Operators.Equal)),compiler_string_consts.eq_name); - ht.Add(((int)(SyntaxTree.Operators.Greater)),compiler_string_consts.gr_name); - ht.Add(((int)(SyntaxTree.Operators.GreaterEqual)),compiler_string_consts.greq_name); - ht.Add(((int)(SyntaxTree.Operators.ModulusRemainder)),compiler_string_consts.mod_name); - ht.Add(((int)(SyntaxTree.Operators.Multiplication)),compiler_string_consts.mul_name); - ht.Add(((int)(SyntaxTree.Operators.LogicalNOT)),compiler_string_consts.not_name); - ht.Add(((int)(SyntaxTree.Operators.NotEqual)),compiler_string_consts.noteq_name); - ht.Add(((int)(SyntaxTree.Operators.LogicalOR)),compiler_string_consts.or_name); - ht.Add(((int)(SyntaxTree.Operators.Plus)),compiler_string_consts.plus_name); - ht.Add(((int)(SyntaxTree.Operators.BitwiseLeftShift)),compiler_string_consts.shl_name); - ht.Add(((int)(SyntaxTree.Operators.BitwiseRightShift)),compiler_string_consts.shr_name); - ht.Add(((int)(SyntaxTree.Operators.Less)),compiler_string_consts.sm_name); - ht.Add(((int)(SyntaxTree.Operators.LessEqual)),compiler_string_consts.smeq_name); - ht.Add(((int)(SyntaxTree.Operators.Minus)),compiler_string_consts.minus_name); - ht.Add(((int)(SyntaxTree.Operators.BitwiseXOR)),compiler_string_consts.xor_name); - ht.Add(((int)(SyntaxTree.Operators.AssignmentAddition)), compiler_string_consts.plusassign_name); - ht.Add(((int)(SyntaxTree.Operators.AssignmentSubtraction)), compiler_string_consts.minusassign_name); - ht.Add(((int)(SyntaxTree.Operators.AssignmentMultiplication)), compiler_string_consts.multassign_name); - ht.Add(((int)(SyntaxTree.Operators.AssignmentDivision)), compiler_string_consts.divassign_name); - ht.Add(((int)(SyntaxTree.Operators.Assignment)), compiler_string_consts.assign_name); - ht.Add(((int)(SyntaxTree.Operators.In)), compiler_string_consts.in_name); - ht.Add(((int)(SyntaxTree.Operators.Implicit)), compiler_string_consts.implicit_operator_name); - ht.Add(((int)(SyntaxTree.Operators.Explicit)), compiler_string_consts.explicit_operator_name); - ht.Add(((int)(SyntaxTree.Operators.Power)), compiler_string_consts.power_name); + ht.Add(((int)(SyntaxTree.Operators.LogicalAND)),StringConstants.and_name); + ht.Add(((int)(SyntaxTree.Operators.Division)),StringConstants.div_name); + ht.Add(((int)(SyntaxTree.Operators.IntegerDivision)),StringConstants.idiv_name); + ht.Add(((int)(SyntaxTree.Operators.Equal)),StringConstants.eq_name); + ht.Add(((int)(SyntaxTree.Operators.Greater)),StringConstants.gr_name); + ht.Add(((int)(SyntaxTree.Operators.GreaterEqual)),StringConstants.greq_name); + ht.Add(((int)(SyntaxTree.Operators.ModulusRemainder)),StringConstants.mod_name); + ht.Add(((int)(SyntaxTree.Operators.Multiplication)),StringConstants.mul_name); + ht.Add(((int)(SyntaxTree.Operators.LogicalNOT)), StringConstants.not_name); + ht.Add(((int)(SyntaxTree.Operators.NotEqual)),StringConstants.noteq_name); + ht.Add(((int)(SyntaxTree.Operators.LogicalOR)),StringConstants.or_name); + ht.Add(((int)(SyntaxTree.Operators.Plus)),StringConstants.plus_name); + ht.Add(((int)(SyntaxTree.Operators.BitwiseLeftShift)),StringConstants.shl_name); + ht.Add(((int)(SyntaxTree.Operators.BitwiseRightShift)),StringConstants.shr_name); + ht.Add(((int)(SyntaxTree.Operators.Less)),StringConstants.sm_name); + ht.Add(((int)(SyntaxTree.Operators.LessEqual)),StringConstants.smeq_name); + ht.Add(((int)(SyntaxTree.Operators.Minus)),StringConstants.minus_name); + ht.Add(((int)(SyntaxTree.Operators.BitwiseXOR)),StringConstants.xor_name); + ht.Add(((int)(SyntaxTree.Operators.AssignmentAddition)), StringConstants.plusassign_name); + ht.Add(((int)(SyntaxTree.Operators.AssignmentSubtraction)), StringConstants.minusassign_name); + ht.Add(((int)(SyntaxTree.Operators.AssignmentMultiplication)), StringConstants.multassign_name); + ht.Add(((int)(SyntaxTree.Operators.AssignmentDivision)), StringConstants.divassign_name); + ht.Add(((int)(SyntaxTree.Operators.Assignment)), StringConstants.assign_name); + ht.Add(((int)(SyntaxTree.Operators.In)), StringConstants.in_name); + ht.Add(((int)(SyntaxTree.Operators.Implicit)), StringConstants.implicit_operator_name); + ht.Add(((int)(SyntaxTree.Operators.Explicit)), StringConstants.explicit_operator_name); + ht.Add(((int)(SyntaxTree.Operators.Power)), StringConstants.power_name); - pc.Add(compiler_string_consts.and_name, 2); - pc.Add(compiler_string_consts.div_name, 2); - pc.Add(compiler_string_consts.idiv_name, 2); - pc.Add(compiler_string_consts.eq_name, 2); - pc.Add(compiler_string_consts.gr_name, 2); - pc.Add(compiler_string_consts.greq_name, 2); - pc.Add(compiler_string_consts.mod_name, 2); - pc.Add(compiler_string_consts.mul_name, 2); - pc.Add(compiler_string_consts.not_name, 1); - pc.Add(compiler_string_consts.noteq_name, 2); - pc.Add(compiler_string_consts.or_name, 2); - pc.Add(compiler_string_consts.plus_name, 2); - pc.Add(compiler_string_consts.shl_name, 2); - pc.Add(compiler_string_consts.shr_name, 2); - pc.Add(compiler_string_consts.sm_name, 2); - pc.Add(compiler_string_consts.smeq_name, 2); - pc.Add(compiler_string_consts.minus_name, 2); - pc.Add(compiler_string_consts.xor_name, 2); - pc.Add(compiler_string_consts.plusassign_name, 2); - pc.Add(compiler_string_consts.minusassign_name, 2); - pc.Add(compiler_string_consts.multassign_name, 2); - pc.Add(compiler_string_consts.divassign_name, 2); - pc.Add(compiler_string_consts.assign_name, 2); - pc.Add(compiler_string_consts.in_name, 2); - pc.Add(compiler_string_consts.power_name, 2); - pc.Add(compiler_string_consts.implicit_operator_name, 1); - pc.Add(compiler_string_consts.explicit_operator_name, 1); + pc.Add(StringConstants.and_name, 2); + pc.Add(StringConstants.div_name, 2); + pc.Add(StringConstants.idiv_name, 2); + pc.Add(StringConstants.eq_name, 2); + pc.Add(StringConstants.gr_name, 2); + pc.Add(StringConstants.greq_name, 2); + pc.Add(StringConstants.mod_name, 2); + pc.Add(StringConstants.mul_name, 2); + pc.Add(StringConstants.not_name, 1); + pc.Add(StringConstants.noteq_name, 2); + pc.Add(StringConstants.or_name, 2); + pc.Add(StringConstants.plus_name, 2); + pc.Add(StringConstants.shl_name, 2); + pc.Add(StringConstants.shr_name, 2); + pc.Add(StringConstants.sm_name, 2); + pc.Add(StringConstants.smeq_name, 2); + pc.Add(StringConstants.minus_name, 2); + pc.Add(StringConstants.xor_name, 2); + pc.Add(StringConstants.plusassign_name, 2); + pc.Add(StringConstants.minusassign_name, 2); + pc.Add(StringConstants.multassign_name, 2); + pc.Add(StringConstants.divassign_name, 2); + pc.Add(StringConstants.assign_name, 2); + pc.Add(StringConstants.in_name, 2); + pc.Add(StringConstants.power_name, 2); + pc.Add(StringConstants.implicit_operator_name, 1); + pc.Add(StringConstants.explicit_operator_name, 1); } public static string get_name(SyntaxTree.Operators ot) diff --git a/TreeConverter/TreeConversion/semantic_checks_for_sugar.cs b/TreeConverter/TreeConversion/semantic_checks_for_sugar.cs index 1d0d14f9f..a6b188094 100644 --- a/TreeConverter/TreeConversion/semantic_checks_for_sugar.cs +++ b/TreeConverter/TreeConversion/semantic_checks_for_sugar.cs @@ -104,7 +104,7 @@ namespace PascalABCCompiler.TreeConverter var semex = convert_strong(ex); var b = convertion_data_and_alghoritms.can_convert_type(semex, SystemLibrary.SystemLibrary.integer_type); var toIsIndex = (semex is common_constructor_call toCall) && - toCall.common_type.comprehensive_namespace.namespace_full_name.Equals(compiler_string_consts.pascalSystemUnitName) && + toCall.common_type.comprehensive_namespace.namespace_full_name.Equals(StringConstants.pascalSystemUnitName) && toCall.common_type.PrintableName.Equals("SystemIndex"); var toIsIndex1 = (semex is compiled_constructor_call toCall1) && @@ -260,7 +260,7 @@ namespace PascalABCCompiler.TreeConverter var semfrom = convert_strong(from); var fromIsIndex = (semfrom is common_constructor_call fromCall) && - fromCall.common_type.comprehensive_namespace.namespace_full_name.Equals(compiler_string_consts.pascalSystemUnitName) && + fromCall.common_type.comprehensive_namespace.namespace_full_name.Equals(StringConstants.pascalSystemUnitName) && fromCall.common_type.PrintableName.Equals("SystemIndex"); var b = convertion_data_and_alghoritms.can_convert_type(semfrom, SystemLibrary.SystemLibrary.integer_type); if (!b && !fromIsIndex) @@ -268,7 +268,7 @@ namespace PascalABCCompiler.TreeConverter var semto = convert_strong(to); var toIsIndex = (semto is common_constructor_call toCall) && - toCall.common_type.comprehensive_namespace.namespace_full_name.Equals(compiler_string_consts.pascalSystemUnitName) && + toCall.common_type.comprehensive_namespace.namespace_full_name.Equals(StringConstants.pascalSystemUnitName) && toCall.common_type.PrintableName.Equals("SystemIndex"); b = convertion_data_and_alghoritms.can_convert_type(semto, SystemLibrary.SystemLibrary.integer_type); if (!b && !toIsIndex) diff --git a/TreeConverter/TreeConversion/syntax_tree_visitor.cs b/TreeConverter/TreeConversion/syntax_tree_visitor.cs index 29ad6c2f6..d097a5781 100644 --- a/TreeConverter/TreeConversion/syntax_tree_visitor.cs +++ b/TreeConverter/TreeConversion/syntax_tree_visitor.cs @@ -315,93 +315,93 @@ namespace PascalABCCompiler.TreeConverter public static void init_system_module(common_unit_node psystem_unit) { - SystemLibrary.SystemLibInitializer.format_function = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.format_procedure_name); - SystemLibrary.SystemLibInitializer.read_procedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.read_procedure_name); - SystemLibrary.SystemLibInitializer.write_procedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.write_procedure_name); - SystemLibrary.SystemLibInitializer.writeln_procedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.writeln_procedure_name); - SystemLibrary.SystemLibInitializer.readln_procedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.readln_procedure_name); - SystemLibrary.SystemLibInitializer.TextFileType = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.text_file_name_type_name); - SystemLibrary.SystemLibInitializer.TextFileInitProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.TextFileInitProcedureName); - SystemLibrary.SystemLibInitializer.BinaryFileType = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.BinaryFileTypeName); - SystemLibrary.SystemLibInitializer.AbstractBinaryFileType = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.AbstractBinaryFileTypeName); - SystemLibrary.SystemLibInitializer.PointerOutputType = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.PointerOutputTypeName); - SystemLibrary.SystemLibInitializer.BinaryFileReadProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.BinaryFileReadProcedureName); - SystemLibrary.SystemLibInitializer.BinaryFileInitProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.BinaryFileInitProcedureName); - SystemLibrary.SystemLibInitializer.StringDefaultPropertySetProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.StringDefaultPropertySetProcedureName); - SystemLibrary.SystemLibInitializer.TypedFileType = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.TypedFileTypeName); - SystemLibrary.SystemLibInitializer.TypedFileInitProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.TypedFileInitProcedureName); - SystemLibrary.SystemLibInitializer.TypedFileReadProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.TypedFileReadProcedureName); - SystemLibrary.SystemLibInitializer.ClipShortStringProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.ClipShortString); - SystemLibrary.SystemLibInitializer.GetCharInShortStringProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.GetCharInShortString); - SystemLibrary.SystemLibInitializer.SetCharInShortStringProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.SetCharInShortString); - //SystemLibrary.SystemLibInitializer.ShortStringType = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.ShortStringTypeName); - //SystemLibrary.SystemLibInitializer.ShortStringTypeInitProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.ShortStringTypeInitProcedure); - SystemLibrary.SystemLibInitializer.TypedSetType = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.set_name); - SystemLibrary.SystemLibInitializer.TypedSetInitProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.TypedSetInitProcedure); - SystemLibrary.SystemLibInitializer.SetUnionProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.union_of_set); - SystemLibrary.SystemLibInitializer.SetIntersectProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.intersect_of_set); - SystemLibrary.SystemLibInitializer.SetSubtractProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.subtract_of_set); - SystemLibrary.SystemLibInitializer.InSetProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.in_set); - SystemLibrary.SystemLibInitializer.CreateSetProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.CreateSetProcedure); - SystemLibrary.SystemLibInitializer.IncludeProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.IncludeProcedure); - SystemLibrary.SystemLibInitializer.ExcludeProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.ExcludeProcedure); - SystemLibrary.SystemLibInitializer.DiapasonType = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.DiapasonType); - SystemLibrary.SystemLibInitializer.CreateDiapason = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.CreateDiapason); - SystemLibrary.SystemLibInitializer.CreateObjDiapason = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.CreateObjDiapason); - SystemLibrary.SystemLibInitializer.CompareSetEquals = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.CompareSetEquals); - SystemLibrary.SystemLibInitializer.CompareSetInEquals = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.CompareSetInEquals); - SystemLibrary.SystemLibInitializer.CompareSetLess = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.CompareSetLess); - SystemLibrary.SystemLibInitializer.CompareSetLessEqual = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.CompareSetLessEqual); - SystemLibrary.SystemLibInitializer.CompareSetGreater = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.CompareSetGreater); - SystemLibrary.SystemLibInitializer.CompareSetGreaterEqual = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.CompareSetGreaterEqual); - SystemLibrary.SystemLibInitializer.IncProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.IncProcedure); - SystemLibrary.SystemLibInitializer.DecProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.DecProcedure); - SystemLibrary.SystemLibInitializer.SuccFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.SuccFunction); - SystemLibrary.SystemLibInitializer.PredFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.PredFunction); - SystemLibrary.SystemLibInitializer.OrdFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.OrdFunction); - SystemLibrary.SystemLibInitializer.TypedSetInitProcedureWithBounds = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.TypedSetInitProcedureWithBounds); - SystemLibrary.SystemLibInitializer.TypedSetInitWithShortString = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.TypedSetInitWithShortString); - SystemLibrary.SystemLibInitializer.AssignSetProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.AssignSetProcedure); - SystemLibrary.SystemLibInitializer.AssignSetProcedureWithBounds = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.AssignSetProcedureWithBounds); - SystemLibrary.SystemLibInitializer.ClipProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.ClipProcedure); - SystemLibrary.SystemLibInitializer.ClipFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.ClipFunction); - SystemLibrary.SystemLibInitializer.ClipShortStringInSetFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.ClipShortStringInSetFunction); - SystemLibrary.SystemLibInitializer.ClipShortStringInSetProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.ClipShortStringInSetProcedure); - SystemLibrary.SystemLibInitializer.SetLengthForShortStringProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.set_length_for_short_string); - SystemLibrary.SystemLibInitializer.SetLengthProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.set_length_procedure_name); - SystemLibrary.SystemLibInitializer.read_short_string_procedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.read_short_string); - SystemLibrary.SystemLibInitializer.read_short_string_from_file_procedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.read_short_string_from_file); - SystemLibrary.SystemLibInitializer.InsertProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit,compiler_string_consts.Insert); - SystemLibrary.SystemLibInitializer.InsertInShortStringProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit,compiler_string_consts.InsertInShortString); - SystemLibrary.SystemLibInitializer.DeleteProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit,compiler_string_consts.Delete); - SystemLibrary.SystemLibInitializer.LowFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit,compiler_string_consts.Low); - SystemLibrary.SystemLibInitializer.HighFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit,compiler_string_consts.High); - SystemLibrary.SystemLibInitializer.CheckCanUsePointerOnTypeProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.CheckCanUsePointerOnType_proc_name); - SystemLibrary.SystemLibInitializer.CheckCanUseTypeForBinaryFilesProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.CheckCanUseTypeForBinaryFiles_proc_name); - SystemLibrary.SystemLibInitializer.CheckCanUseTypeForTypedFilesProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.CheckCanUseTypeForTypedFiles_proc_name); - SystemLibrary.SystemLibInitializer.RuntimeDetermineTypeFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.RuntimeDetermineType_func_name); - SystemLibrary.SystemLibInitializer.RuntimeInitializeFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.RuntimeInitializeFunction_func_name); - SystemLibrary.SystemLibInitializer.PointerToStringFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.PointerToStringFunction_func_name); - SystemLibrary.SystemLibInitializer.GetRuntimeSizeFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.GetRuntimeSizeFunction_func_name); - SystemLibrary.SystemLibInitializer.StrProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.StrProcedure_func_name); - SystemLibrary.SystemLibInitializer.PascalABCVersion = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.PascalABCVersion_func_name); - SystemLibrary.SystemLibInitializer.ChrUnicodeFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.ChrUnicodeFunction_func_name); - SystemLibrary.SystemLibInitializer.AssertProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.AssertProcedure); - SystemLibrary.SystemLibInitializer.CheckRangeFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.check_in_range); - SystemLibrary.SystemLibInitializer.CheckCharRangeFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.check_in_range_char); - SystemLibrary.SystemLibInitializer.CopyWithSizeFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.CopyWithSizeFunction); - SystemLibrary.SystemLibInitializer.ArrayCopyFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.ArrayCopyFunction); - SystemLibrary.SystemLibInitializer.ConfigVariable = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.config_variable_name); + SystemLibrary.SystemLibInitializer.format_function = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.format_procedure_name); + SystemLibrary.SystemLibInitializer.read_procedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.read_procedure_name); + SystemLibrary.SystemLibInitializer.write_procedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.write_procedure_name); + SystemLibrary.SystemLibInitializer.writeln_procedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.writeln_procedure_name); + SystemLibrary.SystemLibInitializer.readln_procedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.readln_procedure_name); + SystemLibrary.SystemLibInitializer.TextFileType = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.text_file_name_type_name); + SystemLibrary.SystemLibInitializer.TextFileInitProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.TextFileInitProcedureName); + SystemLibrary.SystemLibInitializer.BinaryFileType = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.BinaryFileTypeName); + SystemLibrary.SystemLibInitializer.AbstractBinaryFileType = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.AbstractBinaryFileTypeName); + SystemLibrary.SystemLibInitializer.PointerOutputType = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.PointerOutputTypeName); + SystemLibrary.SystemLibInitializer.BinaryFileReadProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.BinaryFileReadProcedureName); + SystemLibrary.SystemLibInitializer.BinaryFileInitProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.BinaryFileInitProcedureName); + SystemLibrary.SystemLibInitializer.StringDefaultPropertySetProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.StringDefaultPropertySetProcedureName); + SystemLibrary.SystemLibInitializer.TypedFileType = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.TypedFileTypeName); + SystemLibrary.SystemLibInitializer.TypedFileInitProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.TypedFileInitProcedureName); + SystemLibrary.SystemLibInitializer.TypedFileReadProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.TypedFileReadProcedureName); + SystemLibrary.SystemLibInitializer.ClipShortStringProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.ClipShortString); + SystemLibrary.SystemLibInitializer.GetCharInShortStringProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.GetCharInShortString); + SystemLibrary.SystemLibInitializer.SetCharInShortStringProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.SetCharInShortString); + //SystemLibrary.SystemLibInitializer.ShortStringType = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.ShortStringTypeName); + //SystemLibrary.SystemLibInitializer.ShortStringTypeInitProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.ShortStringTypeInitProcedure); + SystemLibrary.SystemLibInitializer.TypedSetType = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.set_name); + SystemLibrary.SystemLibInitializer.TypedSetInitProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.TypedSetInitProcedure); + SystemLibrary.SystemLibInitializer.SetUnionProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.union_of_set); + SystemLibrary.SystemLibInitializer.SetIntersectProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.intersect_of_set); + SystemLibrary.SystemLibInitializer.SetSubtractProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.subtract_of_set); + SystemLibrary.SystemLibInitializer.InSetProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.in_set); + SystemLibrary.SystemLibInitializer.CreateSetProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.CreateSetProcedure); + SystemLibrary.SystemLibInitializer.IncludeProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.IncludeProcedure); + SystemLibrary.SystemLibInitializer.ExcludeProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.ExcludeProcedure); + SystemLibrary.SystemLibInitializer.DiapasonType = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.DiapasonType); + SystemLibrary.SystemLibInitializer.CreateDiapason = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.CreateDiapason); + SystemLibrary.SystemLibInitializer.CreateObjDiapason = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.CreateObjDiapason); + SystemLibrary.SystemLibInitializer.CompareSetEquals = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.CompareSetEquals); + SystemLibrary.SystemLibInitializer.CompareSetInEquals = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.CompareSetInEquals); + SystemLibrary.SystemLibInitializer.CompareSetLess = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.CompareSetLess); + SystemLibrary.SystemLibInitializer.CompareSetLessEqual = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.CompareSetLessEqual); + SystemLibrary.SystemLibInitializer.CompareSetGreater = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.CompareSetGreater); + SystemLibrary.SystemLibInitializer.CompareSetGreaterEqual = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.CompareSetGreaterEqual); + SystemLibrary.SystemLibInitializer.IncProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.IncProcedure); + SystemLibrary.SystemLibInitializer.DecProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.DecProcedure); + SystemLibrary.SystemLibInitializer.SuccFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.SuccFunction); + SystemLibrary.SystemLibInitializer.PredFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.PredFunction); + SystemLibrary.SystemLibInitializer.OrdFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.OrdFunction); + SystemLibrary.SystemLibInitializer.TypedSetInitProcedureWithBounds = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.TypedSetInitProcedureWithBounds); + SystemLibrary.SystemLibInitializer.TypedSetInitWithShortString = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.TypedSetInitWithShortString); + SystemLibrary.SystemLibInitializer.AssignSetProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.AssignSetProcedure); + SystemLibrary.SystemLibInitializer.AssignSetProcedureWithBounds = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.AssignSetProcedureWithBounds); + SystemLibrary.SystemLibInitializer.ClipProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.ClipProcedure); + SystemLibrary.SystemLibInitializer.ClipFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.ClipFunction); + SystemLibrary.SystemLibInitializer.ClipShortStringInSetFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.ClipShortStringInSetFunction); + SystemLibrary.SystemLibInitializer.ClipShortStringInSetProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.ClipShortStringInSetProcedure); + SystemLibrary.SystemLibInitializer.SetLengthForShortStringProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.set_length_for_short_string); + SystemLibrary.SystemLibInitializer.SetLengthProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.set_length_procedure_name); + SystemLibrary.SystemLibInitializer.read_short_string_procedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.read_short_string); + SystemLibrary.SystemLibInitializer.read_short_string_from_file_procedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.read_short_string_from_file); + SystemLibrary.SystemLibInitializer.InsertProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit,StringConstants.Insert); + SystemLibrary.SystemLibInitializer.InsertInShortStringProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit,StringConstants.InsertInShortString); + SystemLibrary.SystemLibInitializer.DeleteProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit,StringConstants.Delete); + SystemLibrary.SystemLibInitializer.LowFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit,StringConstants.Low); + SystemLibrary.SystemLibInitializer.HighFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit,StringConstants.High); + SystemLibrary.SystemLibInitializer.CheckCanUsePointerOnTypeProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.CheckCanUsePointerOnType_proc_name); + SystemLibrary.SystemLibInitializer.CheckCanUseTypeForBinaryFilesProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.CheckCanUseTypeForBinaryFiles_proc_name); + SystemLibrary.SystemLibInitializer.CheckCanUseTypeForTypedFilesProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.CheckCanUseTypeForTypedFiles_proc_name); + SystemLibrary.SystemLibInitializer.RuntimeDetermineTypeFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.RuntimeDetermineType_func_name); + SystemLibrary.SystemLibInitializer.RuntimeInitializeFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.RuntimeInitializeFunction_func_name); + SystemLibrary.SystemLibInitializer.PointerToStringFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.PointerToStringFunction_func_name); + SystemLibrary.SystemLibInitializer.GetRuntimeSizeFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.GetRuntimeSizeFunction_func_name); + SystemLibrary.SystemLibInitializer.StrProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.StrProcedure_func_name); + SystemLibrary.SystemLibInitializer.PascalABCVersion = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.PascalABCVersion_func_name); + SystemLibrary.SystemLibInitializer.ChrUnicodeFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.ChrUnicodeFunction_func_name); + SystemLibrary.SystemLibInitializer.AssertProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.AssertProcedure); + SystemLibrary.SystemLibInitializer.CheckRangeFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.check_in_range); + SystemLibrary.SystemLibInitializer.CheckCharRangeFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.check_in_range_char); + SystemLibrary.SystemLibInitializer.CopyWithSizeFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.CopyWithSizeFunction); + SystemLibrary.SystemLibInitializer.ArrayCopyFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.ArrayCopyFunction); + SystemLibrary.SystemLibInitializer.ConfigVariable = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.config_variable_name); //SystemLibrary.SystemLibrary.make_type_conversion(SystemLibrary.SystemLibInitializer.ShortStringType.sym_info as type_node,SystemLibrary.SystemLibrary.string_type,type_compare.less_type,SemanticTree.basic_function_type.none,true); //SystemLibrary.SystemLibrary.make_type_conversion(SystemLibrary.SystemLibrary.string_type,SystemLibrary.SystemLibInitializer.ShortStringType.sym_info as type_node,type_compare.greater_type,SemanticTree.basic_function_type.none,true); if (SystemLibrary.SystemLibInitializer.TextFileType.Found) SystemLibrary.SystemLibInitializer.TextFileType.TypeNode.type_special_kind = PascalABCCompiler.SemanticTree.type_special_kind.text_file; if (SemanticRules.GenerateNativeCode) { - SystemLibrary.SystemLibInitializer.ObjectType = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.ObjectType); + SystemLibrary.SystemLibInitializer.ObjectType = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.ObjectType); if (SystemLibrary.SystemLibInitializer.ObjectType.Found) SemanticRules.ClassBaseType = SystemLibrary.SystemLibInitializer.ObjectType.sym_info as TreeRealization.type_node; - SystemLibrary.SystemLibInitializer.StringType = new PascalABCCompiler.SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.StringType); + SystemLibrary.SystemLibInitializer.StringType = new PascalABCCompiler.SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.StringType); if (SystemLibrary.SystemLibInitializer.StringType.Found) SemanticRules.StringType = SystemLibrary.SystemLibInitializer.StringType.sym_info as TreeRealization.type_node; } @@ -409,83 +409,83 @@ namespace PascalABCCompiler.TreeConverter public static void init_system_module_from_dll(dot_net_unit_node psystem_unit) { - SystemLibrary.SystemLibInitializer.format_function = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.format_procedure_name); - SystemLibrary.SystemLibInitializer.read_procedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.read_procedure_name); - SystemLibrary.SystemLibInitializer.write_procedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.write_procedure_name); - SystemLibrary.SystemLibInitializer.writeln_procedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.writeln_procedure_name); - SystemLibrary.SystemLibInitializer.readln_procedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.readln_procedure_name); - SystemLibrary.SystemLibInitializer.TextFileType = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.text_file_name_type_name); - SystemLibrary.SystemLibInitializer.TextFileInitProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.TextFileInitProcedureName); - SystemLibrary.SystemLibInitializer.BinaryFileType = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.BinaryFileTypeName); - SystemLibrary.SystemLibInitializer.AbstractBinaryFileType = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.AbstractBinaryFileTypeName); - SystemLibrary.SystemLibInitializer.PointerOutputType = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.PointerOutputTypeName); - SystemLibrary.SystemLibInitializer.BinaryFileReadProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.BinaryFileReadProcedureName); - SystemLibrary.SystemLibInitializer.BinaryFileInitProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.BinaryFileInitProcedureName); - SystemLibrary.SystemLibInitializer.StringDefaultPropertySetProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.StringDefaultPropertySetProcedureName); - SystemLibrary.SystemLibInitializer.TypedFileType = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.TypedFileTypeName); - SystemLibrary.SystemLibInitializer.TypedFileInitProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.TypedFileInitProcedureName); - SystemLibrary.SystemLibInitializer.TypedFileReadProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.TypedFileReadProcedureName); - SystemLibrary.SystemLibInitializer.ClipShortStringProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.ClipShortString); - SystemLibrary.SystemLibInitializer.GetCharInShortStringProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.GetCharInShortString); - SystemLibrary.SystemLibInitializer.SetCharInShortStringProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.SetCharInShortString); - //SystemLibrary.SystemLibInitializer.ShortStringType = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.ShortStringTypeName); - //SystemLibrary.SystemLibInitializer.ShortStringTypeInitProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.ShortStringTypeInitProcedure); - SystemLibrary.SystemLibInitializer.TypedSetType = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.set_name); - SystemLibrary.SystemLibInitializer.TypedSetInitProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.TypedSetInitProcedure); - SystemLibrary.SystemLibInitializer.SetUnionProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.union_of_set); - SystemLibrary.SystemLibInitializer.SetIntersectProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.intersect_of_set); - SystemLibrary.SystemLibInitializer.SetSubtractProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.subtract_of_set); - SystemLibrary.SystemLibInitializer.InSetProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.in_set); - SystemLibrary.SystemLibInitializer.CreateSetProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.CreateSetProcedure); - SystemLibrary.SystemLibInitializer.IncludeProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.IncludeProcedure); - SystemLibrary.SystemLibInitializer.ExcludeProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.ExcludeProcedure); - SystemLibrary.SystemLibInitializer.DiapasonType = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.DiapasonType); - SystemLibrary.SystemLibInitializer.CreateDiapason = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.CreateDiapason); - SystemLibrary.SystemLibInitializer.CreateObjDiapason = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.CreateObjDiapason); - SystemLibrary.SystemLibInitializer.CompareSetEquals = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.CompareSetEquals); - SystemLibrary.SystemLibInitializer.CompareSetInEquals = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.CompareSetInEquals); - SystemLibrary.SystemLibInitializer.CompareSetLess = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.CompareSetLess); - SystemLibrary.SystemLibInitializer.CompareSetLessEqual = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.CompareSetLessEqual); - SystemLibrary.SystemLibInitializer.CompareSetGreater = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.CompareSetGreater); - SystemLibrary.SystemLibInitializer.CompareSetGreaterEqual = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.CompareSetGreaterEqual); - SystemLibrary.SystemLibInitializer.IncProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.IncProcedure); - SystemLibrary.SystemLibInitializer.DecProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.DecProcedure); - SystemLibrary.SystemLibInitializer.SuccFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.SuccFunction); - SystemLibrary.SystemLibInitializer.PredFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.PredFunction); - SystemLibrary.SystemLibInitializer.OrdFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.OrdFunction); - SystemLibrary.SystemLibInitializer.TypedSetInitProcedureWithBounds = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.TypedSetInitProcedureWithBounds); - SystemLibrary.SystemLibInitializer.TypedSetInitWithShortString = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.TypedSetInitWithShortString); - SystemLibrary.SystemLibInitializer.AssignSetProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.AssignSetProcedure); - SystemLibrary.SystemLibInitializer.AssignSetProcedureWithBounds = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.AssignSetProcedureWithBounds); - SystemLibrary.SystemLibInitializer.ClipProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.ClipProcedure); - SystemLibrary.SystemLibInitializer.ClipFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.ClipFunction); - SystemLibrary.SystemLibInitializer.ClipShortStringInSetFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.ClipShortStringInSetFunction); - SystemLibrary.SystemLibInitializer.ClipShortStringInSetProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.ClipShortStringInSetProcedure); - SystemLibrary.SystemLibInitializer.SetLengthForShortStringProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.set_length_for_short_string); - SystemLibrary.SystemLibInitializer.SetLengthProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.set_length_procedure_name); - SystemLibrary.SystemLibInitializer.read_short_string_procedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.read_short_string); - SystemLibrary.SystemLibInitializer.read_short_string_from_file_procedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.read_short_string_from_file); - SystemLibrary.SystemLibInitializer.InsertProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.Insert); - SystemLibrary.SystemLibInitializer.InsertInShortStringProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.InsertInShortString); - SystemLibrary.SystemLibInitializer.DeleteProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.Delete); - SystemLibrary.SystemLibInitializer.LowFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.Low); - SystemLibrary.SystemLibInitializer.HighFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.High); - SystemLibrary.SystemLibInitializer.CheckCanUsePointerOnTypeProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.CheckCanUsePointerOnType_proc_name); - SystemLibrary.SystemLibInitializer.CheckCanUseTypeForBinaryFilesProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.CheckCanUseTypeForBinaryFiles_proc_name); - SystemLibrary.SystemLibInitializer.CheckCanUseTypeForTypedFilesProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.CheckCanUseTypeForTypedFiles_proc_name); - SystemLibrary.SystemLibInitializer.RuntimeDetermineTypeFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.RuntimeDetermineType_func_name); - SystemLibrary.SystemLibInitializer.RuntimeInitializeFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.RuntimeInitializeFunction_func_name); - SystemLibrary.SystemLibInitializer.PointerToStringFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.PointerToStringFunction_func_name); - SystemLibrary.SystemLibInitializer.GetRuntimeSizeFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.GetRuntimeSizeFunction_func_name); - SystemLibrary.SystemLibInitializer.StrProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.StrProcedure_func_name); - SystemLibrary.SystemLibInitializer.PascalABCVersion = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.PascalABCVersion_func_name); - SystemLibrary.SystemLibInitializer.ChrUnicodeFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.ChrUnicodeFunction_func_name); - SystemLibrary.SystemLibInitializer.AssertProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.AssertProcedure); - SystemLibrary.SystemLibInitializer.CheckRangeFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.check_in_range); - SystemLibrary.SystemLibInitializer.CheckCharRangeFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.check_in_range_char); - SystemLibrary.SystemLibInitializer.CopyWithSizeFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.CopyWithSizeFunction); - SystemLibrary.SystemLibInitializer.ArrayCopyFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.ArrayCopyFunction); - SystemLibrary.SystemLibInitializer.ConfigVariable = new SystemLibrary.UnitDefinitionItem(psystem_unit, compiler_string_consts.config_variable_name); + SystemLibrary.SystemLibInitializer.format_function = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.format_procedure_name); + SystemLibrary.SystemLibInitializer.read_procedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.read_procedure_name); + SystemLibrary.SystemLibInitializer.write_procedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.write_procedure_name); + SystemLibrary.SystemLibInitializer.writeln_procedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.writeln_procedure_name); + SystemLibrary.SystemLibInitializer.readln_procedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.readln_procedure_name); + SystemLibrary.SystemLibInitializer.TextFileType = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.text_file_name_type_name); + SystemLibrary.SystemLibInitializer.TextFileInitProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.TextFileInitProcedureName); + SystemLibrary.SystemLibInitializer.BinaryFileType = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.BinaryFileTypeName); + SystemLibrary.SystemLibInitializer.AbstractBinaryFileType = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.AbstractBinaryFileTypeName); + SystemLibrary.SystemLibInitializer.PointerOutputType = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.PointerOutputTypeName); + SystemLibrary.SystemLibInitializer.BinaryFileReadProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.BinaryFileReadProcedureName); + SystemLibrary.SystemLibInitializer.BinaryFileInitProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.BinaryFileInitProcedureName); + SystemLibrary.SystemLibInitializer.StringDefaultPropertySetProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.StringDefaultPropertySetProcedureName); + SystemLibrary.SystemLibInitializer.TypedFileType = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.TypedFileTypeName); + SystemLibrary.SystemLibInitializer.TypedFileInitProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.TypedFileInitProcedureName); + SystemLibrary.SystemLibInitializer.TypedFileReadProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.TypedFileReadProcedureName); + SystemLibrary.SystemLibInitializer.ClipShortStringProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.ClipShortString); + SystemLibrary.SystemLibInitializer.GetCharInShortStringProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.GetCharInShortString); + SystemLibrary.SystemLibInitializer.SetCharInShortStringProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.SetCharInShortString); + //SystemLibrary.SystemLibInitializer.ShortStringType = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.ShortStringTypeName); + //SystemLibrary.SystemLibInitializer.ShortStringTypeInitProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.ShortStringTypeInitProcedure); + SystemLibrary.SystemLibInitializer.TypedSetType = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.set_name); + SystemLibrary.SystemLibInitializer.TypedSetInitProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.TypedSetInitProcedure); + SystemLibrary.SystemLibInitializer.SetUnionProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.union_of_set); + SystemLibrary.SystemLibInitializer.SetIntersectProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.intersect_of_set); + SystemLibrary.SystemLibInitializer.SetSubtractProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.subtract_of_set); + SystemLibrary.SystemLibInitializer.InSetProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.in_set); + SystemLibrary.SystemLibInitializer.CreateSetProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.CreateSetProcedure); + SystemLibrary.SystemLibInitializer.IncludeProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.IncludeProcedure); + SystemLibrary.SystemLibInitializer.ExcludeProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.ExcludeProcedure); + SystemLibrary.SystemLibInitializer.DiapasonType = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.DiapasonType); + SystemLibrary.SystemLibInitializer.CreateDiapason = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.CreateDiapason); + SystemLibrary.SystemLibInitializer.CreateObjDiapason = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.CreateObjDiapason); + SystemLibrary.SystemLibInitializer.CompareSetEquals = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.CompareSetEquals); + SystemLibrary.SystemLibInitializer.CompareSetInEquals = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.CompareSetInEquals); + SystemLibrary.SystemLibInitializer.CompareSetLess = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.CompareSetLess); + SystemLibrary.SystemLibInitializer.CompareSetLessEqual = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.CompareSetLessEqual); + SystemLibrary.SystemLibInitializer.CompareSetGreater = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.CompareSetGreater); + SystemLibrary.SystemLibInitializer.CompareSetGreaterEqual = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.CompareSetGreaterEqual); + SystemLibrary.SystemLibInitializer.IncProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.IncProcedure); + SystemLibrary.SystemLibInitializer.DecProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.DecProcedure); + SystemLibrary.SystemLibInitializer.SuccFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.SuccFunction); + SystemLibrary.SystemLibInitializer.PredFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.PredFunction); + SystemLibrary.SystemLibInitializer.OrdFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.OrdFunction); + SystemLibrary.SystemLibInitializer.TypedSetInitProcedureWithBounds = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.TypedSetInitProcedureWithBounds); + SystemLibrary.SystemLibInitializer.TypedSetInitWithShortString = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.TypedSetInitWithShortString); + SystemLibrary.SystemLibInitializer.AssignSetProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.AssignSetProcedure); + SystemLibrary.SystemLibInitializer.AssignSetProcedureWithBounds = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.AssignSetProcedureWithBounds); + SystemLibrary.SystemLibInitializer.ClipProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.ClipProcedure); + SystemLibrary.SystemLibInitializer.ClipFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.ClipFunction); + SystemLibrary.SystemLibInitializer.ClipShortStringInSetFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.ClipShortStringInSetFunction); + SystemLibrary.SystemLibInitializer.ClipShortStringInSetProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.ClipShortStringInSetProcedure); + SystemLibrary.SystemLibInitializer.SetLengthForShortStringProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.set_length_for_short_string); + SystemLibrary.SystemLibInitializer.SetLengthProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.set_length_procedure_name); + SystemLibrary.SystemLibInitializer.read_short_string_procedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.read_short_string); + SystemLibrary.SystemLibInitializer.read_short_string_from_file_procedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.read_short_string_from_file); + SystemLibrary.SystemLibInitializer.InsertProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.Insert); + SystemLibrary.SystemLibInitializer.InsertInShortStringProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.InsertInShortString); + SystemLibrary.SystemLibInitializer.DeleteProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.Delete); + SystemLibrary.SystemLibInitializer.LowFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.Low); + SystemLibrary.SystemLibInitializer.HighFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.High); + SystemLibrary.SystemLibInitializer.CheckCanUsePointerOnTypeProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.CheckCanUsePointerOnType_proc_name); + SystemLibrary.SystemLibInitializer.CheckCanUseTypeForBinaryFilesProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.CheckCanUseTypeForBinaryFiles_proc_name); + SystemLibrary.SystemLibInitializer.CheckCanUseTypeForTypedFilesProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.CheckCanUseTypeForTypedFiles_proc_name); + SystemLibrary.SystemLibInitializer.RuntimeDetermineTypeFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.RuntimeDetermineType_func_name); + SystemLibrary.SystemLibInitializer.RuntimeInitializeFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.RuntimeInitializeFunction_func_name); + SystemLibrary.SystemLibInitializer.PointerToStringFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.PointerToStringFunction_func_name); + SystemLibrary.SystemLibInitializer.GetRuntimeSizeFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.GetRuntimeSizeFunction_func_name); + SystemLibrary.SystemLibInitializer.StrProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.StrProcedure_func_name); + SystemLibrary.SystemLibInitializer.PascalABCVersion = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.PascalABCVersion_func_name); + SystemLibrary.SystemLibInitializer.ChrUnicodeFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.ChrUnicodeFunction_func_name); + SystemLibrary.SystemLibInitializer.AssertProcedure = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.AssertProcedure); + SystemLibrary.SystemLibInitializer.CheckRangeFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.check_in_range); + SystemLibrary.SystemLibInitializer.CheckCharRangeFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.check_in_range_char); + SystemLibrary.SystemLibInitializer.CopyWithSizeFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.CopyWithSizeFunction); + SystemLibrary.SystemLibInitializer.ArrayCopyFunction = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.ArrayCopyFunction); + SystemLibrary.SystemLibInitializer.ConfigVariable = new SystemLibrary.UnitDefinitionItem(psystem_unit, StringConstants.config_variable_name); //AddSpecialOperatorsToSetType(); //SystemLibrary.SystemLibrary.make_type_conversion(SystemLibrary.SystemLibInitializer.ShortStringType.sym_info as type_node,SystemLibrary.SystemLibrary.string_type,type_compare.less_type,SemanticTree.basic_function_type.none,true); //SystemLibrary.SystemLibrary.make_type_conversion(SystemLibrary.SystemLibrary.string_type,SystemLibrary.SystemLibInitializer.ShortStringType.sym_info as type_node,type_compare.greater_type,SemanticTree.basic_function_type.none,true); @@ -531,21 +531,21 @@ namespace PascalABCCompiler.TreeConverter return; common_type_node tctn = SystemLibrary.SystemLibInitializer.TypedSetType.sym_info as common_type_node; tctn.type_special_kind = SemanticTree.type_special_kind.base_set_type; - tctn.scope.AddSymbol(compiler_string_consts.plus_name, SystemLibrary.SystemLibInitializer.SetUnionProcedure.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.mul_name, SystemLibrary.SystemLibInitializer.SetIntersectProcedure.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.in_name, SystemLibrary.SystemLibInitializer.InSetProcedure.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.minus_name, SystemLibrary.SystemLibInitializer.SetSubtractProcedure.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.gr_name, SystemLibrary.SystemLibInitializer.CompareSetGreater.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.greq_name, SystemLibrary.SystemLibInitializer.CompareSetGreaterEqual.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.sm_name, SystemLibrary.SystemLibInitializer.CompareSetLess.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.smeq_name, SystemLibrary.SystemLibInitializer.CompareSetLessEqual.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.eq_name, SystemLibrary.SystemLibInitializer.CompareSetEquals.SymbolInfo.FirstOrDefault()); - tctn.scope.AddSymbol(compiler_string_consts.noteq_name, SystemLibrary.SystemLibInitializer.CompareSetInEquals.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.plus_name, SystemLibrary.SystemLibInitializer.SetUnionProcedure.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.mul_name, SystemLibrary.SystemLibInitializer.SetIntersectProcedure.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.in_name, SystemLibrary.SystemLibInitializer.InSetProcedure.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.minus_name, SystemLibrary.SystemLibInitializer.SetSubtractProcedure.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.gr_name, SystemLibrary.SystemLibInitializer.CompareSetGreater.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.greq_name, SystemLibrary.SystemLibInitializer.CompareSetGreaterEqual.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.sm_name, SystemLibrary.SystemLibInitializer.CompareSetLess.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.smeq_name, SystemLibrary.SystemLibInitializer.CompareSetLessEqual.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.eq_name, SystemLibrary.SystemLibInitializer.CompareSetEquals.SymbolInfo.FirstOrDefault()); + tctn.scope.AddSymbol(StringConstants.noteq_name, SystemLibrary.SystemLibInitializer.CompareSetInEquals.SymbolInfo.FirstOrDefault()); } private void CreateSpecialFields(common_unit_node psystem_unit) { - List sil = psystem_unit.scope.Find(compiler_string_consts.IsConsoleApplicationVariableName); + List sil = psystem_unit.scope.Find(StringConstants.IsConsoleApplicationVariableName); if (sil != null && sil.FirstOrDefault().sym_info is namespace_variable) { namespace_variable_reference nvr = new namespace_variable_reference(sil.FirstOrDefault().sym_info as namespace_variable, null); @@ -557,15 +557,15 @@ namespace PascalABCCompiler.TreeConverter { if (!from_pabc_dll) { - SystemLibrary.SystemLibInitializer.read_procedure = new SystemLibrary.UnitDefinitionItem(unit, compiler_string_consts.read_procedure_name); + SystemLibrary.SystemLibInitializer.read_procedure = new SystemLibrary.UnitDefinitionItem(unit, StringConstants.read_procedure_name); var si = SystemLibrary.SystemLibInitializer.read_procedure.SymbolInfo; - SystemLibrary.SystemLibInitializer.readln_procedure = new SystemLibrary.UnitDefinitionItem(unit, compiler_string_consts.readln_procedure_name); + SystemLibrary.SystemLibInitializer.readln_procedure = new SystemLibrary.UnitDefinitionItem(unit, StringConstants.readln_procedure_name); si = SystemLibrary.SystemLibInitializer.readln_procedure.SymbolInfo; } else { - //SystemLibrary.SystemLibInitializer.read_procedure = new SystemLibrary.UnitDefinitionItem(unit, compiler_string_consts.read_procedure_name); - //SystemLibrary.SystemLibInitializer.readln_procedure = new SystemLibrary.UnitDefinitionItem(unit, compiler_string_consts.readln_procedure_name); + //SystemLibrary.SystemLibInitializer.read_procedure = new SystemLibrary.UnitDefinitionItem(unit, StringConstants.read_procedure_name); + //SystemLibrary.SystemLibInitializer.readln_procedure = new SystemLibrary.UnitDefinitionItem(unit, StringConstants.readln_procedure_name); } } @@ -1082,11 +1082,11 @@ namespace PascalABCCompiler.TreeConverter internal bool one_way_operation(string name) { - if (name == compiler_string_consts.plusassign_name) return true; - if (name == compiler_string_consts.minusassign_name) return true; - if (name == compiler_string_consts.multassign_name) return true; - if (name == compiler_string_consts.assign_name) return true; - if (name == compiler_string_consts.divassign_name) return true; + if (name == StringConstants.plusassign_name) return true; + if (name == StringConstants.minusassign_name) return true; + if (name == StringConstants.multassign_name) return true; + if (name == StringConstants.assign_name) return true; + if (name == StringConstants.divassign_name) return true; return false; } @@ -1138,12 +1138,12 @@ namespace PascalABCCompiler.TreeConverter if (right_type.semantic_node_type == semantic_node_type.delegated_method && !left_type.IsDelegate && left_type.semantic_node_type != semantic_node_type.delegated_method) { try_convert_typed_expression_to_function_call(ref right); - if (name != compiler_string_consts.plusassign_name && name != compiler_string_consts.minusassign_name) + if (name != StringConstants.plusassign_name && name != StringConstants.minusassign_name) try_convert_typed_expression_to_function_call(ref left); right_type = right.type; } - if (right_type.semantic_node_type == semantic_node_type.delegated_method && name != compiler_string_consts.plusassign_name && name != compiler_string_consts.minusassign_name) + if (right_type.semantic_node_type == semantic_node_type.delegated_method && name != StringConstants.plusassign_name && name != StringConstants.minusassign_name) { delegated_methods dm2 = (delegated_methods)right_type; if (dm2.empty_param_method != null) @@ -1375,7 +1375,7 @@ namespace PascalABCCompiler.TreeConverter if (added_symbols != -1 && sil != null && added_symbols < sil.Count()) sil.RemoveRange(added_symbols + 1, sil.Count() - 1 - added_symbols); - if (SystemUnitAssigned && in_check_range_region() && name == compiler_string_consts.assign_name && is_range_checkable(left.type) && is_range_checkable(right.type)) + if (SystemUnitAssigned && in_check_range_region() && name == StringConstants.assign_name && is_range_checkable(left.type) && is_range_checkable(right.type)) { ordinal_type_interface oti = left.type.get_internal_interface(internal_interface_kind.ordinal_interface) as ordinal_type_interface; if (left.type != SystemLibrary.SystemLibrary.char_type && left.type != SystemLibrary.SystemLibrary.uint64_type && !(oti.lower_value is ulong_const_node)) @@ -1747,7 +1747,7 @@ namespace PascalABCCompiler.TreeConverter { string tmp = names.names[names.names.Count - 1].name; int num; - string generic_name = compiler_string_consts.GetGenericTypeInformation(tmp, out num); + string generic_name = StringConstants.GetGenericTypeInformation(tmp, out num); List counts; bool found = NetHelper.NetHelper.generics_names.TryGetValue(generic_name.ToLower(), out counts); if (found) @@ -1755,7 +1755,7 @@ namespace PascalABCCompiler.TreeConverter foreach (int k in counts) { names.names[names.names.Count - 1].name = generic_name + - compiler_string_consts.generic_params_infix + k.ToString(); + StringConstants.generic_params_infix + k.ToString(); List sinfo = context.find_definition_node(names, loc); if (sinfo != null) { @@ -1862,7 +1862,7 @@ namespace PascalABCCompiler.TreeConverter AddError(call_location, "EXIT_BREAK_CONTINUE_IN_FINALLY_BLOCK"); } if (!TreeConverter.SemanticRules.EnableExitProcedure) - AddError(new TreeConverter.UndefinedNameReference(TreeConverter.compiler_string_consts.exit_procedure_name, call_location)); + AddError(new TreeConverter.UndefinedNameReference(StringConstants.exit_procedure_name, call_location)); return new exit_procedure(call_location); } @@ -1950,7 +1950,7 @@ namespace PascalABCCompiler.TreeConverter } else { - type_node filter_type = compiled_type_node.get_type_node(NetHelper.NetHelper.FindType(compiler_string_consts.ExceptionName)); + type_node filter_type = compiled_type_node.get_type_node(NetHelper.NetHelper.FindType(StringConstants.ExceptionName)); expression_node current_catch_excep = create_constructor_call(filter_type, new expressions_list(), null); local_block_variable_reference lvr = null; local_block_variable tmp_var = context.add_var_definition(context.BuildName("$try_temp" + UniqueNumStr()), null, SystemLibrary.SystemLibrary.bool_type, null) as local_block_variable; @@ -2222,7 +2222,7 @@ namespace PascalABCCompiler.TreeConverter common_type_node ctn = tn as common_type_node; if (ctn.type_special_kind == SemanticTree.type_special_kind.array_wrapper) { - int len = ((ctn.find_first_in_type(compiler_string_consts.internal_array_name).sym_info as class_field).type as simple_array).length; + int len = ((ctn.find_first_in_type(StringConstants.internal_array_name).sym_info as class_field).type as simple_array).length; return len*get_short_string_size(ctn.element_type); } else if (ctn.type_special_kind == SemanticTree.type_special_kind.record) @@ -2248,7 +2248,7 @@ namespace PascalABCCompiler.TreeConverter expressions_list exl = new expressions_list(); exl.AddElement(new typeof_operator(element_type, loc)); base_function_call bfc = create_constructor_call(vdn.type, exl, loc); - expression_node expr = find_operator(compiler_string_consts.assign_name, var_ref, bfc, loc); + expression_node expr = find_operator(StringConstants.assign_name, var_ref, bfc, loc); */ type_node tn = vdn.type; @@ -2324,7 +2324,7 @@ namespace PascalABCCompiler.TreeConverter expressions_list exl = new expressions_list(); exl.AddElement(new typeof_operator(element_type, loc)); base_function_call bfc = create_constructor_call(vdn.type, exl, loc); - expression_node expr = find_operator(compiler_string_consts.assign_name, var_ref, bfc, loc); + expression_node expr = find_operator(StringConstants.assign_name, var_ref, bfc, loc); */ type_node tn = vdn.type; @@ -2392,7 +2392,7 @@ namespace PascalABCCompiler.TreeConverter expressions_list exl = new expressions_list(); exl.AddElement(new typeof_operator(element_type, loc)); base_function_call bfc = create_constructor_call(vdn.type, exl, loc); - expression_node expr = find_operator(compiler_string_consts.assign_name, var_ref, bfc, loc); + expression_node expr = find_operator(StringConstants.assign_name, var_ref, bfc, loc); */ type_node tn = vdn.type; @@ -2432,11 +2432,11 @@ namespace PascalABCCompiler.TreeConverter function_node fn = null; if (exl.Count > 1) { - fn = convertion_data_and_alghoritms.select_function(exl, (SystemLibrary.SystemLibInitializer.TypedSetType.sym_info as type_node).find_in_type(compiler_string_consts.default_constructor_name), loc); + fn = convertion_data_and_alghoritms.select_function(exl, (SystemLibrary.SystemLibInitializer.TypedSetType.sym_info as type_node).find_in_type(StringConstants.default_constructor_name), loc); } else { - fn = convertion_data_and_alghoritms.select_function(exl, (SystemLibrary.SystemLibInitializer.TypedSetType.sym_info as type_node).find_in_type(compiler_string_consts.default_constructor_name), loc); + fn = convertion_data_and_alghoritms.select_function(exl, (SystemLibrary.SystemLibInitializer.TypedSetType.sym_info as type_node).find_in_type(StringConstants.default_constructor_name), loc); } //expression_node expr = convertion_data_and_alghoritms.create_simple_function_call(fn, null, exl.ToArray()); expression_node expr = create_static_method_call_with_params(fn, loc, tn, false, exl); @@ -2771,7 +2771,7 @@ namespace PascalABCCompiler.TreeConverter //Пытаемся добавить вызов .ctor() предка... //Для начала проверим, есть ли у предка таковой. bool not_found = true; - List sym = context.converted_type.base_type.find_in_type(compiler_string_consts.default_constructor_name, context.CurrentScope); + List sym = context.converted_type.base_type.find_in_type(StringConstants.default_constructor_name, context.CurrentScope); if (sym != null) { foreach (SymbolInfo sym_unit in sym) @@ -2807,7 +2807,7 @@ namespace PascalABCCompiler.TreeConverter { //Генерируем вызов .ctor() предка SyntaxTree.inherited_ident ii = new SyntaxTree.inherited_ident(); - ii.name = compiler_string_consts.default_constructor_name; + ii.name = StringConstants.default_constructor_name; _block.program_code.subnodes.Insert(0, new SyntaxTree.procedure_call(ii)); //context.allow_inherited_ctor_call = false; } @@ -3056,7 +3056,7 @@ namespace PascalABCCompiler.TreeConverter loc = get_location(_unit_module.unit_name); } - common_namespace_node cnsn = context.create_namespace(_unit_module.unit_name.idunit_name.name + compiler_string_consts.ImplementationSectionNamespaceName, + common_namespace_node cnsn = context.create_namespace(_unit_module.unit_name.idunit_name.name + StringConstants.ImplementationSectionNamespaceName, _compiled_unit, _compiled_unit.implementation_scope, loc); //cnsn.scope=_compiled_unit.implementation_scope; @@ -3078,7 +3078,7 @@ namespace PascalABCCompiler.TreeConverter context.check_labels(context.converted_namespace.labels); //(ssyy) Блокируем поставленные метки, чтобы не допустить переход из finalization-секции //context.block_defined_labels(context.converted_namespace.labels); - initialization_function = new common_namespace_function_node(compiler_string_consts.initialization_function_name, + initialization_function = new common_namespace_function_node(StringConstants.initialization_function_name, null, init_statements.location, context.converted_namespace, convertion_data_and_alghoritms.symbol_table.CreateScope(context.converted_namespace.scope)); initialization_function.function_code = init_statements; cnsn.functions.AddElement(initialization_function); @@ -3094,7 +3094,7 @@ namespace PascalABCCompiler.TreeConverter { context.check_labels(context.converted_namespace.labels); - finalization_function = new common_namespace_function_node(compiler_string_consts.finalization_function_name, + finalization_function = new common_namespace_function_node(StringConstants.finalization_function_name, null, final_statements.location, context.converted_namespace, convertion_data_and_alghoritms.symbol_table.CreateScope(context.converted_namespace.scope)); finalization_function.function_code = final_statements; cnsn.functions.AddElement(finalization_function); @@ -3161,9 +3161,9 @@ namespace PascalABCCompiler.TreeConverter if (!SemanticRules.IsAsForPointers && (tp.IsPointer || en.type.IsPointer)) { if (node.cast_op == PascalABCCompiler.SyntaxTree.op_typecast.is_op) - AddError(loc, "OPERATOR_{0}_CAN_NOT_BE_APPLIED_TO_POINTER_TYPE", compiler_string_consts.is_name); + AddError(loc, "OPERATOR_{0}_CAN_NOT_BE_APPLIED_TO_POINTER_TYPE", StringConstants.is_name); else - AddError(loc, "OPERATOR_{0}_CAN_NOT_BE_APPLIED_TO_POINTER_TYPE", compiler_string_consts.as_name); + AddError(loc, "OPERATOR_{0}_CAN_NOT_BE_APPLIED_TO_POINTER_TYPE", StringConstants.as_name); } else if (!(type_table.is_derived(en.type, tp) || type_table.is_derived(tp, en.type) @@ -3251,13 +3251,13 @@ namespace PascalABCCompiler.TreeConverter if (_constructor.name == null) { - SyntaxTree.ident name = new SyntaxTree.ident(compiler_string_consts.default_constructor_name); + SyntaxTree.ident name = new SyntaxTree.ident(StringConstants.default_constructor_name); _constructor.name = new PascalABCCompiler.SyntaxTree.method_name(null, null, name, null); _constructor.name.source_context = _constructor.name.meth_name.source_context = _constructor.source_context; } - if (_constructor.name.meth_name.name.ToLower() != compiler_string_consts.default_constructor_name) - AddError(get_location(_constructor.name), "CONSTRUCTOR_CAN_HAVE_ONLY_{0}_NAME", compiler_string_consts.default_constructor_name); + if (_constructor.name.meth_name.name.ToLower() != StringConstants.default_constructor_name) + AddError(get_location(_constructor.name), "CONSTRUCTOR_CAN_HAVE_ONLY_{0}_NAME", StringConstants.default_constructor_name); if ((_constructor.name.class_name == null) && (context.converting_block() != block_type.type_block)) { AddError(get_location(_constructor.name), "ONLY_CONSTRUCTOR_OF_TYPE_ALLOWED"); @@ -3293,7 +3293,7 @@ namespace PascalABCCompiler.TreeConverter { AddError(get_location(_constructor.name), "STATIC_CONSTRUCTOR_MUST_BE_PARAMETERLESS"); } - _constructor.name.meth_name.name = compiler_string_consts.static_ctor_prefix + _constructor.name.meth_name.name; + _constructor.name.meth_name.name = StringConstants.static_ctor_prefix + _constructor.name.meth_name.name; visit_procedure_header(_constructor); if (context.top_function != null) { @@ -4166,14 +4166,14 @@ namespace PascalABCCompiler.TreeConverter self_type = cmn.cont_type.get_instance(cmn.cont_type.generic_params.ConvertAll(o => (type_node)o));// new generic_instance_type_node(self_type, self_type.generic_params.ConvertAll(o => (type_node)o), self_type.base_type, self_type.name, self_type.type_access_level, self_type.comprehensive_namespace, self_type.loc); if (!(cmn.is_constructor && cmn.cont_type.name.StartsWith("<>local_variables_class"))) { - local_variable lv = new local_variable(compiler_string_consts.self_word, self_type, cmn, null); - cmn.scope.AddSymbol(compiler_string_consts.self_word, new SymbolInfo(lv)); + local_variable lv = new local_variable(StringConstants.self_word, self_type, cmn, null); + cmn.scope.AddSymbol(StringConstants.self_word, new SymbolInfo(lv)); cmn.self_variable = lv; } else { - local_variable lv = new local_variable(compiler_string_consts.self_word+"$", self_type, cmn, null); - cmn.scope.AddSymbol(compiler_string_consts.self_word+"$", new SymbolInfo(lv)); + local_variable lv = new local_variable(StringConstants.self_word+"$", self_type, cmn, null); + cmn.scope.AddSymbol(StringConstants.self_word+"$", new SymbolInfo(lv)); cmn.self_variable = lv; } } @@ -4255,7 +4255,7 @@ namespace PascalABCCompiler.TreeConverter SyntaxTree.procedure_attributes_list pal = new PascalABCCompiler.SyntaxTree.procedure_attributes_list(); //pal.proc_attributes.Add(new PascalABCCompiler.SyntaxTree.procedure_attribute(SyntaxTree.proc_attribute.attr_overload)); attr_overload - убрал отовсюду! ССМ SyntaxTree.constructor constr = new PascalABCCompiler.SyntaxTree.constructor(); - constr.name = new SyntaxTree.method_name(null, null, new PascalABCCompiler.SyntaxTree.ident(compiler_string_consts.default_constructor_name), null); + constr.name = new SyntaxTree.method_name(null, null, new PascalABCCompiler.SyntaxTree.ident(StringConstants.default_constructor_name), null); constr.proc_attributes = pal; SyntaxTree.block bl = new SyntaxTree.block(); bl.program_code = new SyntaxTree.statement_list(); @@ -4338,7 +4338,7 @@ namespace PascalABCCompiler.TreeConverter public override void visit(SyntaxTree.simple_property _simple_property) { if (_simple_property.accessors == null) - AddError(get_location(_simple_property), "PROPERTYACCESSOR_{0}_OR_{1}_EXPECTED", compiler_string_consts.PascalReadAccessorName, compiler_string_consts.PascalWriteAccessorName); + AddError(get_location(_simple_property), "PROPERTYACCESSOR_{0}_OR_{1}_EXPECTED", StringConstants.PascalReadAccessorName, StringConstants.PascalWriteAccessorName); if (_simple_property.property_type == null) AddError(get_location(_simple_property.property_name), "TYPE_NAME_EXPECTED"); string name = _simple_property.property_name.name; @@ -4575,7 +4575,7 @@ namespace PascalABCCompiler.TreeConverter AddError(get_location(_simple_property.accessors.read_accessor.accessor_name), "ACCESSOR_{0}_MUST_BE_STATIC", cfield.name); if (pn.polymorphic_state != SemanticTree.polymorphic_state.ps_static && cfield.polymorphic_state == SemanticTree.polymorphic_state.ps_static) AddError(get_location(_simple_property.accessors.read_accessor.accessor_name), "ACCESSOR_{0}_CANNOT_BE_STATIC", cfield.name); - read_accessor = GenerateGetMethodForField(pn, compiler_string_consts.GetGetAccessorName(pn.name), cfield, loc1); + read_accessor = GenerateGetMethodForField(pn, StringConstants.GetGetAccessorName(pn.name), cfield, loc1); } //Вот здесь уже можем добавить акцессор для чтения. @@ -4715,7 +4715,7 @@ namespace PascalABCCompiler.TreeConverter AddError(get_location(_simple_property.accessors.write_accessor.accessor_name), "ACCESSOR_{0}_MUST_BE_STATIC", cfield.name); if (pn.polymorphic_state != SemanticTree.polymorphic_state.ps_static && cfield.polymorphic_state == SemanticTree.polymorphic_state.ps_static) AddError(get_location(_simple_property.accessors.write_accessor.accessor_name), "ACCESSOR_{0}_CANNOT_BE_STATIC", cfield.name); - write_accessor = GenerateSetMethodForField(pn, compiler_string_consts.GetSetAccessorName(pn.name), cfield, loc2); + write_accessor = GenerateSetMethodForField(pn, StringConstants.GetSetAccessorName(pn.name), cfield, loc2); } //Вот здесь уже можем добавить акцессор для чтения. pn.internal_set_function = write_accessor; @@ -4854,7 +4854,7 @@ namespace PascalABCCompiler.TreeConverter cpn.polymorphic_state, context.get_field_access_level(), null); cpn.common_comprehensive_type.methods.AddElement(cmn); common_parameter cp = new common_parameter( - compiler_string_consts.value, cf.type, SemanticTree.parameter_type.value, + StringConstants.value, cf.type, SemanticTree.parameter_type.value, cmn, concrete_parameter_type.cpt_none, null, loc); cmn.parameters.AddElement(cp); cmn.is_overload = true; @@ -4868,14 +4868,14 @@ namespace PascalABCCompiler.TreeConverter { var_ref = new static_class_field_reference(cf, loc); } - cmn.function_code = find_operator(compiler_string_consts.assign_name, var_ref, cpr, loc); + cmn.function_code = find_operator(StringConstants.assign_name, var_ref, cpr, loc); cf.cont_type.Scope.AddSymbol(AcessorName, new SymbolInfo(cmn)); return cmn; } internal expression_node make_assign_operator(addressed_expression left, expression_node right, location loc) { - return find_operator(compiler_string_consts.assign_name, left, right, loc); + return find_operator(StringConstants.assign_name, left, right, loc); } internal function_node GenerateGetMethodForField(common_property_node cpn, string AcessorName, class_field cf, location loc) @@ -4919,8 +4919,8 @@ namespace PascalABCCompiler.TreeConverter { string AcessorName = (get_meth) ? - compiler_string_consts.GetGetAccessorName(pn.name) : - compiler_string_consts.GetSetAccessorName(pn.name); + StringConstants.GetGetAccessorName(pn.name) : + StringConstants.GetSetAccessorName(pn.name); List exist_sil = context.find_only_in_namespace(AcessorName); if (exist_sil != null && exist_sil.FirstOrDefault().sym_info.general_node_type != general_node_type.function_node) { @@ -4949,7 +4949,7 @@ namespace PascalABCCompiler.TreeConverter //{ // if (par.name == //} - common_parameter accp = new common_parameter(compiler_string_consts.value_in_accessor_name, + common_parameter accp = new common_parameter(StringConstants.value_in_accessor_name, SemanticTree.parameter_type.value, cmn, concrete_parameter_type.cpt_none, null); accp.type = pn.internal_property_type; cmn.parameters.AddElement(accp); @@ -5446,7 +5446,7 @@ namespace PascalABCCompiler.TreeConverter if (templ_args_count != 0) { //Ищем generics - sil = context.find(id.name + compiler_string_consts.generic_params_infix + templ_args_count.ToString()); + sil = context.find(id.name + StringConstants.generic_params_infix + templ_args_count.ToString()); if (sil != null) { sil = new List { new SymbolInfo(get_generic_instance(sil?.FirstOrDefault(), iwt.template_params.params_list)) }; @@ -6044,7 +6044,7 @@ namespace PascalABCCompiler.TreeConverter if (templ_args_count != 0) { //Ищем generics - sil = context.find(id_right.name + compiler_string_consts.generic_params_infix + templ_args_count.ToString()); + sil = context.find(id_right.name + StringConstants.generic_params_infix + templ_args_count.ToString()); if (sil != null) { sil = new List { new SymbolInfo(get_generic_instance(sil?.FirstOrDefault(), iwt.template_params.params_list)) }; @@ -6063,7 +6063,7 @@ namespace PascalABCCompiler.TreeConverter sil = nsn.findOnlyInNamespace(id_right.name); if (templ_args_count != 0) { - sil = nsn.find(id_right.name + compiler_string_consts.generic_params_infix + templ_args_count.ToString()); + sil = nsn.find(id_right.name + StringConstants.generic_params_infix + templ_args_count.ToString()); if (sil != null) { sil = new List { new SymbolInfo(get_generic_instance(sil?.FirstOrDefault(), iwt.template_params.params_list)) }; @@ -6850,7 +6850,7 @@ namespace PascalABCCompiler.TreeConverter expression_node en = convertion_data_and_alghoritms.create_simple_function_call(SystemLibrary.SystemLibInitializer.CopyWithSizeFunction.sym_info as function_node, loc, param0, cnfc); function_node fn = convertion_data_and_alghoritms.get_empty_conversion(en.type, retv.type, false); en = convertion_data_and_alghoritms.create_simple_function_call(fn, loc, en); - basic_function_call bfc = new basic_function_call(tn.find(compiler_string_consts.assign_name).FirstOrDefault().sym_info as basic_function_node, loc, param0, en); + basic_function_call bfc = new basic_function_call(tn.find(StringConstants.assign_name).FirstOrDefault().sym_info as basic_function_node, loc, param0, en); return_value(bfc); return; } @@ -7829,7 +7829,7 @@ namespace PascalABCCompiler.TreeConverter { if (SystemLibrary.SystemLibInitializer.PointerOutputConstructor == null) { - List sil = (SystemLibrary.SystemLibInitializer.PointerOutputType.sym_info as common_type_node).find_in_type(compiler_string_consts.default_constructor_name); + List sil = (SystemLibrary.SystemLibInitializer.PointerOutputType.sym_info as common_type_node).find_in_type(StringConstants.default_constructor_name); common_method_node cnode = null; int cur_si_ind = 0; do @@ -7862,7 +7862,7 @@ namespace PascalABCCompiler.TreeConverter { if (SystemLibrary.SystemLibInitializer.PointerOutputConstructor == null) { - List sil = (SystemLibrary.SystemLibInitializer.PointerOutputType.sym_info as compiled_type_node).find_in_type(compiler_string_consts.default_constructor_name); + List sil = (SystemLibrary.SystemLibInitializer.PointerOutputType.sym_info as compiled_type_node).find_in_type(StringConstants.default_constructor_name); compiled_constructor_node cnode = null; int cur_si_index = 0; do @@ -8005,7 +8005,7 @@ namespace PascalABCCompiler.TreeConverter internal_interface ii = cmc.obj.type.get_internal_interface(internal_interface_kind.bounded_array_interface); if (ii != null) { - if (cmc.function_node.name == compiler_string_consts.get_val_pascal_array_name) + if (cmc.function_node.name == StringConstants.get_val_pascal_array_name) { bounded_array_interface bai = (bounded_array_interface)ii; class_field cf = bai.int_array; @@ -8063,7 +8063,7 @@ namespace PascalABCCompiler.TreeConverter internal_interface ii = cmc.obj.type.get_internal_interface(internal_interface_kind.bounded_array_interface); if (ii != null) { - if (cmc.function_node.name == compiler_string_consts.get_val_pascal_array_name) + if (cmc.function_node.name == StringConstants.get_val_pascal_array_name) { bounded_array_interface bai = (bounded_array_interface)ii; class_field cf = bai.int_array; @@ -8348,7 +8348,7 @@ namespace PascalABCCompiler.TreeConverter internal_interface ii = cmc.obj.type.get_internal_interface(internal_interface_kind.bounded_array_interface); if (ii != null) { - if (cmc.function_node.name == compiler_string_consts.get_val_pascal_array_name) + if (cmc.function_node.name == StringConstants.get_val_pascal_array_name) { bounded_array_interface bai = (bounded_array_interface)ii; class_field cf = bai.int_array; @@ -8581,7 +8581,7 @@ namespace PascalABCCompiler.TreeConverter internal_interface ii = cmc.obj.type.get_internal_interface(internal_interface_kind.bounded_array_interface); if (ii != null) { - if (cmc.function_node.name == compiler_string_consts.get_val_pascal_array_name) + if (cmc.function_node.name == StringConstants.get_val_pascal_array_name) { bounded_array_interface bai = (bounded_array_interface)ii; class_field cf = bai.int_array; @@ -8916,7 +8916,7 @@ namespace PascalABCCompiler.TreeConverter if (is_char_getter) expr = convertion_data_and_alghoritms.create_simple_function_call(SystemLibrary.SystemLibInitializer.StringDefaultPropertySetProcedure.sym_info as function_node, loc, (en as simple_array_indexing).simple_arr_expr, (en as simple_array_indexing).ind_expr, expr); else - expr = find_operator(compiler_string_consts.assign_name, en, expr, loc); + expr = find_operator(StringConstants.assign_name, en, expr, loc); last_call = expr; } else if (read_from_binary_file) @@ -8931,7 +8931,7 @@ namespace PascalABCCompiler.TreeConverter function_node fn = convertion_data_and_alghoritms.select_function(exl,SystemLibrary.SystemLibInitializer.BinaryFileReadProcedure.SymbolInfo, loc); expression_node expr = convertion_data_and_alghoritms.create_simple_function_call(fn, get_location(ex), exl.ToArray()); expr = convertion_data_and_alghoritms.explicit_convert_type(expr, en.type); - expr = find_operator(compiler_string_consts.assign_name, en, expr, loc); + expr = find_operator(StringConstants.assign_name, en, expr, loc); last_call = expr; } else @@ -9061,7 +9061,7 @@ namespace PascalABCCompiler.TreeConverter case semantic_node_type.compiled_constructor_call: case semantic_node_type.common_constructor_call: case semantic_node_type.compiled_static_method_call: - return convertion_data_and_alghoritms.CreateVariableReference(context.add_var_definition(compiler_string_consts.GetTempVariableName(), sl, expr.type, expr), sl); + return convertion_data_and_alghoritms.CreateVariableReference(context.add_var_definition(StringConstants.GetTempVariableName(), sl, expr.type, expr), sl); case semantic_node_type.class_field_reference: (expr as class_field_reference).obj = create_with_expression((expr as class_field_reference).obj); return expr; @@ -9077,9 +9077,9 @@ namespace PascalABCCompiler.TreeConverter (expr as dereference_node).deref_expr = create_with_expression((expr as dereference_node).deref_expr); return expr; case semantic_node_type.basic_function_call: - return convertion_data_and_alghoritms.CreateVariableReference(context.add_var_definition(compiler_string_consts.GetTempVariableName(), sl, expr.type, expr), sl); + return convertion_data_and_alghoritms.CreateVariableReference(context.add_var_definition(StringConstants.GetTempVariableName(), sl, expr.type, expr), sl); case semantic_node_type.as_node: - return convertion_data_and_alghoritms.CreateVariableReference(context.add_var_definition(compiler_string_consts.GetTempVariableName(), sl, expr.type, expr), sl); + return convertion_data_and_alghoritms.CreateVariableReference(context.add_var_definition(StringConstants.GetTempVariableName(), sl, expr.type, expr), sl); } return expr; } @@ -9118,7 +9118,7 @@ namespace PascalABCCompiler.TreeConverter { location sl = get_location(s_expr); if (expr.type.type_special_kind != SemanticTree.type_special_kind.record) - vr = convertion_data_and_alghoritms.CreateVariableReference(context.add_var_definition(compiler_string_consts.GetTempVariableName(), sl, expr.type, expr), sl); + vr = convertion_data_and_alghoritms.CreateVariableReference(context.add_var_definition(StringConstants.GetTempVariableName(), sl, expr.type, expr), sl); else expr = create_with_expression(expr); } @@ -11281,7 +11281,7 @@ namespace PascalABCCompiler.TreeConverter // end frninja - common_namespace_function_node main_function = new common_namespace_function_node(compiler_string_consts.temp_main_function_name, + common_namespace_function_node main_function = new common_namespace_function_node(StringConstants.temp_main_function_name, null, null, cnsn, null); main_function.function_code = context.code; context.apply_special_local_vars(main_function); @@ -11996,7 +11996,7 @@ namespace PascalABCCompiler.TreeConverter if (SemanticRules.RuntimeInitVariablesOfGenericParameters && !ctn.IsInterface && !ctn.IsDelegate) { class_field cf = new class_field( - compiler_string_consts.generic_param_kind_prefix + id.name, + StringConstants.generic_param_kind_prefix + id.name, SystemLibrary.SystemLibrary.byte_type, ctn, PascalABCCompiler.SemanticTree.polymorphic_state.ps_static, SemanticTree.field_access_level.fal_public, null); @@ -12113,7 +12113,7 @@ namespace PascalABCCompiler.TreeConverter { AddError(loc, "GENERIC_DELEGATE_INNER_FUNCTION"); } - del_name += compiler_string_consts.generic_params_infix + ttn.template_args.idents.Count; + del_name += StringConstants.generic_params_infix + ttn.template_args.idents.Count; } context.check_name_free(del_name, loc); common_type_node del_type = convertion_data_and_alghoritms.type_constructor.create_delegate_without_init( @@ -12284,7 +12284,7 @@ namespace PascalABCCompiler.TreeConverter bool predefined_generic = false; if (is_generic) { - List sil = context.find_only_in_namespace(_type_declaration.type_name.name + compiler_string_consts.generic_params_infix + + List sil = context.find_only_in_namespace(_type_declaration.type_name.name + StringConstants.generic_params_infix + cl_def.template_args.idents.Count.ToString()); if (!(sil != null && sil.FirstOrDefault().sym_info is common_type_node && ((sil.FirstOrDefault().sym_info as common_type_node).IsPartial || context.types_predefined.IndexOf(sil.FirstOrDefault().sym_info as common_type_node) != -1))) { @@ -12292,7 +12292,7 @@ namespace PascalABCCompiler.TreeConverter } else predefined_generic = true; - _type_declaration.type_name.name += compiler_string_consts.generic_params_infix + + _type_declaration.type_name.name += StringConstants.generic_params_infix + cl_def.template_args.idents.Count.ToString(); } if (cl_def.keyword == SyntaxTree.class_keyword.Record) @@ -13234,7 +13234,7 @@ namespace PascalABCCompiler.TreeConverter { AddError(get_location(_function_header), "OVERLOADED_OPERATOR_MUST_BE_STATIC_FUNCTION"); } - if (cmmn != null && (cmmn.name == compiler_string_consts.implicit_operator_name || cmmn.name == compiler_string_consts.explicit_operator_name)) + if (cmmn != null && (cmmn.name == StringConstants.implicit_operator_name || cmmn.name == StringConstants.explicit_operator_name)) if (!convertion_data_and_alghoritms.eq_type_nodes(tn, cmmn.comperehensive_type as type_node) && !convertion_data_and_alghoritms.eq_type_nodes(cmmn.comperehensive_type as type_node, cmmn.parameters[0].type)) { AddError(get_location(_function_header.return_type), "RETURN_VALUE_SHOULD_HAVE_TYPE_{0}", (cmmn.comperehensive_type as type_node).PrintableName); @@ -13256,10 +13256,10 @@ namespace PascalABCCompiler.TreeConverter } if (!has_extensionmethod_attr(_function_header.proc_attributes.proc_attributes)) { - common_parameter cp = new common_parameter(compiler_string_consts.self_word, (context.top_function as common_namespace_function_node).ConnectedToType, pt, + common_parameter cp = new common_parameter(StringConstants.self_word, (context.top_function as common_namespace_function_node).ConnectedToType, pt, context.top_function, cpt, null, null); context.top_function.parameters.AddElementFirst(cp); - context.top_function.scope.AddSymbol(compiler_string_consts.self_word, new SymbolInfo(cp)); + context.top_function.scope.AddSymbol(StringConstants.self_word, new SymbolInfo(cp)); } } CheckOverrideOrReintroduceExpectedWarning(get_location(_function_header)); @@ -13411,7 +13411,7 @@ namespace PascalABCCompiler.TreeConverter if (context.top_function != null && context.top_function is common_namespace_function_node commonNode && - commonNode.name.ToLower() == compiler_string_consts.deconstruct_method_name) + commonNode.name.ToLower() == StringConstants.deconstruct_method_name) { var deconstructor = commonNode; @@ -13431,7 +13431,7 @@ namespace PascalABCCompiler.TreeConverter if (context.top_function != null && context.top_function is common_method_node methodNode && - methodNode.name.ToLower() == compiler_string_consts.deconstruct_method_name) + methodNode.name.ToLower() == StringConstants.deconstruct_method_name) { var deconstructor = methodNode; @@ -13511,14 +13511,14 @@ namespace PascalABCCompiler.TreeConverter if (cmn != null && !cmn.IsStatic) { - //if (cmn.find_only_in_namespace(compiler_string_consts.self_word) == null) + //if (cmn.find_only_in_namespace(StringConstants.self_word) == null) //self variable //добавляем self, обращение к ней заменяется на this_node type_node self_type = cmn.cont_type; if (cmn.cont_type.is_generic_type_definition) self_type = cmn.cont_type.get_instance(cmn.cont_type.generic_params.ConvertAll(o => (type_node)o)); - local_variable lv = new local_variable(compiler_string_consts.self_word, self_type, cmn, null); - cmn.scope.AddSymbol(compiler_string_consts.self_word, new SymbolInfo(lv)); + local_variable lv = new local_variable(StringConstants.self_word, self_type, cmn, null); + cmn.scope.AddSymbol(StringConstants.self_word, new SymbolInfo(lv)); cmn.self_variable = lv; } if (_procedure_definition.proc_body != null) @@ -13682,7 +13682,7 @@ namespace PascalABCCompiler.TreeConverter cmc.parameters.AddElement(new int_const_node((prm.type as short_string_type_node).Length, null)); concrete_parameter_type tmp_cpt = prm.concrete_parameter_type; prm.concrete_parameter_type = concrete_parameter_type.cpt_none; - sl.statements.AddElementFirst(find_operator(compiler_string_consts.assign_name, new common_parameter_reference(prm, 0, null), cmc, null)); + sl.statements.AddElementFirst(find_operator(StringConstants.assign_name, new common_parameter_reference(prm, 0, null), cmc, null)); prm.concrete_parameter_type = tmp_cpt; } else @@ -13704,7 +13704,7 @@ namespace PascalABCCompiler.TreeConverter cmc.parameters.AddElement(new simple_array_indexing(cpr, new local_variable_reference(var, 0, null), prm.type.element_type, null)); cmc.parameters.AddElement(new int_const_node((prm.type.element_type as short_string_type_node).Length, null)); - body.statements.AddElement(find_operator(compiler_string_consts.assign_name, new simple_array_indexing(cpr, new local_variable_reference(var, 0, null), prm.type.element_type, null), cmc, null)); + body.statements.AddElement(find_operator(StringConstants.assign_name, new simple_array_indexing(cpr, new local_variable_reference(var, 0, null), prm.type.element_type, null), cmc, null)); body.statements.AddElement(new basic_function_call(SystemLibrary.SystemLibrary.int_assign as basic_function_node, null, new local_variable_reference(var, 0, null), new basic_function_call(SystemLibrary.SystemLibrary.int_add as basic_function_node, null, new local_variable_reference(var, 0, null), new int_const_node(1, null)))); @@ -13809,7 +13809,7 @@ namespace PascalABCCompiler.TreeConverter AddError(get_location(_function_header), "OVERLOADED_OPERATOR_MUST_BE_STATIC_FUNCTION"); } - if ((cmmn.name == compiler_string_consts.implicit_operator_name || cmmn.name == compiler_string_consts.explicit_operator_name)) + if ((cmmn.name == StringConstants.implicit_operator_name || cmmn.name == StringConstants.explicit_operator_name)) { if (!convertion_data_and_alghoritms.eq_type_nodes(tn, cmmn.comperehensive_type as type_node) && !convertion_data_and_alghoritms.eq_type_nodes(cmmn.comperehensive_type as type_node, cmmn.parameters[0].type)) { @@ -13857,7 +13857,7 @@ namespace PascalABCCompiler.TreeConverter { common_namespace_function_node cnfn = context.top_function as common_namespace_function_node; - if ((cnfn.name == compiler_string_consts.implicit_operator_name || cnfn.name == compiler_string_consts.explicit_operator_name)) + if ((cnfn.name == StringConstants.implicit_operator_name || cnfn.name == StringConstants.explicit_operator_name)) { if (cnfn.parameters.Count != 1) AddError(new SimpleSemanticError(cnfn.loc,"EXTENSION_METHODS_MUST_HAVE_LEAST_ONE_PARAMETER")); @@ -13925,10 +13925,10 @@ namespace PascalABCCompiler.TreeConverter } if (!has_extensionmethod_attr(_function_header.proc_attributes.proc_attributes)) { - common_parameter cp = new common_parameter(compiler_string_consts.self_word, self_type, pt, + common_parameter cp = new common_parameter(StringConstants.self_word, self_type, pt, context.top_function, cpt, null, null); context.top_function.parameters.AddElementFirst(cp); - context.top_function.scope.AddSymbol(compiler_string_consts.self_word, new SymbolInfo(cp)); + context.top_function.scope.AddSymbol(StringConstants.self_word, new SymbolInfo(cp)); } } CheckOverrideOrReintroduceExpectedWarning(get_location(_function_header)); @@ -14091,11 +14091,11 @@ namespace PascalABCCompiler.TreeConverter } if (!has_extensionmethod_attr(_procedure_header.proc_attributes.proc_attributes)) { - common_parameter cp = new common_parameter(compiler_string_consts.self_word, self_type, pt, + common_parameter cp = new common_parameter(StringConstants.self_word, self_type, pt, context.top_function, cpt, null, null); context.top_function.parameters.AddElementFirst(cp); - context.top_function.scope.AddSymbol(compiler_string_consts.self_word, new SymbolInfo(cp)); + context.top_function.scope.AddSymbol(StringConstants.self_word, new SymbolInfo(cp)); } } @@ -14475,7 +14475,7 @@ namespace PascalABCCompiler.TreeConverter if (!context.top_function.IsOperator && context.top_function.parameters[0].parameter_type != SemanticTree.parameter_type.value && !(context.top_function.parameters[0].type is compiled_type_node ctn && ctn.compiled_type == typeof(string))) AddError(context.top_function.loc, "FIRST_PARAMETER_SHOULDBE_ONLY_VALUE_PARAMETER"); - if (!context.top_function.IsOperator && context.top_function.parameters[0].name.ToLower() != compiler_string_consts.self_word) + if (!context.top_function.IsOperator && context.top_function.parameters[0].name.ToLower() != StringConstants.self_word) AddError(context.top_function.loc,"FIRST_PARAMETER_MUST_HAVE_NAME_SELF"); common_namespace_function_node top_function = context.top_function as common_namespace_function_node; @@ -14503,7 +14503,7 @@ namespace PascalABCCompiler.TreeConverter (SystemLibrary.SystemLibInitializer.TypedFileType.sym_info as type_node).Scope.AddSymbol(top_function.name, new SymbolInfo(context.top_function)); if (top_function.ConnectedToType.IsDelegate && context.top_function.IsOperator && (context.top_function.name == "+" || context.top_function.name == "-" || context.top_function.name == "+=" || context.top_function.name == "-=")) AddError(get_location(_procedure_attributes_list), "CANNOT_EXTEND_STANDARD_OPERATORS_FOR_DELEGATE"); - if (context.top_function.IsOperator && (context.top_function.name == compiler_string_consts.implicit_operator_name || context.top_function.name == compiler_string_consts.explicit_operator_name) && context.top_function.parameters.Count == 1 && context.top_function.return_value_type != null) + if (context.top_function.IsOperator && (context.top_function.name == StringConstants.implicit_operator_name || context.top_function.name == StringConstants.explicit_operator_name) && context.top_function.parameters.Count == 1 && context.top_function.return_value_type != null) { if (!(context.top_function.return_value_type is compiled_type_node) && !(context.top_function.return_value_type is compiled_generic_instance_type_node) || !(context.top_function.parameters[0].type is compiled_type_node) && !(context.top_function.parameters[0].type is compiled_generic_instance_type_node)) ;//AddError(get_location(_procedure_attributes_list), "IMPLICIT_EXPLICIT_OPERATOR_EXTENSION_ONLY_FOR_COMPILED_CLASSES_ALLOWED"); @@ -14556,7 +14556,7 @@ namespace PascalABCCompiler.TreeConverter if (cnode != null && cnode.IsOperator) { - if (cnode.name != compiler_string_consts.implicit_operator_name && cnode.name != compiler_string_consts.explicit_operator_name) + if (cnode.name != StringConstants.implicit_operator_name && cnode.name != StringConstants.explicit_operator_name) { bool all_types_mismatch = true; foreach (parameter par in pars) @@ -14584,7 +14584,7 @@ namespace PascalABCCompiler.TreeConverter int pcount = name_reflector.get_params_count(context.top_function.name); if (pcount != pars.Count) { - if (context.top_function.name != compiler_string_consts.minus_name && context.top_function.name != compiler_string_consts.plus_name) + if (context.top_function.name != StringConstants.minus_name && context.top_function.name != StringConstants.plus_name) AddError(context.top_function.loc, "OPERATOR_{0}_PARAMETERS_COUNT_MUST_EQUAL_{1}", context.top_function.name, pcount); else if (pars.Count != 1 && pars.Count != 2) @@ -14975,7 +14975,7 @@ namespace PascalABCCompiler.TreeConverter var cnf = exp as common_namespace_function_call; if (cnf != null) { - is_userdefined = ! (cnf.function_node.namespace_node.namespace_name.Equals(compiler_string_consts.pascalSystemUnitName) || cnf.function_node.namespace_node.namespace_name.Equals("PABCSystem_implementation______")); + is_userdefined = ! (cnf.function_node.namespace_node.namespace_name.Equals(StringConstants.pascalSystemUnitName) || cnf.function_node.namespace_node.namespace_name.Equals("PABCSystem_implementation______")); } return convert_strong_to_constant_node(exp, exp.type, is_const_section && is_userdefined, is_const_section); } @@ -15099,7 +15099,7 @@ namespace PascalABCCompiler.TreeConverter var cnf = exp as common_namespace_function_call; if (cnf != null) { - is_userdefined = !(cnf.function_node.namespace_node.namespace_name.Equals(compiler_string_consts.pascalSystemUnitName) || cnf.function_node.namespace_node.namespace_name.Equals("PABCSystem_implementation______")); + is_userdefined = !(cnf.function_node.namespace_node.namespace_name.Equals(StringConstants.pascalSystemUnitName) || cnf.function_node.namespace_node.namespace_name.Equals("PABCSystem_implementation______")); } return convert_strong_to_constant_node(exp, tn, is_const_section && is_userdefined, is_const_section); @@ -16253,7 +16253,7 @@ namespace PascalABCCompiler.TreeConverter internal_interface ii = cmc.obj.type.get_internal_interface(internal_interface_kind.bounded_array_interface); if (ii != null) { - if (cmc.function_node.name == compiler_string_consts.get_val_pascal_array_name) + if (cmc.function_node.name == StringConstants.get_val_pascal_array_name) { bounded_array_interface bai = (bounded_array_interface)ii; class_field cf = bai.int_array; @@ -16308,7 +16308,7 @@ namespace PascalABCCompiler.TreeConverter internal_interface ii = cmc.expression.type.get_internal_interface(internal_interface_kind.bounded_array_interface); if (ii != null) { - //if (cmc.function_node.name == compiler_string_consts.get_val_pascal_array_name) + //if (cmc.function_node.name == StringConstants.get_val_pascal_array_name) { bounded_array_interface bai = (bounded_array_interface)ii; class_field cf = bai.int_array; @@ -16329,7 +16329,7 @@ namespace PascalABCCompiler.TreeConverter internal_interface ii = cmc.obj.type.get_internal_interface(internal_interface_kind.bounded_array_interface); if (ii != null) { - //if (cmc.function_node.name == compiler_string_consts.get_val_pascal_array_name) + //if (cmc.function_node.name == StringConstants.get_val_pascal_array_name) { bounded_array_interface bai = (bounded_array_interface)ii; class_field cf = bai.int_array; @@ -17451,7 +17451,7 @@ namespace PascalABCCompiler.TreeConverter List sil = null; if (cmn.is_constructor) - sil = context.converted_type.base_type.find_in_type(compiler_string_consts.default_constructor_name, context.CurrentScope); + sil = context.converted_type.base_type.find_in_type(StringConstants.default_constructor_name, context.CurrentScope); else sil = context.converted_type.base_type.find_in_type(cmn.name, context.CurrentScope); if (sil != null) @@ -18012,9 +18012,9 @@ namespace PascalABCCompiler.TreeConverter AddError(new EventNameExpected(get_location(_assign.to))); string format; if (_assign.operator_type == PascalABCCompiler.SyntaxTree.Operators.AssignmentSubtraction) - format = compiler_string_consts.event_remove_method_nameformat; + format = StringConstants.event_remove_method_nameformat; else - format = compiler_string_consts.event_add_method_nameformat; + format = StringConstants.event_add_method_nameformat; SyntaxTree.ident add_name = new SyntaxTree.ident(string.Format(format, event_name.name)); add_name.source_context = event_name.source_context; if (dot != null) @@ -18393,7 +18393,7 @@ namespace PascalABCCompiler.TreeConverter private bool IsGetEnumerator(type_node tn, ref type_node elem_type) { if (tn == null || tn is null_type_node || tn.ImplementingInterfaces == null) return false; - compiled_type_node ctn = compiled_type_node.get_type_node(NetHelper.NetHelper.FindType(compiler_string_consts.IEnumerableInterfaceName)); + compiled_type_node ctn = compiled_type_node.get_type_node(NetHelper.NetHelper.FindType(StringConstants.IEnumerableInterfaceName)); if (tn == ctn) return true; foreach (SemanticTree.ITypeNode itn in tn.ImplementingInterfaces) @@ -18403,7 +18403,7 @@ namespace PascalABCCompiler.TreeConverter elem_type = tn.element_type; if (elem_type != null) return true; function_node get_enumerator_func = null; - List sil = ctn.find_in_type(compiler_string_consts.GetEnumeratorMethodName); + List sil = ctn.find_in_type(StringConstants.GetEnumeratorMethodName); if(sil != null) foreach(SymbolInfo si in sil) { @@ -18414,7 +18414,7 @@ namespace PascalABCCompiler.TreeConverter break; get_enumerator_func = null; } - elem_type = (get_enumerator_func.return_value_type.find_first_in_type(compiler_string_consts.CurrentPropertyName).sym_info as property_node).get_function.return_value_type; + elem_type = (get_enumerator_func.return_value_type.find_first_in_type(StringConstants.CurrentPropertyName).sym_info as property_node).get_function.return_value_type; return true; } } @@ -18934,8 +18934,8 @@ namespace PascalABCCompiler.TreeConverter //Обрабатываем generic-типы int tcount = _template_type_reference.params_list.params_list.Count; string temp_name = _template_type_reference.name.names[last_num - 1].name; - if (!_template_type_reference.name.names[last_num - 1].name.Contains(compiler_string_consts.generic_params_infix)) // SSM 26.03.14 - _template_type_reference.name.names[last_num - 1].name += compiler_string_consts.generic_params_infix + tcount; + if (!_template_type_reference.name.names[last_num - 1].name.Contains(StringConstants.generic_params_infix)) // SSM 26.03.14 + _template_type_reference.name.names[last_num - 1].name += StringConstants.generic_params_infix + tcount; sil = context.find_definition_node(_template_type_reference.name, loc); if (sil != null) { @@ -19178,7 +19178,7 @@ namespace PascalABCCompiler.TreeConverter type_synonym_instancing = false; foreach (type_definition td in saved_sc_dict.Keys) td.source_context = saved_sc_dict[td]; - ctn.fields.AddElement(new class_field(compiler_string_consts.synonym_value_name, + ctn.fields.AddElement(new class_field(StringConstants.synonym_value_name, synonym_value, ctn, PascalABCCompiler.SemanticTree.polymorphic_state.ps_static, PascalABCCompiler.SemanticTree.field_access_level.fal_public, null)); } @@ -19285,7 +19285,7 @@ namespace PascalABCCompiler.TreeConverter { AddError(loc, "ABSTRACT_CONSTRUCTOR_{0}_CALL", tn.name); } - List sil = tn.find_in_type(TreeConverter.compiler_string_consts.default_constructor_name, context.CurrentScope); //tn.Scope); + List sil = tn.find_in_type(StringConstants.default_constructor_name, context.CurrentScope); //tn.Scope); delete_inherited_constructors(ref sil, tn); if (sil == null) AddError(loc, "CONSTRUCTOR_NOT_FOUND"); @@ -19761,56 +19761,53 @@ namespace PascalABCCompiler.TreeConverter public override void visit(SyntaxTree.compiler_directive node) { - if (node.Name.text.ToLower() == compiler_string_consts.compiler_directive_faststrings) + if (node.Name.text.ToLower() == StringConstants.compiler_directive_faststrings) { SemanticRules.FastStrings = true; return; } - if (node.Name.text.ToLower() == compiler_string_consts.compiler_directive_zerobasedstrings) + if (node.Name.text.ToLower() == StringConstants.compiler_directive_zerobasedstrings) { var paramOnOff = node.Directive.text.ToLower(); if (paramOnOff == "on" || paramOnOff == "") SemanticRules.ZeroBasedStrings = true; else if (paramOnOff == "off") SemanticRules.ZeroBasedStrings = false; - //SemanticRules.ZeroBasedStrings = node.Directive.text.ToLower() == compiler_string_consts.true_const_name; return; } - if (node.Name.text.ToLower() == compiler_string_consts.compiler_directive_zerobasedstrings_ON) + if (node.Name.text.ToLower() == StringConstants.compiler_directive_zerobasedstrings_ON) { SemanticRules.ZeroBasedStrings = true; return; } - if (node.Name.text.ToLower() == compiler_string_consts.compiler_directive_zerobasedstrings_OFF) + if (node.Name.text.ToLower() == StringConstants.compiler_directive_zerobasedstrings_OFF) { SemanticRules.ZeroBasedStrings = false; return; } - if (node.Name.text.ToLower() == compiler_string_consts.compiler_directive_nullbasedstrings_ON) + if (node.Name.text.ToLower() == StringConstants.compiler_directive_nullbasedstrings_ON) { SemanticRules.ZeroBasedStrings = true; return; } - if (node.Name.text.ToLower() == compiler_string_consts.compiler_directive_nullbasedstrings_OFF) + if (node.Name.text.ToLower() == StringConstants.compiler_directive_nullbasedstrings_OFF) { SemanticRules.ZeroBasedStrings = false; return; } - if (node.Name.text.ToLower() == compiler_string_consts.compiler_directive_initstring_as_empty_ON) + if (node.Name.text.ToLower() == StringConstants.compiler_directive_initstring_as_empty_ON) { SemanticRules.InitStringAsEmptyString = true; return; } - if (node.Name.text.ToLower() == compiler_string_consts.compiler_directive_initstring_as_empty_OFF) + if (node.Name.text.ToLower() == StringConstants.compiler_directive_initstring_as_empty_OFF) { SemanticRules.InitStringAsEmptyString = false; return; } - if (node.Name.text == "platform" && node.Directive.text.ToLower() == "native") + if (node.Name.text == StringConstants.compiler_directive_platformtarget && node.Directive.text.ToLower() == "native") { SemanticRules.GenerateNativeCode = true; - - return; } } @@ -19889,7 +19886,7 @@ namespace PascalABCCompiler.TreeConverter return; { - var fn = _ctn.base_type.find_in_type(compiler_string_consts.default_constructor_name, _ctn.base_type.Scope) + var fn = _ctn.base_type.find_in_type(StringConstants.default_constructor_name, _ctn.base_type.Scope) ?.Select(si => si.sym_info).OfType() .FirstOrDefault(_fn => _fn.parameters.Count == 0); var base_constructor_call = make_base_constructor_call(fn, out _, out _); @@ -19923,7 +19920,7 @@ namespace PascalABCCompiler.TreeConverter return; } //Получили список процедур предка, имеющих имя Create - List sil = _ctn.base_type.find_in_type(compiler_string_consts.default_constructor_name, _ctn.base_type.Scope); + List sil = _ctn.base_type.find_in_type(StringConstants.default_constructor_name, _ctn.base_type.Scope); delete_inherited_constructors(ref sil, _ctn.base_type); if (sil != null) { @@ -19953,12 +19950,12 @@ namespace PascalABCCompiler.TreeConverter // Иначе partial классам генерирует кучу копий дефолтных конструкторов if (_ctn.methods.Any(m => - m.is_constructor && m.name == compiler_string_consts.default_constructor_name && + m.is_constructor && m.name == StringConstants.default_constructor_name && m.parameters.Count == fn.parameters.Count && m.parameters.Zip(fn.parameters, (par1, par2) => par1.type == par2.type).All(b => b) )) continue; - var gen_constr = context.create_function(compiler_string_consts.default_constructor_name, loc) as common_method_node; + var gen_constr = context.create_function(StringConstants.default_constructor_name, loc) as common_method_node; gen_constr.polymorphic_state = ps; gen_constr.is_overload = true; gen_constr.is_constructor = true; @@ -20029,8 +20026,8 @@ namespace PascalABCCompiler.TreeConverter gen_func.parameters.AddElement(c_p); } - local_variable lv = new local_variable(compiler_string_consts.self_word, gen_func.cont_type, gen_func, null); - gen_func.scope.AddSymbol(compiler_string_consts.self_word, new SymbolInfo(lv)); + local_variable lv = new local_variable(StringConstants.self_word, gen_func.cont_type, gen_func, null); + gen_func.scope.AddSymbol(StringConstants.self_word, new SymbolInfo(lv)); gen_func.self_variable = lv; base_function_call bfc; @@ -20204,7 +20201,7 @@ namespace PascalABCCompiler.TreeConverter //context.check_labels(context.converted_namespace.labels); //TODO: Доделать. - //common_namespace_function_node main_function = new common_namespace_function_node(compiler_string_consts.temp_main_function_name, + //common_namespace_function_node main_function = new common_namespace_function_node(StringConstants.temp_main_function_name, // null, null, cnsn, null); //main_function.function_code = context.code; //cnsn.functions.AddElement(main_function); @@ -20214,7 +20211,7 @@ namespace PascalABCCompiler.TreeConverter bool main_not_found = true; foreach (function_node fn in cnsn.functions) { - if (fn.name == compiler_string_consts.c_main_function_name) + if (fn.name == StringConstants.c_main_function_name) { _compiled_unit.main_function = fn as common_namespace_function_node; //context.apply_special_local_vars(_compiled_unit.main_function); @@ -20363,7 +20360,7 @@ namespace PascalABCCompiler.TreeConverter int par_count = _ident_with_templateparams.template_params.params_list.Count; if (id_ex != null) { - SymbolInfo type_si = context.find_first(id_ex.name + compiler_string_consts.generic_params_infix + par_count.ToString()); + SymbolInfo type_si = context.find_first(id_ex.name + StringConstants.generic_params_infix + par_count.ToString()); if (type_si != null) { return_value(get_generic_instance(type_si, _ident_with_templateparams.template_params.params_list)); @@ -20397,15 +20394,15 @@ namespace PascalABCCompiler.TreeConverter List type_sil = null; if (tn != null) { - type_sil = tn.find_in_type(id_ex.name + compiler_string_consts.generic_params_infix + par_count.ToString()); + type_sil = tn.find_in_type(id_ex.name + StringConstants.generic_params_infix + par_count.ToString()); } else if (nn != null) { - type_sil = nn.find(id_ex.name + compiler_string_consts.generic_params_infix + par_count.ToString()); + type_sil = nn.find(id_ex.name + StringConstants.generic_params_infix + par_count.ToString()); } else if (un != null) { - type_sil = un.find_only_in_namespace(id_ex.name + compiler_string_consts.generic_params_infix + par_count.ToString()); + type_sil = un.find_only_in_namespace(id_ex.name + StringConstants.generic_params_infix + par_count.ToString()); } if (type_sil != null) { @@ -20948,7 +20945,7 @@ namespace PascalABCCompiler.TreeConverter { AddError(get_location(_function_header), "OVERLOADED_OPERATOR_MUST_BE_STATIC_FUNCTION"); } - if (cmmn != null && (cmmn.name == compiler_string_consts.implicit_operator_name || cmmn.name == compiler_string_consts.explicit_operator_name)) + if (cmmn != null && (cmmn.name == StringConstants.implicit_operator_name || cmmn.name == StringConstants.explicit_operator_name)) if (!convertion_data_and_alghoritms.eq_type_nodes(tn, cmmn.comperehensive_type as type_node) && !convertion_data_and_alghoritms.eq_type_nodes(cmmn.comperehensive_type as type_node, cmmn.parameters[0].type)) { AddError(get_location(_function_header.return_type), "RETURN_VALUE_SHOULD_HAVE_TYPE_{0}", (cmmn.comperehensive_type as type_node).PrintableName); @@ -20968,10 +20965,10 @@ namespace PascalABCCompiler.TreeConverter cpt = concrete_parameter_type.cpt_var; pt = PascalABCCompiler.SemanticTree.parameter_type.var; } - common_parameter cp = new common_parameter(compiler_string_consts.self_word, (context.top_function as common_namespace_function_node).ConnectedToType, pt, + common_parameter cp = new common_parameter(StringConstants.self_word, (context.top_function as common_namespace_function_node).ConnectedToType, pt, context.top_function, cpt, null, null); context.top_function.parameters.AddElementFirst(cp); - context.top_function.scope.AddSymbol(compiler_string_consts.self_word, new SymbolInfo(cp)); + context.top_function.scope.AddSymbol(StringConstants.self_word, new SymbolInfo(cp)); } CheckOverrideOrReintroduceExpectedWarning(get_location(_function_header)); @@ -21585,7 +21582,7 @@ namespace PascalABCCompiler.TreeConverter public method_call ToNullable(expression e) { - var dn = new dot_node(new ident(compiler_string_consts.pascalSystemUnitName), new ident("DQNToNullable")); + var dn = new dot_node(new ident(StringConstants.pascalSystemUnitName), new ident("DQNToNullable")); return new method_call(dn, new expression_list(e), e.source_context); } @@ -21608,7 +21605,7 @@ namespace PascalABCCompiler.TreeConverter try_convert_typed_expression_to_function_call(ref av_cs); if (!type_table.is_with_nil_allowed(av_cs.type)) { - var dn = new dot_node(new ident(compiler_string_consts.pascalSystemUnitName), new ident("DQNToNullable")); + var dn = new dot_node(new ident(StringConstants.pascalSystemUnitName), new ident("DQNToNullable")); (av.new_addr_value as SyntaxTree.question_colon_expression).ret_if_false = new method_call(dn, new expression_list((av.new_addr_value as SyntaxTree.question_colon_expression).ret_if_false), av.source_context); diff --git a/TreeConverter/TreeConversion/type_constructor.cs b/TreeConverter/TreeConversion/type_constructor.cs index 17ce01732..68d4786f6 100644 --- a/TreeConverter/TreeConversion/type_constructor.cs +++ b/TreeConverter/TreeConversion/type_constructor.cs @@ -67,7 +67,7 @@ namespace PascalABCCompiler.TreeConverter { ctn.add_internal_interface(aii); } - ctn.SetName(compiler_string_consts.get_array_type_name(ctn.element_type.name,rank)); + ctn.SetName(StringConstants.get_array_type_name(ctn.element_type.name,rank)); if (!types_unsized_arrays.TryGetValue(element_type,out ret)) { ret = new List(); @@ -86,7 +86,7 @@ namespace PascalABCCompiler.TreeConverter } common_type_node comtn = new common_type_node(SystemLibrary.SystemLibrary.array_base_type, - compiler_string_consts.get_array_type_name(element_type.name,rank), SemanticTree.type_access_level.tal_public, + StringConstants.get_array_type_name(element_type.name,rank), SemanticTree.type_access_level.tal_public, cmn, convertion_data_and_alghoritms.symbol_table.CreateClassScope(top_scope,SystemLibrary.SystemLibrary.array_base_type.Scope), loc); comtn.internal_type_special_kind = SemanticTree.type_special_kind.array_kind; comtn.is_class = true; @@ -199,9 +199,9 @@ namespace PascalABCCompiler.TreeConverter el.AddElement(exprs[0]); el.AddElement(cfc); - SymbolInfo si = exprs[0].type.find_first_in_type(compiler_string_consts.assign_name); + SymbolInfo si = exprs[0].type.find_first_in_type(StringConstants.assign_name); if (si == null && exprs[0].type.original_generic != null) - si = exprs[0].type.original_generic.find_first_in_type(compiler_string_consts.assign_name); + si = exprs[0].type.original_generic.find_first_in_type(StringConstants.assign_name); if (si == null) { throw new CompilerInternalError("Undefined delegate operation"); @@ -228,9 +228,9 @@ namespace PascalABCCompiler.TreeConverter el.AddElement(exprs[0]); el.AddElement(cfc); - SymbolInfo si = exprs[0].type.find_first_in_type(compiler_string_consts.assign_name); + SymbolInfo si = exprs[0].type.find_first_in_type(StringConstants.assign_name); if (si == null && exprs[0].type.original_generic != null) - si = exprs[0].type.original_generic.find_first_in_type(compiler_string_consts.assign_name); + si = exprs[0].type.original_generic.find_first_in_type(StringConstants.assign_name); if (si == null) { throw new CompilerInternalError("Undefined delegate operation"); @@ -270,18 +270,18 @@ namespace PascalABCCompiler.TreeConverter public void init_delegate(common_type_node ctn, type_node return_value_type, parameter_list parameters, location loc) { - common_method_node constructor=new common_method_node(compiler_string_consts.default_constructor_name,null,loc,ctn,SemanticTree.polymorphic_state.ps_common, + common_method_node constructor=new common_method_node(StringConstants.default_constructor_name,null,loc,ctn,SemanticTree.polymorphic_state.ps_common, SemanticTree.field_access_level.fal_public, convertion_data_and_alghoritms.symbol_table.CreateScope(ctn.scope)); constructor.is_constructor = true; constructor.return_value_type = ctn; constructor.function_code=new runtime_statement(SemanticTree.runtime_statement_type.ctor_delegate,loc); - common_method_node invoke=new common_method_node(compiler_string_consts.invoke_method_name, + common_method_node invoke=new common_method_node(StringConstants.invoke_method_name, return_value_type,loc,ctn,SemanticTree.polymorphic_state.ps_virtual, SemanticTree.field_access_level.fal_public, convertion_data_and_alghoritms.symbol_table.CreateScope(ctn.scope)); - ctn.add_name(compiler_string_consts.invoke_method_name,new SymbolInfo(invoke)); + ctn.add_name(StringConstants.invoke_method_name,new SymbolInfo(invoke)); for (int i=0; i generic_args = new List(); generic_args.Add(element_type); - type_node en_tn = compiled_type_node.get_type_node(NetHelper.NetHelper.FindType(compiler_string_consts.IGenericEnumerableInterfaceName)).get_instance(generic_args); + type_node en_tn = compiled_type_node.get_type_node(NetHelper.NetHelper.FindType(StringConstants.IGenericEnumerableInterfaceName)).get_instance(generic_args); ctn.ImplementingInterfaces.Add(en_tn); - en_cmn = new common_method_node(compiler_string_consts.GetEnumeratorMethodName, compiled_type_node.get_type_node(NetHelper.NetHelper.FindType(compiler_string_consts.IGenericEnumeratorInterfaceName)).get_instance(generic_args), null, ctn, SemanticTree.polymorphic_state.ps_virtual, SemanticTree.field_access_level.fal_public, null); - //en_fnc = en_tn.find_in_type("GetEnumerator").sym_info as function_node;//NetHelper.NetHelper.FindName(NetHelper.NetHelper.FindType(compiler_string_consts.IGenericEnumerableInterfaceName), compiler_string_consts.GetEnumeratorMethodName).sym_info as compiled_function_node; + en_cmn = new common_method_node(StringConstants.GetEnumeratorMethodName, compiled_type_node.get_type_node(NetHelper.NetHelper.FindType(StringConstants.IGenericEnumeratorInterfaceName)).get_instance(generic_args), null, ctn, SemanticTree.polymorphic_state.ps_virtual, SemanticTree.field_access_level.fal_public, null); + //en_fnc = en_tn.find_in_type("GetEnumerator").sym_info as function_node;//NetHelper.NetHelper.FindName(NetHelper.NetHelper.FindType(StringConstants.IGenericEnumerableInterfaceName), StringConstants.GetEnumeratorMethodName).sym_info as compiled_function_node; List en_sil = en_tn.find_in_type("GetEnumerator"); if (en_sil != null && en_sil.Count() > 1 && (en_sil[1].sym_info as function_node).return_value_type.is_generic_type_instance) en_sil = en_sil.GetRange(1, en_sil.Count() - 1); @@ -573,7 +573,7 @@ namespace PascalABCCompiler.TreeConverter //= operation SymbolTable.ClassMethodScope scope = convertion_data_and_alghoritms.symbol_table.CreateClassMethodScope(ctn.scope, _cmn.scope, null, "= operator from " + ctn.scope); - common_method_node cmn_eq = new common_method_node(compiler_string_consts.GetNETOperName(compiler_string_consts.eq_name),SystemLibrary.SystemLibrary.bool_type,null,ctn, + common_method_node cmn_eq = new common_method_node(StringConstants.GetNETOperName(StringConstants.eq_name),SystemLibrary.SystemLibrary.bool_type,null,ctn, SemanticTree.polymorphic_state.ps_static,SemanticTree.field_access_level.fal_public,scope); cmn_eq.IsOperator = true; common_parameter prm1 = new common_parameter("a",ctn,SemanticTree.parameter_type.value,cmn_eq,concrete_parameter_type.cpt_none,null,null); @@ -592,7 +592,7 @@ namespace PascalABCCompiler.TreeConverter while_stmt.body = while_body; simple_array_indexing left_sar = new simple_array_indexing(new class_field_reference(int_arr, new common_parameter_reference(prm1,0,null), null),var_ref,element_type,null); simple_array_indexing right_sar = new simple_array_indexing(new class_field_reference(int_arr, new common_parameter_reference(prm2,0,null), null),var_ref,element_type,null); - expression_node cond2 = SystemLibrary.SystemLibrary.syn_visitor.find_operator(compiler_string_consts.noteq_name, + expression_node cond2 = SystemLibrary.SystemLibrary.syn_visitor.find_operator(StringConstants.noteq_name, left_sar,right_sar,null); if_node if_stmt = new if_node(cond2,new return_node(new bool_const_node(false,null),null),null,null); while_body.statements.AddElement(if_stmt); @@ -604,11 +604,11 @@ namespace PascalABCCompiler.TreeConverter cmn_eq.function_code = body; cmn_eq.is_overload = true; ctn.methods.AddElement(cmn_eq); - ctn.Scope.AddSymbol(compiler_string_consts.eq_name,new SymbolInfo(cmn_eq)); + ctn.Scope.AddSymbol(StringConstants.eq_name,new SymbolInfo(cmn_eq)); //<> operation scope = convertion_data_and_alghoritms.symbol_table.CreateClassMethodScope(ctn.scope, _cmn.scope, null, "<> operator from " + ctn.scope); - common_method_node cmn_noteq = new common_method_node(compiler_string_consts.GetNETOperName(compiler_string_consts.noteq_name),SystemLibrary.SystemLibrary.bool_type,null,ctn, + common_method_node cmn_noteq = new common_method_node(StringConstants.GetNETOperName(StringConstants.noteq_name),SystemLibrary.SystemLibrary.bool_type,null,ctn, SemanticTree.polymorphic_state.ps_static,SemanticTree.field_access_level.fal_public,scope); cmn_noteq.IsOperator = true; prm1 = new common_parameter("a",ctn,SemanticTree.parameter_type.value,cmn_noteq,concrete_parameter_type.cpt_none,null,null); @@ -627,7 +627,7 @@ namespace PascalABCCompiler.TreeConverter while_stmt.body = while_body; left_sar = new simple_array_indexing(new class_field_reference(int_arr, new common_parameter_reference(prm1,0,null), null),var_ref,element_type,null); right_sar = new simple_array_indexing(new class_field_reference(int_arr, new common_parameter_reference(prm2,0,null), null),var_ref,element_type,null); - cond2 = SystemLibrary.SystemLibrary.syn_visitor.find_operator(compiler_string_consts.noteq_name, + cond2 = SystemLibrary.SystemLibrary.syn_visitor.find_operator(StringConstants.noteq_name, left_sar,right_sar,null); if_stmt = new if_node(cond2,new return_node(new bool_const_node(true,null),null),null,null); while_body.statements.AddElement(if_stmt); @@ -639,7 +639,7 @@ namespace PascalABCCompiler.TreeConverter cmn_noteq.function_code = body; cmn_noteq.is_overload = true; ctn.methods.AddElement(cmn_noteq); - ctn.Scope.AddSymbol(compiler_string_consts.noteq_name,new SymbolInfo(cmn_noteq)); + ctn.Scope.AddSymbol(StringConstants.noteq_name,new SymbolInfo(cmn_noteq)); //Equals /*scope = convertion_data_and_alghoritms.symbol_table.CreateClassMethodScope(_cmn.scope,ctn.scope); @@ -653,11 +653,11 @@ namespace PascalABCCompiler.TreeConverter cmn_equals.var_definition_nodes_list.AddElement(vdn); var_ref = new local_variable_reference(vdn,0,null);//this.convertion_data_and_alghoritms.syntax_tree_visitor.create_variable_reference(vdn,null); as_node _as = new as_node(new common_parameter_reference(prm1,0,null),ctn,null); - base_function_call ass_bfc = new basic_function_call(SystemLibrary.SystemLibrary.object_type.find(compiler_string_consts.assign_name).sym_info as basic_function_node,null); + base_function_call ass_bfc = new basic_function_call(SystemLibrary.SystemLibrary.object_type.find(StringConstants.assign_name).sym_info as basic_function_node,null); ass_bfc.parameters.AddElement(var_ref); ass_bfc.parameters.AddElement(_as); body.statements.AddElement(ass_bfc); - common_static_method_call csmc = new common_static_method_call(ctn.find_in_type(compiler_string_consts.eq_name).sym_info as common_method_node,null); + common_static_method_call csmc = new common_static_method_call(ctn.find_in_type(StringConstants.eq_name).sym_info as common_method_node,null); csmc.parameters.AddElement(new this_node(ctn,null)); csmc.parameters.AddElement(var_ref); body.statements.AddElement(new return_node(csmc,null)); @@ -684,23 +684,23 @@ namespace PascalABCCompiler.TreeConverter type_node element_type = ctn.base_type; if (element_type != SystemLibrary.SystemLibrary.char_type && element_type != SystemLibrary.SystemLibrary.bool_type) { - //element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.iassign))); - /*element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.bassign))); - element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.sassign))); - element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.sbassign))); - element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.usassign))); - element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.uiassign))); - element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.lassign))); - element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.ulassign)));*/ + //element_type.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.iassign))); + /*element_type.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.bassign))); + element_type.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.sassign))); + element_type.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.sbassign))); + element_type.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.usassign))); + element_type.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.uiassign))); + element_type.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.lassign))); + element_type.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.ulassign)));*/ } else if (element_type == SystemLibrary.SystemLibrary.char_type) - element_type.add_generated_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.charassign))); + element_type.add_generated_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.charassign))); else if (element_type == SystemLibrary.SystemLibrary.bool_type) - element_type.add_generated_name(compiler_string_consts.assign_name, new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn, PascalABCCompiler.SemanticTree.basic_function_type.boolassign))); + element_type.add_generated_name(StringConstants.assign_name, new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn, PascalABCCompiler.SemanticTree.basic_function_type.boolassign))); else if (element_type.IsEnum) { - element_type.add_generated_name(compiler_string_consts.assign_name, new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn, PascalABCCompiler.SemanticTree.basic_function_type.iassign))); - element_type.add_generated_name(compiler_string_consts.assign_name, new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(element_type, PascalABCCompiler.SemanticTree.basic_function_type.iassign))); + element_type.add_generated_name(StringConstants.assign_name, new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn, PascalABCCompiler.SemanticTree.basic_function_type.iassign))); + element_type.add_generated_name(StringConstants.assign_name, new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(element_type, PascalABCCompiler.SemanticTree.basic_function_type.iassign))); } if (element_type == SystemLibrary.SystemLibrary.integer_type) @@ -729,28 +729,28 @@ namespace PascalABCCompiler.TreeConverter //SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.float_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itof,true); SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.char_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartoi,false); - //SystemLibrary.SystemLibrary.make_unary_empty_operator(compiler_string_consts.plus_name, ctn, ctn); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.not_name, ctn, SystemLibrary.SystemLibrary.int_not); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_unmin); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.gr_name, ctn, SystemLibrary.SystemLibrary.int_gr); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.greq_name, ctn, SystemLibrary.SystemLibrary.int_greq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.sm_name, ctn, SystemLibrary.SystemLibrary.int_sm); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.smeq_name, ctn, SystemLibrary.SystemLibrary.int_smeq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.eq_name, ctn, SystemLibrary.SystemLibrary.int_eq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.noteq_name, ctn, SystemLibrary.SystemLibrary.int_noteq); + //SystemLibrary.SystemLibrary.make_unary_empty_operator(StringConstants.plus_name, ctn, ctn); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.not_name, ctn, SystemLibrary.SystemLibrary.int_not); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.int_unmin); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.gr_name, ctn, SystemLibrary.SystemLibrary.int_gr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.greq_name, ctn, SystemLibrary.SystemLibrary.int_greq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.sm_name, ctn, SystemLibrary.SystemLibrary.int_sm); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.smeq_name, ctn, SystemLibrary.SystemLibrary.int_smeq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.eq_name, ctn, SystemLibrary.SystemLibrary.int_eq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.noteq_name, ctn, SystemLibrary.SystemLibrary.int_noteq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.plus_name, ctn, SystemLibrary.SystemLibrary.int_add); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_sub); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mul_name, ctn, SystemLibrary.SystemLibrary.int_mul); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.idiv_name, ctn, SystemLibrary.SystemLibrary.int_idiv); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mod_name, ctn, SystemLibrary.SystemLibrary.int_mod); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.plus_name, ctn, SystemLibrary.SystemLibrary.int_add); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.int_sub); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mul_name, ctn, SystemLibrary.SystemLibrary.int_mul); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.idiv_name, ctn, SystemLibrary.SystemLibrary.int_idiv); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mod_name, ctn, SystemLibrary.SystemLibrary.int_mod); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.and_name, ctn, SystemLibrary.SystemLibrary.int_and); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.or_name, ctn, SystemLibrary.SystemLibrary.int_or); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.xor_name, ctn, SystemLibrary.SystemLibrary.int_xor); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.and_name, ctn, SystemLibrary.SystemLibrary.int_and); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.or_name, ctn, SystemLibrary.SystemLibrary.int_or); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.xor_name, ctn, SystemLibrary.SystemLibrary.int_xor); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shl_name, ctn, SystemLibrary.SystemLibrary.int_shl); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shr_name, ctn, SystemLibrary.SystemLibrary.int_shr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shl_name, ctn, SystemLibrary.SystemLibrary.int_shl); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shr_name, ctn, SystemLibrary.SystemLibrary.int_shr); } else if (element_type == SystemLibrary.SystemLibrary.byte_type) { @@ -778,28 +778,28 @@ namespace PascalABCCompiler.TreeConverter //SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.float_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itof,true); SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.char_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.chartob,false); - //SystemLibrary.SystemLibrary.make_unary_empty_operator(compiler_string_consts.plus_name, ctn, ctn); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.not_name, ctn, SystemLibrary.SystemLibrary.int_not); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_unmin); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.gr_name, ctn, SystemLibrary.SystemLibrary.int_gr); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.greq_name, ctn, SystemLibrary.SystemLibrary.int_greq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.sm_name, ctn, SystemLibrary.SystemLibrary.int_sm); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.smeq_name, ctn, SystemLibrary.SystemLibrary.int_smeq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.eq_name, ctn, SystemLibrary.SystemLibrary.int_eq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.noteq_name, ctn, SystemLibrary.SystemLibrary.int_noteq); + //SystemLibrary.SystemLibrary.make_unary_empty_operator(StringConstants.plus_name, ctn, ctn); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.not_name, ctn, SystemLibrary.SystemLibrary.int_not); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.int_unmin); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.gr_name, ctn, SystemLibrary.SystemLibrary.int_gr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.greq_name, ctn, SystemLibrary.SystemLibrary.int_greq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.sm_name, ctn, SystemLibrary.SystemLibrary.int_sm); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.smeq_name, ctn, SystemLibrary.SystemLibrary.int_smeq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.eq_name, ctn, SystemLibrary.SystemLibrary.int_eq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.noteq_name, ctn, SystemLibrary.SystemLibrary.int_noteq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.plus_name, ctn, SystemLibrary.SystemLibrary.int_add); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_sub); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mul_name, ctn, SystemLibrary.SystemLibrary.int_mul); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.idiv_name, ctn, SystemLibrary.SystemLibrary.int_idiv); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mod_name, ctn, SystemLibrary.SystemLibrary.int_mod); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.plus_name, ctn, SystemLibrary.SystemLibrary.int_add); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.int_sub); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mul_name, ctn, SystemLibrary.SystemLibrary.int_mul); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.idiv_name, ctn, SystemLibrary.SystemLibrary.int_idiv); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mod_name, ctn, SystemLibrary.SystemLibrary.int_mod); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.and_name, ctn, SystemLibrary.SystemLibrary.int_and); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.or_name, ctn, SystemLibrary.SystemLibrary.int_or); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.xor_name, ctn, SystemLibrary.SystemLibrary.int_xor); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.and_name, ctn, SystemLibrary.SystemLibrary.int_and); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.or_name, ctn, SystemLibrary.SystemLibrary.int_or); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.xor_name, ctn, SystemLibrary.SystemLibrary.int_xor); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shl_name, ctn, SystemLibrary.SystemLibrary.int_shl); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shr_name, ctn, SystemLibrary.SystemLibrary.int_shr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shl_name, ctn, SystemLibrary.SystemLibrary.int_shl); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shr_name, ctn, SystemLibrary.SystemLibrary.int_shr); } else if (element_type == SystemLibrary.SystemLibrary.sbyte_type) { @@ -827,28 +827,28 @@ namespace PascalABCCompiler.TreeConverter //SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.float_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itof,true); SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.char_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.chartosb,false); - //SystemLibrary.SystemLibrary.make_unary_empty_operator(compiler_string_consts.plus_name, ctn, ctn); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.not_name, ctn, SystemLibrary.SystemLibrary.int_not); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_unmin); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.gr_name, ctn, SystemLibrary.SystemLibrary.int_gr); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.greq_name, ctn, SystemLibrary.SystemLibrary.int_greq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.sm_name, ctn, SystemLibrary.SystemLibrary.int_sm); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.smeq_name, ctn, SystemLibrary.SystemLibrary.int_smeq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.eq_name, ctn, SystemLibrary.SystemLibrary.int_eq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.noteq_name, ctn, SystemLibrary.SystemLibrary.int_noteq); + //SystemLibrary.SystemLibrary.make_unary_empty_operator(StringConstants.plus_name, ctn, ctn); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.not_name, ctn, SystemLibrary.SystemLibrary.int_not); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.int_unmin); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.gr_name, ctn, SystemLibrary.SystemLibrary.int_gr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.greq_name, ctn, SystemLibrary.SystemLibrary.int_greq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.sm_name, ctn, SystemLibrary.SystemLibrary.int_sm); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.smeq_name, ctn, SystemLibrary.SystemLibrary.int_smeq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.eq_name, ctn, SystemLibrary.SystemLibrary.int_eq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.noteq_name, ctn, SystemLibrary.SystemLibrary.int_noteq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.plus_name, ctn, SystemLibrary.SystemLibrary.int_add); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_sub); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mul_name, ctn, SystemLibrary.SystemLibrary.int_mul); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.idiv_name, ctn, SystemLibrary.SystemLibrary.int_idiv); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mod_name, ctn, SystemLibrary.SystemLibrary.int_mod); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.plus_name, ctn, SystemLibrary.SystemLibrary.int_add); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.int_sub); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mul_name, ctn, SystemLibrary.SystemLibrary.int_mul); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.idiv_name, ctn, SystemLibrary.SystemLibrary.int_idiv); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mod_name, ctn, SystemLibrary.SystemLibrary.int_mod); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.and_name, ctn, SystemLibrary.SystemLibrary.int_and); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.or_name, ctn, SystemLibrary.SystemLibrary.int_or); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.xor_name, ctn, SystemLibrary.SystemLibrary.int_xor); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.and_name, ctn, SystemLibrary.SystemLibrary.int_and); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.or_name, ctn, SystemLibrary.SystemLibrary.int_or); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.xor_name, ctn, SystemLibrary.SystemLibrary.int_xor); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shl_name, ctn, SystemLibrary.SystemLibrary.int_shl); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shr_name, ctn, SystemLibrary.SystemLibrary.int_shr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shl_name, ctn, SystemLibrary.SystemLibrary.int_shl); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shr_name, ctn, SystemLibrary.SystemLibrary.int_shr); } else if (element_type == SystemLibrary.SystemLibrary.short_type) { @@ -876,28 +876,28 @@ namespace PascalABCCompiler.TreeConverter //SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.float_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itof,true); SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.char_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartos,false); - //SystemLibrary.SystemLibrary.make_unary_empty_operator(compiler_string_consts.plus_name, ctn, ctn); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.not_name, ctn, SystemLibrary.SystemLibrary.int_not); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_unmin); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.gr_name, ctn, SystemLibrary.SystemLibrary.int_gr); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.greq_name, ctn, SystemLibrary.SystemLibrary.int_greq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.sm_name, ctn, SystemLibrary.SystemLibrary.int_sm); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.smeq_name, ctn, SystemLibrary.SystemLibrary.int_smeq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.eq_name, ctn, SystemLibrary.SystemLibrary.int_eq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.noteq_name, ctn, SystemLibrary.SystemLibrary.int_noteq); + //SystemLibrary.SystemLibrary.make_unary_empty_operator(StringConstants.plus_name, ctn, ctn); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.not_name, ctn, SystemLibrary.SystemLibrary.int_not); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.int_unmin); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.gr_name, ctn, SystemLibrary.SystemLibrary.int_gr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.greq_name, ctn, SystemLibrary.SystemLibrary.int_greq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.sm_name, ctn, SystemLibrary.SystemLibrary.int_sm); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.smeq_name, ctn, SystemLibrary.SystemLibrary.int_smeq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.eq_name, ctn, SystemLibrary.SystemLibrary.int_eq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.noteq_name, ctn, SystemLibrary.SystemLibrary.int_noteq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.plus_name, ctn, SystemLibrary.SystemLibrary.int_add); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_sub); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mul_name, ctn, SystemLibrary.SystemLibrary.int_mul); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.idiv_name, ctn, SystemLibrary.SystemLibrary.int_idiv); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mod_name, ctn, SystemLibrary.SystemLibrary.int_mod); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.plus_name, ctn, SystemLibrary.SystemLibrary.int_add); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.int_sub); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mul_name, ctn, SystemLibrary.SystemLibrary.int_mul); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.idiv_name, ctn, SystemLibrary.SystemLibrary.int_idiv); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mod_name, ctn, SystemLibrary.SystemLibrary.int_mod); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.and_name, ctn, SystemLibrary.SystemLibrary.int_and); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.or_name, ctn, SystemLibrary.SystemLibrary.int_or); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.xor_name, ctn, SystemLibrary.SystemLibrary.int_xor); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.and_name, ctn, SystemLibrary.SystemLibrary.int_and); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.or_name, ctn, SystemLibrary.SystemLibrary.int_or); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.xor_name, ctn, SystemLibrary.SystemLibrary.int_xor); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shl_name, ctn, SystemLibrary.SystemLibrary.int_shl); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shr_name, ctn, SystemLibrary.SystemLibrary.int_shr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shl_name, ctn, SystemLibrary.SystemLibrary.int_shl); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shr_name, ctn, SystemLibrary.SystemLibrary.int_shr); } else if (element_type == SystemLibrary.SystemLibrary.ushort_type) { @@ -925,28 +925,28 @@ namespace PascalABCCompiler.TreeConverter //SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.float_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itof,true); SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.char_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartous,false); - //SystemLibrary.SystemLibrary.make_unary_empty_operator(compiler_string_consts.plus_name, ctn, ctn); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.not_name, ctn, SystemLibrary.SystemLibrary.int_not); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_unmin); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.gr_name, ctn, SystemLibrary.SystemLibrary.int_gr); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.greq_name, ctn, SystemLibrary.SystemLibrary.int_greq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.sm_name, ctn, SystemLibrary.SystemLibrary.int_sm); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.smeq_name, ctn, SystemLibrary.SystemLibrary.int_smeq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.eq_name, ctn, SystemLibrary.SystemLibrary.int_eq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.noteq_name, ctn, SystemLibrary.SystemLibrary.int_noteq); + //SystemLibrary.SystemLibrary.make_unary_empty_operator(StringConstants.plus_name, ctn, ctn); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.not_name, ctn, SystemLibrary.SystemLibrary.int_not); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.int_unmin); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.gr_name, ctn, SystemLibrary.SystemLibrary.int_gr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.greq_name, ctn, SystemLibrary.SystemLibrary.int_greq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.sm_name, ctn, SystemLibrary.SystemLibrary.int_sm); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.smeq_name, ctn, SystemLibrary.SystemLibrary.int_smeq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.eq_name, ctn, SystemLibrary.SystemLibrary.int_eq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.noteq_name, ctn, SystemLibrary.SystemLibrary.int_noteq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.plus_name, ctn, SystemLibrary.SystemLibrary.int_add); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_sub); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mul_name, ctn, SystemLibrary.SystemLibrary.int_mul); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.idiv_name, ctn, SystemLibrary.SystemLibrary.int_idiv); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mod_name, ctn, SystemLibrary.SystemLibrary.int_mod); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.plus_name, ctn, SystemLibrary.SystemLibrary.int_add); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.int_sub); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mul_name, ctn, SystemLibrary.SystemLibrary.int_mul); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.idiv_name, ctn, SystemLibrary.SystemLibrary.int_idiv); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mod_name, ctn, SystemLibrary.SystemLibrary.int_mod); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.and_name, ctn, SystemLibrary.SystemLibrary.int_and); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.or_name, ctn, SystemLibrary.SystemLibrary.int_or); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.xor_name, ctn, SystemLibrary.SystemLibrary.int_xor); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.and_name, ctn, SystemLibrary.SystemLibrary.int_and); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.or_name, ctn, SystemLibrary.SystemLibrary.int_or); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.xor_name, ctn, SystemLibrary.SystemLibrary.int_xor); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shl_name, ctn, SystemLibrary.SystemLibrary.int_shl); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shr_name, ctn, SystemLibrary.SystemLibrary.int_shr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shl_name, ctn, SystemLibrary.SystemLibrary.int_shl); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shr_name, ctn, SystemLibrary.SystemLibrary.int_shr); } else if (element_type == SystemLibrary.SystemLibrary.uint_type) { @@ -974,28 +974,28 @@ namespace PascalABCCompiler.TreeConverter //SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.float_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itof,true); SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.char_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartoui,false); - //SystemLibrary.SystemLibrary.make_unary_empty_operator(compiler_string_consts.plus_name, ctn, ctn); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.not_name, ctn, SystemLibrary.SystemLibrary.uint_not); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.uint_unmin); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.gr_name, ctn, SystemLibrary.SystemLibrary.uint_gr); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.greq_name, ctn, SystemLibrary.SystemLibrary.uint_greq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.sm_name, ctn, SystemLibrary.SystemLibrary.uint_sm); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.smeq_name, ctn, SystemLibrary.SystemLibrary.uint_smeq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.eq_name, ctn, SystemLibrary.SystemLibrary.uint_eq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.noteq_name, ctn, SystemLibrary.SystemLibrary.uint_noteq); + //SystemLibrary.SystemLibrary.make_unary_empty_operator(StringConstants.plus_name, ctn, ctn); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.not_name, ctn, SystemLibrary.SystemLibrary.uint_not); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.uint_unmin); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.gr_name, ctn, SystemLibrary.SystemLibrary.uint_gr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.greq_name, ctn, SystemLibrary.SystemLibrary.uint_greq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.sm_name, ctn, SystemLibrary.SystemLibrary.uint_sm); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.smeq_name, ctn, SystemLibrary.SystemLibrary.uint_smeq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.eq_name, ctn, SystemLibrary.SystemLibrary.uint_eq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.noteq_name, ctn, SystemLibrary.SystemLibrary.uint_noteq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.plus_name, ctn, SystemLibrary.SystemLibrary.uint_add); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.uint_sub); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mul_name, ctn, SystemLibrary.SystemLibrary.uint_mul); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.idiv_name, ctn, SystemLibrary.SystemLibrary.uint_idiv); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mod_name, ctn, SystemLibrary.SystemLibrary.uint_mod); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.plus_name, ctn, SystemLibrary.SystemLibrary.uint_add); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.uint_sub); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mul_name, ctn, SystemLibrary.SystemLibrary.uint_mul); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.idiv_name, ctn, SystemLibrary.SystemLibrary.uint_idiv); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mod_name, ctn, SystemLibrary.SystemLibrary.uint_mod); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.and_name, ctn, SystemLibrary.SystemLibrary.uint_and); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.or_name, ctn, SystemLibrary.SystemLibrary.uint_or); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.xor_name, ctn, SystemLibrary.SystemLibrary.uint_xor); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.and_name, ctn, SystemLibrary.SystemLibrary.uint_and); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.or_name, ctn, SystemLibrary.SystemLibrary.uint_or); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.xor_name, ctn, SystemLibrary.SystemLibrary.uint_xor); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shl_name, ctn, SystemLibrary.SystemLibrary.uint_shl); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shr_name, ctn, SystemLibrary.SystemLibrary.uint_shr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shl_name, ctn, SystemLibrary.SystemLibrary.uint_shl); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shr_name, ctn, SystemLibrary.SystemLibrary.uint_shr); } else if (element_type == SystemLibrary.SystemLibrary.int64_type) { @@ -1023,28 +1023,28 @@ namespace PascalABCCompiler.TreeConverter //SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.float_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itof,true); SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.char_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartol,false); - //SystemLibrary.SystemLibrary.make_unary_empty_operator(compiler_string_consts.plus_name, ctn, ctn); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.not_name, ctn, SystemLibrary.SystemLibrary.long_not); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.long_unmin); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.gr_name, ctn, SystemLibrary.SystemLibrary.long_gr); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.greq_name, ctn, SystemLibrary.SystemLibrary.long_greq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.sm_name, ctn, SystemLibrary.SystemLibrary.long_sm); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.smeq_name, ctn, SystemLibrary.SystemLibrary.long_smeq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.eq_name, ctn, SystemLibrary.SystemLibrary.long_eq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.noteq_name, ctn, SystemLibrary.SystemLibrary.long_noteq); + //SystemLibrary.SystemLibrary.make_unary_empty_operator(StringConstants.plus_name, ctn, ctn); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.not_name, ctn, SystemLibrary.SystemLibrary.long_not); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.long_unmin); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.gr_name, ctn, SystemLibrary.SystemLibrary.long_gr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.greq_name, ctn, SystemLibrary.SystemLibrary.long_greq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.sm_name, ctn, SystemLibrary.SystemLibrary.long_sm); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.smeq_name, ctn, SystemLibrary.SystemLibrary.long_smeq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.eq_name, ctn, SystemLibrary.SystemLibrary.long_eq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.noteq_name, ctn, SystemLibrary.SystemLibrary.long_noteq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.plus_name, ctn, SystemLibrary.SystemLibrary.long_add); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.long_sub); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mul_name, ctn, SystemLibrary.SystemLibrary.long_mul); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.idiv_name, ctn, SystemLibrary.SystemLibrary.long_idiv); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mod_name, ctn, SystemLibrary.SystemLibrary.long_mod); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.plus_name, ctn, SystemLibrary.SystemLibrary.long_add); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.long_sub); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mul_name, ctn, SystemLibrary.SystemLibrary.long_mul); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.idiv_name, ctn, SystemLibrary.SystemLibrary.long_idiv); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mod_name, ctn, SystemLibrary.SystemLibrary.long_mod); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.and_name, ctn, SystemLibrary.SystemLibrary.long_and); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.or_name, ctn, SystemLibrary.SystemLibrary.long_or); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.xor_name, ctn, SystemLibrary.SystemLibrary.long_xor); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.and_name, ctn, SystemLibrary.SystemLibrary.long_and); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.or_name, ctn, SystemLibrary.SystemLibrary.long_or); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.xor_name, ctn, SystemLibrary.SystemLibrary.long_xor); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shl_name, ctn, SystemLibrary.SystemLibrary.long_shl); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shr_name, ctn, SystemLibrary.SystemLibrary.long_shr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shl_name, ctn, SystemLibrary.SystemLibrary.long_shl); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shr_name, ctn, SystemLibrary.SystemLibrary.long_shr); } else if (element_type == SystemLibrary.SystemLibrary.uint64_type) { @@ -1073,28 +1073,28 @@ namespace PascalABCCompiler.TreeConverter SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.char_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartoul,false); - //SystemLibrary.SystemLibrary.make_unary_empty_operator(compiler_string_consts.plus_name, ctn, ctn); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.not_name, ctn, SystemLibrary.SystemLibrary.ulong_not); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.ulong_unmin); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.gr_name, ctn, SystemLibrary.SystemLibrary.ulong_gr); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.greq_name, ctn, SystemLibrary.SystemLibrary.ulong_greq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.sm_name, ctn, SystemLibrary.SystemLibrary.ulong_sm); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.smeq_name, ctn, SystemLibrary.SystemLibrary.ulong_smeq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.eq_name, ctn, SystemLibrary.SystemLibrary.ulong_eq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.noteq_name, ctn, SystemLibrary.SystemLibrary.ulong_noteq); + //SystemLibrary.SystemLibrary.make_unary_empty_operator(StringConstants.plus_name, ctn, ctn); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.not_name, ctn, SystemLibrary.SystemLibrary.ulong_not); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.ulong_unmin); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.gr_name, ctn, SystemLibrary.SystemLibrary.ulong_gr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.greq_name, ctn, SystemLibrary.SystemLibrary.ulong_greq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.sm_name, ctn, SystemLibrary.SystemLibrary.ulong_sm); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.smeq_name, ctn, SystemLibrary.SystemLibrary.ulong_smeq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.eq_name, ctn, SystemLibrary.SystemLibrary.ulong_eq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.noteq_name, ctn, SystemLibrary.SystemLibrary.ulong_noteq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.plus_name, ctn, SystemLibrary.SystemLibrary.ulong_add); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.ulong_sub); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mul_name, ctn, SystemLibrary.SystemLibrary.ulong_mul); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.idiv_name, ctn, SystemLibrary.SystemLibrary.ulong_idiv); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.plus_name, ctn, SystemLibrary.SystemLibrary.ulong_add); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.ulong_sub); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mul_name, ctn, SystemLibrary.SystemLibrary.ulong_mul); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.idiv_name, ctn, SystemLibrary.SystemLibrary.ulong_idiv); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.and_name, ctn, SystemLibrary.SystemLibrary.ulong_and); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.or_name, ctn, SystemLibrary.SystemLibrary.ulong_or); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.xor_name, ctn, SystemLibrary.SystemLibrary.ulong_xor); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mod_name, ctn, SystemLibrary.SystemLibrary.ulong_mod); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.and_name, ctn, SystemLibrary.SystemLibrary.ulong_and); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.or_name, ctn, SystemLibrary.SystemLibrary.ulong_or); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.xor_name, ctn, SystemLibrary.SystemLibrary.ulong_xor); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mod_name, ctn, SystemLibrary.SystemLibrary.ulong_mod); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shl_name, ctn, SystemLibrary.SystemLibrary.ulong_shl); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shr_name, ctn, SystemLibrary.SystemLibrary.ulong_shr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shl_name, ctn, SystemLibrary.SystemLibrary.ulong_shl); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shr_name, ctn, SystemLibrary.SystemLibrary.ulong_shr); } else if (element_type == SystemLibrary.SystemLibrary.char_type) { @@ -1122,12 +1122,12 @@ namespace PascalABCCompiler.TreeConverter //SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.real_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.dtochar,false); //SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.float_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartof,false); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.gr_name, ctn, SystemLibrary.SystemLibrary.char_gr); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.greq_name, ctn, SystemLibrary.SystemLibrary.char_greq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.sm_name, ctn, SystemLibrary.SystemLibrary.char_sm); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.smeq_name, ctn, SystemLibrary.SystemLibrary.char_smeq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.eq_name, ctn, SystemLibrary.SystemLibrary.char_eq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.noteq_name, ctn, SystemLibrary.SystemLibrary.char_noteq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.gr_name, ctn, SystemLibrary.SystemLibrary.char_gr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.greq_name, ctn, SystemLibrary.SystemLibrary.char_greq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.sm_name, ctn, SystemLibrary.SystemLibrary.char_sm); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.smeq_name, ctn, SystemLibrary.SystemLibrary.char_smeq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.eq_name, ctn, SystemLibrary.SystemLibrary.char_eq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.noteq_name, ctn, SystemLibrary.SystemLibrary.char_noteq); } else if (element_type.IsEnum) { @@ -1187,7 +1187,7 @@ namespace PascalABCCompiler.TreeConverter lower_value, upper_value, oti_old.value_to_int, oti_old.ordinal_type_to_int); //type_table.add_type_conversion_from_defined(ctn,SystemLibrary.SystemLibrary.integer_type,new basic_function_node(PascalABCCompiler.SemanticTree.basic_function_type.none,ctn,true,"diaptoord"),type_compare.less_type,true); //type_table.add_type_conversion_from_defined(SystemLibrary.SystemLibrary.integer_type,ctn,new basic_function_node(PascalABCCompiler.SemanticTree.basic_function_type.none,ctn,true,"ordtodiap"),type_compare.less_type,true); - //element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.iassign))); + //element_type.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.iassign))); //type_table.add_type_conversion_from_defined(ctn,SystemLibrary.SystemLibrary.byte_type,new basic_function_node(PascalABCCompiler.SemanticTree.basic_function_type.none,ctn,true,"diaptoord"),type_compare.less_type,true); //type_table.add_type_conversion_from_defined(SystemLibrary.SystemLibrary.byte_type,ctn,new basic_function_node(PascalABCCompiler.SemanticTree.basic_function_type.none,ctn,true,"ordtodiap"),type_compare.less_type,true); @@ -1196,23 +1196,23 @@ namespace PascalABCCompiler.TreeConverter if (element_type != SystemLibrary.SystemLibrary.char_type && element_type != SystemLibrary.SystemLibrary.bool_type) { - element_type.add_generated_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.iassign))); - /*element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.bassign))); - element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.sassign))); - element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.sbassign))); - element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.usassign))); - element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.uiassign))); - element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.lassign))); - element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.ulassign)));*/ + element_type.add_generated_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.iassign))); + /*element_type.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.bassign))); + element_type.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.sassign))); + element_type.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.sbassign))); + element_type.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.usassign))); + element_type.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.uiassign))); + element_type.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.lassign))); + element_type.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.ulassign)));*/ } else if (element_type == SystemLibrary.SystemLibrary.char_type) - element_type.add_generated_name(compiler_string_consts.assign_name, new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn, PascalABCCompiler.SemanticTree.basic_function_type.charassign))); + element_type.add_generated_name(StringConstants.assign_name, new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn, PascalABCCompiler.SemanticTree.basic_function_type.charassign))); else if (element_type == SystemLibrary.SystemLibrary.bool_type) - element_type.add_generated_name(compiler_string_consts.assign_name, new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn, PascalABCCompiler.SemanticTree.basic_function_type.boolassign))); + element_type.add_generated_name(StringConstants.assign_name, new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn, PascalABCCompiler.SemanticTree.basic_function_type.boolassign))); else if (element_type.IsEnum) { - element_type.add_generated_name(compiler_string_consts.assign_name, new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn, PascalABCCompiler.SemanticTree.basic_function_type.iassign))); - element_type.add_generated_name(compiler_string_consts.assign_name, new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(element_type, PascalABCCompiler.SemanticTree.basic_function_type.iassign))); + element_type.add_generated_name(StringConstants.assign_name, new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn, PascalABCCompiler.SemanticTree.basic_function_type.iassign))); + element_type.add_generated_name(StringConstants.assign_name, new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(element_type, PascalABCCompiler.SemanticTree.basic_function_type.iassign))); } if (element_type == SystemLibrary.SystemLibrary.integer_type) { @@ -1239,28 +1239,28 @@ namespace PascalABCCompiler.TreeConverter //SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.float_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itof,true); SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.char_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartoi,false); - //SystemLibrary.SystemLibrary.make_unary_empty_operator(compiler_string_consts.plus_name, ctn, ctn); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.not_name, ctn, SystemLibrary.SystemLibrary.int_not); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_unmin); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.gr_name, ctn, SystemLibrary.SystemLibrary.int_gr); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.greq_name, ctn, SystemLibrary.SystemLibrary.int_greq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.sm_name, ctn, SystemLibrary.SystemLibrary.int_sm); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.smeq_name, ctn, SystemLibrary.SystemLibrary.int_smeq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.eq_name, ctn, SystemLibrary.SystemLibrary.int_eq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.noteq_name, ctn, SystemLibrary.SystemLibrary.int_noteq); + //SystemLibrary.SystemLibrary.make_unary_empty_operator(StringConstants.plus_name, ctn, ctn); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.not_name, ctn, SystemLibrary.SystemLibrary.int_not); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.int_unmin); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.gr_name, ctn, SystemLibrary.SystemLibrary.int_gr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.greq_name, ctn, SystemLibrary.SystemLibrary.int_greq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.sm_name, ctn, SystemLibrary.SystemLibrary.int_sm); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.smeq_name, ctn, SystemLibrary.SystemLibrary.int_smeq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.eq_name, ctn, SystemLibrary.SystemLibrary.int_eq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.noteq_name, ctn, SystemLibrary.SystemLibrary.int_noteq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.plus_name, ctn, SystemLibrary.SystemLibrary.int_add); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_sub); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mul_name, ctn, SystemLibrary.SystemLibrary.int_mul); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.idiv_name, ctn, SystemLibrary.SystemLibrary.int_idiv); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mod_name, ctn, SystemLibrary.SystemLibrary.int_mod); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.plus_name, ctn, SystemLibrary.SystemLibrary.int_add); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.int_sub); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mul_name, ctn, SystemLibrary.SystemLibrary.int_mul); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.idiv_name, ctn, SystemLibrary.SystemLibrary.int_idiv); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mod_name, ctn, SystemLibrary.SystemLibrary.int_mod); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.and_name, ctn, SystemLibrary.SystemLibrary.int_and); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.or_name, ctn, SystemLibrary.SystemLibrary.int_or); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.xor_name, ctn, SystemLibrary.SystemLibrary.int_xor); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.and_name, ctn, SystemLibrary.SystemLibrary.int_and); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.or_name, ctn, SystemLibrary.SystemLibrary.int_or); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.xor_name, ctn, SystemLibrary.SystemLibrary.int_xor); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shl_name, ctn, SystemLibrary.SystemLibrary.int_shl); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shr_name, ctn, SystemLibrary.SystemLibrary.int_shr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shl_name, ctn, SystemLibrary.SystemLibrary.int_shl); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shr_name, ctn, SystemLibrary.SystemLibrary.int_shr); } else if (element_type == SystemLibrary.SystemLibrary.byte_type) { @@ -1288,28 +1288,28 @@ namespace PascalABCCompiler.TreeConverter //SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.float_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itof,true); SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.char_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.chartob,false); - //SystemLibrary.SystemLibrary.make_unary_empty_operator(compiler_string_consts.plus_name, ctn, ctn); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.not_name, ctn, SystemLibrary.SystemLibrary.int_not); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_unmin); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.gr_name, ctn, SystemLibrary.SystemLibrary.int_gr); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.greq_name, ctn, SystemLibrary.SystemLibrary.int_greq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.sm_name, ctn, SystemLibrary.SystemLibrary.int_sm); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.smeq_name, ctn, SystemLibrary.SystemLibrary.int_smeq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.eq_name, ctn, SystemLibrary.SystemLibrary.int_eq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.noteq_name, ctn, SystemLibrary.SystemLibrary.int_noteq); + //SystemLibrary.SystemLibrary.make_unary_empty_operator(StringConstants.plus_name, ctn, ctn); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.not_name, ctn, SystemLibrary.SystemLibrary.int_not); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.int_unmin); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.gr_name, ctn, SystemLibrary.SystemLibrary.int_gr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.greq_name, ctn, SystemLibrary.SystemLibrary.int_greq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.sm_name, ctn, SystemLibrary.SystemLibrary.int_sm); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.smeq_name, ctn, SystemLibrary.SystemLibrary.int_smeq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.eq_name, ctn, SystemLibrary.SystemLibrary.int_eq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.noteq_name, ctn, SystemLibrary.SystemLibrary.int_noteq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.plus_name, ctn, SystemLibrary.SystemLibrary.int_add); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_sub); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mul_name, ctn, SystemLibrary.SystemLibrary.int_mul); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.idiv_name, ctn, SystemLibrary.SystemLibrary.int_idiv); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mod_name, ctn, SystemLibrary.SystemLibrary.int_mod); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.plus_name, ctn, SystemLibrary.SystemLibrary.int_add); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.int_sub); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mul_name, ctn, SystemLibrary.SystemLibrary.int_mul); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.idiv_name, ctn, SystemLibrary.SystemLibrary.int_idiv); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mod_name, ctn, SystemLibrary.SystemLibrary.int_mod); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.and_name, ctn, SystemLibrary.SystemLibrary.int_and); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.or_name, ctn, SystemLibrary.SystemLibrary.int_or); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.xor_name, ctn, SystemLibrary.SystemLibrary.int_xor); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.and_name, ctn, SystemLibrary.SystemLibrary.int_and); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.or_name, ctn, SystemLibrary.SystemLibrary.int_or); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.xor_name, ctn, SystemLibrary.SystemLibrary.int_xor); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shl_name, ctn, SystemLibrary.SystemLibrary.int_shl); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shr_name, ctn, SystemLibrary.SystemLibrary.int_shr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shl_name, ctn, SystemLibrary.SystemLibrary.int_shl); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shr_name, ctn, SystemLibrary.SystemLibrary.int_shr); } else if (element_type == SystemLibrary.SystemLibrary.sbyte_type) { @@ -1337,28 +1337,28 @@ namespace PascalABCCompiler.TreeConverter //SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.float_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itof,true); SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.char_type,ctn,type_compare.greater_type,PascalABCCompiler.SemanticTree.basic_function_type.chartosb,false); - //SystemLibrary.SystemLibrary.make_unary_empty_operator(compiler_string_consts.plus_name, ctn, ctn); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.not_name, ctn, SystemLibrary.SystemLibrary.int_not); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_unmin); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.gr_name, ctn, SystemLibrary.SystemLibrary.int_gr); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.greq_name, ctn, SystemLibrary.SystemLibrary.int_greq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.sm_name, ctn, SystemLibrary.SystemLibrary.int_sm); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.smeq_name, ctn, SystemLibrary.SystemLibrary.int_smeq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.eq_name, ctn, SystemLibrary.SystemLibrary.int_eq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.noteq_name, ctn, SystemLibrary.SystemLibrary.int_noteq); + //SystemLibrary.SystemLibrary.make_unary_empty_operator(StringConstants.plus_name, ctn, ctn); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.not_name, ctn, SystemLibrary.SystemLibrary.int_not); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.int_unmin); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.gr_name, ctn, SystemLibrary.SystemLibrary.int_gr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.greq_name, ctn, SystemLibrary.SystemLibrary.int_greq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.sm_name, ctn, SystemLibrary.SystemLibrary.int_sm); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.smeq_name, ctn, SystemLibrary.SystemLibrary.int_smeq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.eq_name, ctn, SystemLibrary.SystemLibrary.int_eq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.noteq_name, ctn, SystemLibrary.SystemLibrary.int_noteq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.plus_name, ctn, SystemLibrary.SystemLibrary.int_add); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_sub); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mul_name, ctn, SystemLibrary.SystemLibrary.int_mul); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.idiv_name, ctn, SystemLibrary.SystemLibrary.int_idiv); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mod_name, ctn, SystemLibrary.SystemLibrary.int_mod); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.plus_name, ctn, SystemLibrary.SystemLibrary.int_add); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.int_sub); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mul_name, ctn, SystemLibrary.SystemLibrary.int_mul); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.idiv_name, ctn, SystemLibrary.SystemLibrary.int_idiv); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mod_name, ctn, SystemLibrary.SystemLibrary.int_mod); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.and_name, ctn, SystemLibrary.SystemLibrary.int_and); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.or_name, ctn, SystemLibrary.SystemLibrary.int_or); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.xor_name, ctn, SystemLibrary.SystemLibrary.int_xor); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.and_name, ctn, SystemLibrary.SystemLibrary.int_and); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.or_name, ctn, SystemLibrary.SystemLibrary.int_or); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.xor_name, ctn, SystemLibrary.SystemLibrary.int_xor); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shl_name, ctn, SystemLibrary.SystemLibrary.int_shl); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shr_name, ctn, SystemLibrary.SystemLibrary.int_shr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shl_name, ctn, SystemLibrary.SystemLibrary.int_shl); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shr_name, ctn, SystemLibrary.SystemLibrary.int_shr); } else if (element_type == SystemLibrary.SystemLibrary.short_type) { @@ -1386,28 +1386,28 @@ namespace PascalABCCompiler.TreeConverter //SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.float_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itof,true); SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.char_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartos,false); - //SystemLibrary.SystemLibrary.make_unary_empty_operator(compiler_string_consts.plus_name, ctn, ctn); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.not_name, ctn, SystemLibrary.SystemLibrary.int_not); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_unmin); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.gr_name, ctn, SystemLibrary.SystemLibrary.int_gr); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.greq_name, ctn, SystemLibrary.SystemLibrary.int_greq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.sm_name, ctn, SystemLibrary.SystemLibrary.int_sm); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.smeq_name, ctn, SystemLibrary.SystemLibrary.int_smeq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.eq_name, ctn, SystemLibrary.SystemLibrary.int_eq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.noteq_name, ctn, SystemLibrary.SystemLibrary.int_noteq); + //SystemLibrary.SystemLibrary.make_unary_empty_operator(StringConstants.plus_name, ctn, ctn); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.not_name, ctn, SystemLibrary.SystemLibrary.int_not); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.int_unmin); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.gr_name, ctn, SystemLibrary.SystemLibrary.int_gr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.greq_name, ctn, SystemLibrary.SystemLibrary.int_greq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.sm_name, ctn, SystemLibrary.SystemLibrary.int_sm); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.smeq_name, ctn, SystemLibrary.SystemLibrary.int_smeq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.eq_name, ctn, SystemLibrary.SystemLibrary.int_eq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.noteq_name, ctn, SystemLibrary.SystemLibrary.int_noteq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.plus_name, ctn, SystemLibrary.SystemLibrary.int_add); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_sub); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mul_name, ctn, SystemLibrary.SystemLibrary.int_mul); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.idiv_name, ctn, SystemLibrary.SystemLibrary.int_idiv); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mod_name, ctn, SystemLibrary.SystemLibrary.int_mod); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.plus_name, ctn, SystemLibrary.SystemLibrary.int_add); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.int_sub); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mul_name, ctn, SystemLibrary.SystemLibrary.int_mul); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.idiv_name, ctn, SystemLibrary.SystemLibrary.int_idiv); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mod_name, ctn, SystemLibrary.SystemLibrary.int_mod); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.and_name, ctn, SystemLibrary.SystemLibrary.int_and); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.or_name, ctn, SystemLibrary.SystemLibrary.int_or); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.xor_name, ctn, SystemLibrary.SystemLibrary.int_xor); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.and_name, ctn, SystemLibrary.SystemLibrary.int_and); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.or_name, ctn, SystemLibrary.SystemLibrary.int_or); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.xor_name, ctn, SystemLibrary.SystemLibrary.int_xor); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shl_name, ctn, SystemLibrary.SystemLibrary.int_shl); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shr_name, ctn, SystemLibrary.SystemLibrary.int_shr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shl_name, ctn, SystemLibrary.SystemLibrary.int_shl); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shr_name, ctn, SystemLibrary.SystemLibrary.int_shr); } else if (element_type == SystemLibrary.SystemLibrary.ushort_type) { @@ -1435,28 +1435,28 @@ namespace PascalABCCompiler.TreeConverter //SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.float_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itof,true); SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.char_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartous,false); - //SystemLibrary.SystemLibrary.make_unary_empty_operator(compiler_string_consts.plus_name, ctn, ctn); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.not_name, ctn, SystemLibrary.SystemLibrary.int_not); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_unmin); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.gr_name, ctn, SystemLibrary.SystemLibrary.int_gr); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.greq_name, ctn, SystemLibrary.SystemLibrary.int_greq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.sm_name, ctn, SystemLibrary.SystemLibrary.int_sm); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.smeq_name, ctn, SystemLibrary.SystemLibrary.int_smeq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.eq_name, ctn, SystemLibrary.SystemLibrary.int_eq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.noteq_name, ctn, SystemLibrary.SystemLibrary.int_noteq); + //SystemLibrary.SystemLibrary.make_unary_empty_operator(StringConstants.plus_name, ctn, ctn); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.not_name, ctn, SystemLibrary.SystemLibrary.int_not); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.int_unmin); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.gr_name, ctn, SystemLibrary.SystemLibrary.int_gr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.greq_name, ctn, SystemLibrary.SystemLibrary.int_greq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.sm_name, ctn, SystemLibrary.SystemLibrary.int_sm); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.smeq_name, ctn, SystemLibrary.SystemLibrary.int_smeq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.eq_name, ctn, SystemLibrary.SystemLibrary.int_eq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.noteq_name, ctn, SystemLibrary.SystemLibrary.int_noteq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.plus_name, ctn, SystemLibrary.SystemLibrary.int_add); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.int_sub); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mul_name, ctn, SystemLibrary.SystemLibrary.int_mul); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.idiv_name, ctn, SystemLibrary.SystemLibrary.int_idiv); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mod_name, ctn, SystemLibrary.SystemLibrary.int_mod); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.plus_name, ctn, SystemLibrary.SystemLibrary.int_add); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.int_sub); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mul_name, ctn, SystemLibrary.SystemLibrary.int_mul); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.idiv_name, ctn, SystemLibrary.SystemLibrary.int_idiv); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mod_name, ctn, SystemLibrary.SystemLibrary.int_mod); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.and_name, ctn, SystemLibrary.SystemLibrary.int_and); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.or_name, ctn, SystemLibrary.SystemLibrary.int_or); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.xor_name, ctn, SystemLibrary.SystemLibrary.int_xor); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.and_name, ctn, SystemLibrary.SystemLibrary.int_and); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.or_name, ctn, SystemLibrary.SystemLibrary.int_or); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.xor_name, ctn, SystemLibrary.SystemLibrary.int_xor); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shl_name, ctn, SystemLibrary.SystemLibrary.int_shl); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shr_name, ctn, SystemLibrary.SystemLibrary.int_shr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shl_name, ctn, SystemLibrary.SystemLibrary.int_shl); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shr_name, ctn, SystemLibrary.SystemLibrary.int_shr); } else if (element_type == SystemLibrary.SystemLibrary.uint_type) { @@ -1484,28 +1484,28 @@ namespace PascalABCCompiler.TreeConverter //SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.float_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itof,true); SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.char_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartoui,false); - //SystemLibrary.SystemLibrary.make_unary_empty_operator(compiler_string_consts.plus_name, ctn, ctn); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.not_name, ctn, SystemLibrary.SystemLibrary.uint_not); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.uint_unmin); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.gr_name, ctn, SystemLibrary.SystemLibrary.uint_gr); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.greq_name, ctn, SystemLibrary.SystemLibrary.uint_greq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.sm_name, ctn, SystemLibrary.SystemLibrary.uint_sm); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.smeq_name, ctn, SystemLibrary.SystemLibrary.uint_smeq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.eq_name, ctn, SystemLibrary.SystemLibrary.uint_eq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.noteq_name, ctn, SystemLibrary.SystemLibrary.uint_noteq); + //SystemLibrary.SystemLibrary.make_unary_empty_operator(StringConstants.plus_name, ctn, ctn); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.not_name, ctn, SystemLibrary.SystemLibrary.uint_not); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.uint_unmin); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.gr_name, ctn, SystemLibrary.SystemLibrary.uint_gr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.greq_name, ctn, SystemLibrary.SystemLibrary.uint_greq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.sm_name, ctn, SystemLibrary.SystemLibrary.uint_sm); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.smeq_name, ctn, SystemLibrary.SystemLibrary.uint_smeq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.eq_name, ctn, SystemLibrary.SystemLibrary.uint_eq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.noteq_name, ctn, SystemLibrary.SystemLibrary.uint_noteq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.plus_name, ctn, SystemLibrary.SystemLibrary.uint_add); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.uint_sub); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mul_name, ctn, SystemLibrary.SystemLibrary.uint_mul); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.idiv_name, ctn, SystemLibrary.SystemLibrary.uint_idiv); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mod_name, ctn, SystemLibrary.SystemLibrary.uint_mod); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.plus_name, ctn, SystemLibrary.SystemLibrary.uint_add); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.uint_sub); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mul_name, ctn, SystemLibrary.SystemLibrary.uint_mul); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.idiv_name, ctn, SystemLibrary.SystemLibrary.uint_idiv); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mod_name, ctn, SystemLibrary.SystemLibrary.uint_mod); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.and_name, ctn, SystemLibrary.SystemLibrary.uint_and); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.or_name, ctn, SystemLibrary.SystemLibrary.uint_or); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.xor_name, ctn, SystemLibrary.SystemLibrary.uint_xor); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.and_name, ctn, SystemLibrary.SystemLibrary.uint_and); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.or_name, ctn, SystemLibrary.SystemLibrary.uint_or); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.xor_name, ctn, SystemLibrary.SystemLibrary.uint_xor); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shl_name, ctn, SystemLibrary.SystemLibrary.uint_shl); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shr_name, ctn, SystemLibrary.SystemLibrary.uint_shr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shl_name, ctn, SystemLibrary.SystemLibrary.uint_shl); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shr_name, ctn, SystemLibrary.SystemLibrary.uint_shr); } else if (element_type == SystemLibrary.SystemLibrary.int64_type) { @@ -1533,28 +1533,28 @@ namespace PascalABCCompiler.TreeConverter //SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.float_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.itof,true); SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.char_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartol,false); - //SystemLibrary.SystemLibrary.make_unary_empty_operator(compiler_string_consts.plus_name, ctn, ctn); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.not_name, ctn, SystemLibrary.SystemLibrary.long_not); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.long_unmin); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.gr_name, ctn, SystemLibrary.SystemLibrary.long_gr); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.greq_name, ctn, SystemLibrary.SystemLibrary.long_greq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.sm_name, ctn, SystemLibrary.SystemLibrary.long_sm); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.smeq_name, ctn, SystemLibrary.SystemLibrary.long_smeq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.eq_name, ctn, SystemLibrary.SystemLibrary.long_eq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.noteq_name, ctn, SystemLibrary.SystemLibrary.long_noteq); + //SystemLibrary.SystemLibrary.make_unary_empty_operator(StringConstants.plus_name, ctn, ctn); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.not_name, ctn, SystemLibrary.SystemLibrary.long_not); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.long_unmin); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.gr_name, ctn, SystemLibrary.SystemLibrary.long_gr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.greq_name, ctn, SystemLibrary.SystemLibrary.long_greq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.sm_name, ctn, SystemLibrary.SystemLibrary.long_sm); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.smeq_name, ctn, SystemLibrary.SystemLibrary.long_smeq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.eq_name, ctn, SystemLibrary.SystemLibrary.long_eq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.noteq_name, ctn, SystemLibrary.SystemLibrary.long_noteq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.plus_name, ctn, SystemLibrary.SystemLibrary.long_add); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.long_sub); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mul_name, ctn, SystemLibrary.SystemLibrary.long_mul); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.idiv_name, ctn, SystemLibrary.SystemLibrary.long_idiv); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mod_name, ctn, SystemLibrary.SystemLibrary.long_mod); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.plus_name, ctn, SystemLibrary.SystemLibrary.long_add); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.long_sub); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mul_name, ctn, SystemLibrary.SystemLibrary.long_mul); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.idiv_name, ctn, SystemLibrary.SystemLibrary.long_idiv); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mod_name, ctn, SystemLibrary.SystemLibrary.long_mod); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.and_name, ctn, SystemLibrary.SystemLibrary.long_and); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.or_name, ctn, SystemLibrary.SystemLibrary.long_or); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.xor_name, ctn, SystemLibrary.SystemLibrary.long_xor); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.and_name, ctn, SystemLibrary.SystemLibrary.long_and); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.or_name, ctn, SystemLibrary.SystemLibrary.long_or); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.xor_name, ctn, SystemLibrary.SystemLibrary.long_xor); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shl_name, ctn, SystemLibrary.SystemLibrary.long_shl); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shr_name, ctn, SystemLibrary.SystemLibrary.long_shr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shl_name, ctn, SystemLibrary.SystemLibrary.long_shl); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shr_name, ctn, SystemLibrary.SystemLibrary.long_shr); } else if (element_type == SystemLibrary.SystemLibrary.uint64_type) { @@ -1583,28 +1583,28 @@ namespace PascalABCCompiler.TreeConverter SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.char_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartoul,false); - //SystemLibrary.SystemLibrary.make_unary_empty_operator(compiler_string_consts.plus_name, ctn, ctn); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.not_name, ctn, SystemLibrary.SystemLibrary.ulong_not); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.ulong_unmin); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.gr_name, ctn, SystemLibrary.SystemLibrary.ulong_gr); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.greq_name, ctn, SystemLibrary.SystemLibrary.ulong_greq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.sm_name, ctn, SystemLibrary.SystemLibrary.ulong_sm); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.smeq_name, ctn, SystemLibrary.SystemLibrary.ulong_smeq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.eq_name, ctn, SystemLibrary.SystemLibrary.ulong_eq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.noteq_name, ctn, SystemLibrary.SystemLibrary.ulong_noteq); + //SystemLibrary.SystemLibrary.make_unary_empty_operator(StringConstants.plus_name, ctn, ctn); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.not_name, ctn, SystemLibrary.SystemLibrary.ulong_not); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.ulong_unmin); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.gr_name, ctn, SystemLibrary.SystemLibrary.ulong_gr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.greq_name, ctn, SystemLibrary.SystemLibrary.ulong_greq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.sm_name, ctn, SystemLibrary.SystemLibrary.ulong_sm); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.smeq_name, ctn, SystemLibrary.SystemLibrary.ulong_smeq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.eq_name, ctn, SystemLibrary.SystemLibrary.ulong_eq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.noteq_name, ctn, SystemLibrary.SystemLibrary.ulong_noteq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.plus_name, ctn, SystemLibrary.SystemLibrary.ulong_add); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.minus_name, ctn, SystemLibrary.SystemLibrary.ulong_sub); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mul_name, ctn, SystemLibrary.SystemLibrary.ulong_mul); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.idiv_name, ctn, SystemLibrary.SystemLibrary.ulong_idiv); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.plus_name, ctn, SystemLibrary.SystemLibrary.ulong_add); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.minus_name, ctn, SystemLibrary.SystemLibrary.ulong_sub); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mul_name, ctn, SystemLibrary.SystemLibrary.ulong_mul); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.idiv_name, ctn, SystemLibrary.SystemLibrary.ulong_idiv); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.and_name, ctn, SystemLibrary.SystemLibrary.ulong_and); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.or_name, ctn, SystemLibrary.SystemLibrary.ulong_or); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.xor_name, ctn, SystemLibrary.SystemLibrary.ulong_xor); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.mod_name, ctn, SystemLibrary.SystemLibrary.ulong_mod); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.and_name, ctn, SystemLibrary.SystemLibrary.ulong_and); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.or_name, ctn, SystemLibrary.SystemLibrary.ulong_or); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.xor_name, ctn, SystemLibrary.SystemLibrary.ulong_xor); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.mod_name, ctn, SystemLibrary.SystemLibrary.ulong_mod); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shl_name, ctn, SystemLibrary.SystemLibrary.ulong_shl); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.shr_name, ctn, SystemLibrary.SystemLibrary.ulong_shr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shl_name, ctn, SystemLibrary.SystemLibrary.ulong_shl); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.shr_name, ctn, SystemLibrary.SystemLibrary.ulong_shr); } else if (element_type == SystemLibrary.SystemLibrary.char_type) { @@ -1632,12 +1632,12 @@ namespace PascalABCCompiler.TreeConverter //SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.real_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.dtochar,false); //SystemLibrary.SystemLibrary.make_generated_type_conversion(SystemLibrary.SystemLibrary.float_type,ctn,type_compare.less_type,PascalABCCompiler.SemanticTree.basic_function_type.chartof,false); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.gr_name, ctn, SystemLibrary.SystemLibrary.char_gr); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.greq_name, ctn, SystemLibrary.SystemLibrary.char_greq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.sm_name, ctn, SystemLibrary.SystemLibrary.char_sm); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.smeq_name, ctn, SystemLibrary.SystemLibrary.char_smeq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.eq_name, ctn, SystemLibrary.SystemLibrary.char_eq); - SystemLibrary.SystemLibrary.add_generated_funtion_to_type(compiler_string_consts.noteq_name, ctn, SystemLibrary.SystemLibrary.char_noteq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.gr_name, ctn, SystemLibrary.SystemLibrary.char_gr); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.greq_name, ctn, SystemLibrary.SystemLibrary.char_greq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.sm_name, ctn, SystemLibrary.SystemLibrary.char_sm); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.smeq_name, ctn, SystemLibrary.SystemLibrary.char_smeq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.eq_name, ctn, SystemLibrary.SystemLibrary.char_eq); + SystemLibrary.SystemLibrary.add_generated_funtion_to_type(StringConstants.noteq_name, ctn, SystemLibrary.SystemLibrary.char_noteq); } else if (element_type.IsEnum) { @@ -1714,7 +1714,7 @@ namespace PascalABCCompiler.TreeConverter //this.convertion_data_and_alghoritms.syntax_tree_visitor.context.converted_namespace.functions.AddElement(cnfn); // if (SystemLibrary.SystemLibrary.system_unit.namespaces.Count > 0) // SystemLibrary.SystemLibrary.system_unit.namespaces[0].functions.AddElement(cnfn); - // (SystemLibrary.SystemLibrary.system_unit.scope.Find(PascalABCCompiler.TreeConverter.compiler_string_consts.system_unit_name).sym_info as common_namespace_node).functions.AddElement(cnfn); + // (SystemLibrary.SystemLibrary.system_unit.scope.Find(StringConstants.system_unit_name).sym_info as common_namespace_node).functions.AddElement(cnfn); // else // this.convertion_data_and_alghoritms.syntax_tree_visitor.context.converted_namespace.functions.AddElement(cnfn); // statements_list sl = new statements_list(null); @@ -1783,19 +1783,19 @@ namespace PascalABCCompiler.TreeConverter // // SystemLibrary.SystemLibrary.system_unit.scope.AddSymbol("Dec",new SymbolInfo(cnfn)); // if (element_type == SystemLibrary.SystemLibrary.integer_type) - // element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.iassign))); + // element_type.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.iassign))); // else if (element_type == SystemLibrary.SystemLibrary.byte_type) - // element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.bassign))); - /*element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.sassign))); - element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.sbassign))); - element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.usassign))); - element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.uiassign))); - element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.lassign))); - element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.ulassign)));*/ + // element_type.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.bassign))); + /*element_type.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.sassign))); + element_type.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.sbassign))); + element_type.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.usassign))); + element_type.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.uiassign))); + element_type.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.lassign))); + element_type.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.ulassign)));*/ // else if (element_type == SystemLibrary.SystemLibrary.char_type) - // element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.charassign))); + // element_type.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.charassign))); // else if (element_type == SystemLibrary.SystemLibrary.bool_type) - // element_type.add_name(compiler_string_consts.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.boolassign))); + // element_type.add_name(StringConstants.assign_name,new SymbolInfo(SystemLibrary.SystemLibrary.make_assign_operator(ctn,PascalABCCompiler.SemanticTree.basic_function_type.boolassign))); ctn.add_internal_interface(oti_new); this.convertion_data_and_alghoritms.syntax_tree_visitor.context.converted_namespace.types.AddElement(ctn); @@ -1949,7 +1949,7 @@ namespace PascalABCCompiler.TreeConverter try { en = convertion_data_and_alghoritms.syntax_tree_visitor.find_operator( - compiler_string_consts.eq_name, lower_value, upper_value, left_loc); + StringConstants.eq_name, lower_value, upper_value, left_loc); } catch (NoFunctionWithSameArguments) { diff --git a/TreeConverter/TreeConverter.csproj b/TreeConverter/TreeConverter.csproj index 810ea530d..9e35410f9 100644 --- a/TreeConverter/TreeConverter.csproj +++ b/TreeConverter/TreeConverter.csproj @@ -141,9 +141,6 @@ Code - - Code - Code @@ -253,6 +250,10 @@ {613E0DDA-AA8A-437C-AC45-507B47429FF9} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + + {e8aefbf9-0113-4fa4-be45-6cda555498b7} + StringConstants + SyntaxTree {C2CAC65A-B2AE-4CCC-B067-E6B8E75DF73A} diff --git a/TreeConverter/TreeRealization/CompilerDirective.cs b/TreeConverter/TreeRealization/CompilerDirective.cs index d8c2c1bf1..753214dfa 100644 --- a/TreeConverter/TreeRealization/CompilerDirective.cs +++ b/TreeConverter/TreeRealization/CompilerDirective.cs @@ -1,8 +1,5 @@ // Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (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 PascalABCCompiler.Collections; namespace PascalABCCompiler.TreeRealization { diff --git a/TreeConverter/TreeRealization/generics.cs b/TreeConverter/TreeRealization/generics.cs index 5b11e182b..97747d15b 100644 --- a/TreeConverter/TreeRealization/generics.cs +++ b/TreeConverter/TreeRealization/generics.cs @@ -50,12 +50,12 @@ namespace PascalABCCompiler.TreeRealization public static void add_default_ctor(common_type_node param) { common_method_node cnode = new common_method_node( - compiler_string_consts.default_constructor_name, param, null, + StringConstants.default_constructor_name, param, null, param, SemanticTree.polymorphic_state.ps_common, SemanticTree.field_access_level.fal_public, null); cnode.is_constructor = true; param.methods.AddElement(cnode); - param.add_name(compiler_string_consts.default_constructor_name, new SymbolInfo(cnode)); + param.add_name(StringConstants.default_constructor_name, new SymbolInfo(cnode)); param.has_default_constructor = true; param.has_explicit_default_constructor = true; } @@ -374,7 +374,7 @@ namespace PascalABCCompiler.TreeRealization SystemLibrary.SystemLibrary.init_reference_type(instance); instance.conform_basic_functions(); //(ssyy) Нужно, чтобы добавились конструкторы - //ctnode.find_in_type(compiler_string_consts.default_constructor_name); + //ctnode.find_in_type(StringConstants.default_constructor_name); instance.instance_params = param_types; property_node orig_pn = original.default_property_node; @@ -1447,7 +1447,7 @@ namespace PascalABCCompiler.TreeRealization string rez; if (type_name) { - int last = name.LastIndexOf(compiler_string_consts.generic_params_infix); + int last = name.LastIndexOf(StringConstants.generic_params_infix); if (last < 0) { rez = name; @@ -1475,7 +1475,7 @@ namespace PascalABCCompiler.TreeRealization { if (tn.is_generic_parameter && tn.base_type != null && tn.base_type.IsAbstract && !(tn is common_type_node && (tn as common_type_node).has_default_constructor)) return false; - List sil = tn.find_in_type(compiler_string_consts.default_constructor_name, tn.Scope); + List sil = tn.find_in_type(StringConstants.default_constructor_name, tn.Scope); if (sil != null) { foreach (SymbolInfo si in sil) @@ -2227,9 +2227,9 @@ namespace PascalABCCompiler.TreeRealization public void conform_basic_functions() { - conform_basic_function(compiler_string_consts.assign_name, 0); - conform_basic_function(compiler_string_consts.eq_name, 1); - conform_basic_function(compiler_string_consts.noteq_name, 2); + conform_basic_function(StringConstants.assign_name, 0); + conform_basic_function(StringConstants.eq_name, 1); + conform_basic_function(StringConstants.noteq_name, 2); temp_names = null; } diff --git a/TreeConverter/TreeRealization/programs.cs b/TreeConverter/TreeRealization/programs.cs index 9e24384b7..6260db2a0 100644 --- a/TreeConverter/TreeRealization/programs.cs +++ b/TreeConverter/TreeRealization/programs.cs @@ -333,7 +333,7 @@ namespace PascalABCCompiler.TreeRealization { var ccnf = SystemLibrary.SystemLibInitializer.ConfigVariable.sym_info as compiled_variable_definition; basic_function_call bbfc = new basic_function_call(SystemLibrary.SystemLibrary.bool_assign as basic_function_node, null); - bbfc.parameters.AddElement(new static_compiled_variable_reference(ccnf.cont_type.find_in_type(TreeConverter.compiler_string_consts.IsConsoleApplicationVariableName)[0].sym_info as compiled_variable_definition, ccnf.cont_type, null)); + bbfc.parameters.AddElement(new static_compiled_variable_reference(ccnf.cont_type.find_in_type(StringConstants.IsConsoleApplicationVariableName)[0].sym_info as compiled_variable_definition, ccnf.cont_type, null)); bbfc.parameters.AddElement(new bool_const_node(true, null)); sl.statements.AddElement(bbfc); } @@ -343,7 +343,7 @@ namespace PascalABCCompiler.TreeRealization { if (units[i].main_function != null) { - if (units[i].main_function.name != TreeConverter.compiler_string_consts.temp_main_function_name) + if (units[i].main_function.name != StringConstants.temp_main_function_name) { common_namespace_function_call cnfc = new common_namespace_function_call(units[i].main_function, loc); sl.statements.AddElement(cnfc); @@ -461,7 +461,7 @@ namespace PascalABCCompiler.TreeRealization { if (!ctn.IsInterface && ctn.static_constr == null) { - ctn.static_constr = new common_method_node(PascalABCCompiler.TreeConverter.compiler_string_consts.static_ctor_prefix + "Create", null, ctn, SemanticTree.polymorphic_state.ps_static, SemanticTree.field_access_level.fal_private, null); + ctn.static_constr = new common_method_node(StringConstants.static_ctor_prefix + "Create", null, ctn, SemanticTree.polymorphic_state.ps_static, SemanticTree.field_access_level.fal_private, null); ctn.static_constr.is_constructor = true; ctn.static_constr.function_code = new statements_list(null); ctn.methods.AddElement(ctn.static_constr); @@ -482,7 +482,7 @@ namespace PascalABCCompiler.TreeRealization { if (ctn.static_constr == null) { - ctn.static_constr = new common_method_node(PascalABCCompiler.TreeConverter.compiler_string_consts.static_ctor_prefix + "Create", null, ctn, SemanticTree.polymorphic_state.ps_static, SemanticTree.field_access_level.fal_private, null); + ctn.static_constr = new common_method_node(StringConstants.static_ctor_prefix + "Create", null, ctn, SemanticTree.polymorphic_state.ps_static, SemanticTree.field_access_level.fal_private, null); ctn.static_constr.is_constructor = true; ctn.static_constr.function_code = new statements_list(null); ctn.methods.AddElement(ctn.static_constr); diff --git a/TreeConverter/TreeRealization/type_table.cs b/TreeConverter/TreeRealization/type_table.cs index ca1bafbb0..a30cbde46 100644 --- a/TreeConverter/TreeRealization/type_table.cs +++ b/TreeConverter/TreeRealization/type_table.cs @@ -957,7 +957,7 @@ namespace PascalABCCompiler.TreeRealization null_const_node ncn = new null_const_node(_to, call_location); null_const_node ncn2 = new null_const_node(_to, call_location); - PascalABCCompiler.TreeConverter.SymbolInfo si = pr.type.find_first_in_type(PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name); + PascalABCCompiler.TreeConverter.SymbolInfo si = pr.type.find_first_in_type(StringConstants.eq_name); basic_function_node fn = si.sym_info as basic_function_node; expression_node condition = null; diff --git a/TreeConverter/TreeRealization/types.cs b/TreeConverter/TreeRealization/types.cs index 0fd2fd100..d00d0edaa 100644 --- a/TreeConverter/TreeRealization/types.cs +++ b/TreeConverter/TreeRealization/types.cs @@ -975,7 +975,7 @@ namespace PascalABCCompiler.TreeRealization if (base.name != null) return base.name; if (_pointed_type != null && !check_for_circularity(_pointed_type,this)) - return PascalABCCompiler.TreeConverter.compiler_string_consts.get_pointer_type_name_by_type_name(_pointed_type.name); + return StringConstants.get_pointer_type_name_by_type_name(_pointed_type.name); return ""; } } @@ -1705,12 +1705,12 @@ namespace PascalABCCompiler.TreeRealization { if (!has_flags_attribute()) return; - basic_function_node _int_and = SystemLibrary.SystemLibrary.make_binary_operator(compiler_string_consts.and_name, this, SemanticTree.basic_function_type.iand); - basic_function_node _int_or = SystemLibrary.SystemLibrary.make_binary_operator(compiler_string_consts.or_name, this, SemanticTree.basic_function_type.ior); - basic_function_node _int_xor = SystemLibrary.SystemLibrary.make_binary_operator(compiler_string_consts.xor_name, this, SemanticTree.basic_function_type.ixor); - scope.AddSymbol(compiler_string_consts.and_name, new SymbolInfo(_int_and)); - scope.AddSymbol(compiler_string_consts.or_name, new SymbolInfo(_int_or)); - scope.AddSymbol(compiler_string_consts.xor_name, new SymbolInfo(_int_xor)); + basic_function_node _int_and = SystemLibrary.SystemLibrary.make_binary_operator(StringConstants.and_name, this, SemanticTree.basic_function_type.iand); + basic_function_node _int_or = SystemLibrary.SystemLibrary.make_binary_operator(StringConstants.or_name, this, SemanticTree.basic_function_type.ior); + basic_function_node _int_xor = SystemLibrary.SystemLibrary.make_binary_operator(StringConstants.xor_name, this, SemanticTree.basic_function_type.ixor); + scope.AddSymbol(StringConstants.and_name, new SymbolInfo(_int_and)); + scope.AddSymbol(StringConstants.or_name, new SymbolInfo(_int_or)); + scope.AddSymbol(StringConstants.xor_name, new SymbolInfo(_int_xor)); } public common_property_node default_property @@ -1904,7 +1904,7 @@ namespace PascalABCCompiler.TreeRealization get { //if (type_special_kind == SemanticTree.type_special_kind.typed_file) - // return compiler_string_consts.GetTypedFileTypeName(element_type.name); + // return StringConstants.GetTypedFileTypeName(element_type.name); return _name; } } @@ -1936,7 +1936,7 @@ namespace PascalABCCompiler.TreeRealization } if (this.is_generic_type_definition) { - int pos = _name.IndexOf(compiler_string_consts.generic_params_infix); + int pos = _name.IndexOf(StringConstants.generic_params_infix); string rez_name = _name.Substring(0, pos) + "<"; rez_name += _generic_params[0].name; for (int i = 1; i < _generic_params.Count; i++) @@ -1967,7 +1967,7 @@ namespace PascalABCCompiler.TreeRealization } if (this.is_value_type && name.Contains("$")) { - return string.Format(compiler_string_consts.recort_printable_name_template, "..."); + return string.Format(StringConstants.recort_printable_name_template, "..."); } if (this.type_special_kind == SemanticTree.type_special_kind.array_wrapper) { @@ -1991,15 +1991,15 @@ namespace PascalABCCompiler.TreeRealization UpperValue = bai.ordinal_type_interface.ordinal_type_to_int(bai.ordinal_type_interface.upper_value).ToString(); LowerValue = bai.ordinal_type_interface.ordinal_type_to_int(bai.ordinal_type_interface.lower_value).ToString(); } - return string.Format(compiler_string_consts.bounded_array_printable_name_template, LowerValue, UpperValue, bai.element_type.PrintableName); + return string.Format(StringConstants.bounded_array_printable_name_template, LowerValue, UpperValue, bai.element_type.PrintableName); } } if (this.type_special_kind == SemanticTree.type_special_kind.array_kind) { if (rank == 1) - return string.Format(compiler_string_consts.array_printable_name_template, element_type.PrintableName); + return string.Format(StringConstants.array_printable_name_template, element_type.PrintableName); else - return string.Format(compiler_string_consts.multi_dim_array_printable_name_template, new string(',', rank-1), element_type.PrintableName); + return string.Format(StringConstants.multi_dim_array_printable_name_template, new string(',', rank-1), element_type.PrintableName); } if (this.IsDelegate && this.name != null && this.name.IndexOf("$") != -1) { @@ -2422,7 +2422,7 @@ namespace PascalABCCompiler.TreeRealization public override function_node get_implicit_conversion_to(type_node ctn) { - List sil = this.find_in_type(compiler_string_consts.implicit_operator_name); + List sil = this.find_in_type(StringConstants.implicit_operator_name); if (sil != null) { function_node fn = null; @@ -2490,7 +2490,7 @@ namespace PascalABCCompiler.TreeRealization public override function_node get_implicit_conversion_from(type_node ctn) { - List sil = this.find_in_type(compiler_string_consts.implicit_operator_name); + List sil = this.find_in_type(StringConstants.implicit_operator_name); if (sil != null) { function_node fn = null; @@ -2571,7 +2571,7 @@ namespace PascalABCCompiler.TreeRealization public override function_node get_explicit_conversion_to(type_node ctn) { - List sil = this.find_in_type(compiler_string_consts.explicit_operator_name); + List sil = this.find_in_type(StringConstants.explicit_operator_name); if (sil != null) { function_node fn = null; @@ -2589,7 +2589,7 @@ namespace PascalABCCompiler.TreeRealization public override function_node get_explicit_conversion_from(type_node ctn) { - List sil = this.find_in_type(compiler_string_consts.explicit_operator_name); + List sil = this.find_in_type(StringConstants.explicit_operator_name); if (sil != null) { function_node fn = null; @@ -2771,7 +2771,7 @@ namespace PascalABCCompiler.TreeRealization { get { - return compiler_string_consts.GetShortStringTypeName(length); + return StringConstants.GetShortStringTypeName(length); } } @@ -2791,7 +2791,7 @@ namespace PascalABCCompiler.TreeRealization public override SymbolInfo find_first_in_type(string name, bool no_search_in_extension_methods = false) { - if (name == compiler_string_consts.assign_name || name == compiler_string_consts.plusassign_name) + if (name == StringConstants.assign_name || name == StringConstants.plusassign_name) { var temp = _scope.FindOnlyInType(name, null); return temp?.FirstOrDefault(); @@ -2804,7 +2804,7 @@ namespace PascalABCCompiler.TreeRealization //return this.find_in_additional_names(name) //SymbolInfo si = _scope.FindOnlyInType(name, null); //if (name ) - if (name == compiler_string_consts.assign_name || name == compiler_string_consts.plusassign_name) + if (name == StringConstants.assign_name || name == StringConstants.plusassign_name) return _scope.FindOnlyInType(name, null); return SystemLibrary.SystemLibrary.string_type.find_in_type(name); } @@ -2813,7 +2813,7 @@ namespace PascalABCCompiler.TreeRealization { //return this.find_in_additional_names(name); //SymbolInfo si = _scope.FindOnlyInType(name, CurrentScope); - if (name == compiler_string_consts.assign_name || name == compiler_string_consts.plusassign_name) + if (name == StringConstants.assign_name || name == StringConstants.plusassign_name) { return _scope.FindOnlyInType(name, null); } @@ -2849,7 +2849,7 @@ namespace PascalABCCompiler.TreeRealization { //if (ctn == base_type) // return TreeConverter.convertion_data_and_alghoritms.get_empty_conversion(ctn, this, false); - //SymbolInfo si = find_in_type(compiler_string_consts.implicit_operator_name); + //SymbolInfo si = find_in_type(StringConstants.implicit_operator_name); return null;//ss:=s } @@ -3198,7 +3198,7 @@ namespace PascalABCCompiler.TreeRealization private string MakePseudoInstanceName(List param_types) { - int last = name.LastIndexOf(compiler_string_consts.generic_params_infix); + int last = name.LastIndexOf(StringConstants.generic_params_infix); string rez = name.Substring(0, last); bool first = true; foreach (type_node tnode in param_types) @@ -3253,7 +3253,7 @@ namespace PascalABCCompiler.TreeRealization { if (base_type == SystemLibrary.SystemLibrary.delegate_base_type) { - SymbolInfo si_int = this.find_first_in_type(compiler_string_consts.invoke_method_name); + SymbolInfo si_int = this.find_first_in_type(StringConstants.invoke_method_name); #if DEBUG if (si_int == null) { @@ -3267,7 +3267,7 @@ namespace PascalABCCompiler.TreeRealization throw new CompilerInternalError("No invoke method in class derived from MulticastDelegate"); } #endif - SymbolInfo si_cons = this.find_first_in_type(compiler_string_consts.net_constructor_name); + SymbolInfo si_cons = this.find_first_in_type(StringConstants.net_constructor_name); compiled_constructor_node ctor = si_cons.sym_info as compiled_constructor_node; #if DEBUG if (ctor == null) @@ -3279,10 +3279,10 @@ namespace PascalABCCompiler.TreeRealization invoke, ctor); dii.parameters.AddRange(invoke.parameters); this.add_internal_interface(dii); - add_delegate_operator(compiler_string_consts.plusassign_name, type_constructor.instance.delegate_add_assign_compile_time_executor); - add_delegate_operator(compiler_string_consts.plus_name, type_constructor.instance.delegate_add_compile_time_executor); - add_delegate_operator(compiler_string_consts.minusassign_name, type_constructor.instance.delegate_sub_assign_compile_time_executor); - add_delegate_operator(compiler_string_consts.minus_name, type_constructor.instance.delegate_sub_compile_time_executor); + add_delegate_operator(StringConstants.plusassign_name, type_constructor.instance.delegate_add_assign_compile_time_executor); + add_delegate_operator(StringConstants.plus_name, type_constructor.instance.delegate_add_compile_time_executor); + add_delegate_operator(StringConstants.minusassign_name, type_constructor.instance.delegate_sub_assign_compile_time_executor); + add_delegate_operator(StringConstants.minus_name, type_constructor.instance.delegate_sub_compile_time_executor); } } } @@ -3294,9 +3294,9 @@ namespace PascalABCCompiler.TreeRealization cnfn.ConnectedToType = this; cnfn.compile_time_executor = executor; add_name(name, new SymbolInfo(cnfn)); - common_parameter cp1 = new common_parameter(compiler_string_consts.left_param_name, this, SemanticTree.parameter_type.value, + common_parameter cp1 = new common_parameter(StringConstants.left_param_name, this, SemanticTree.parameter_type.value, cnfn, concrete_parameter_type.cpt_none, null, null); - common_parameter cp2 = new common_parameter(compiler_string_consts.right_param_name, this, SemanticTree.parameter_type.value, + common_parameter cp2 = new common_parameter(StringConstants.right_param_name, this, SemanticTree.parameter_type.value, cnfn, concrete_parameter_type.cpt_none, null, null); cnfn.parameters.AddElement(cp1); cnfn.parameters.AddElement(cp2); @@ -3324,8 +3324,8 @@ namespace PascalABCCompiler.TreeRealization compiled_constructor_node ccn=compiled_constructor_node.get_compiled_constructor(ci); SymbolInfo si=new SymbolInfo(ccn); NetHelper.NetHelper.AddConstructor(ci, ccn); - //add_additional_name(compiler_string_consts.standart_constructor_name,si); - add_name(compiler_string_consts.default_constructor_name, si); + //add_additional_name(StringConstants.standart_constructor_name,si); + add_name(StringConstants.default_constructor_name, si); } } @@ -3348,17 +3348,17 @@ namespace PascalABCCompiler.TreeRealization private static void InitEnumOperations(compiled_type_node ctn) { if (ctn.compiled_type.GetCustomAttributes(typeof(FlagsAttribute), true).Length == 0) return; - basic_function_node _int_and = SystemLibrary.SystemLibrary.make_binary_operator(compiler_string_consts.and_name, ctn, SemanticTree.basic_function_type.iand); + basic_function_node _int_and = SystemLibrary.SystemLibrary.make_binary_operator(StringConstants.and_name, ctn, SemanticTree.basic_function_type.iand); _int_and.compile_time_executor = SystemLibrary.static_executors.enum_and_executor; - basic_function_node _int_or = SystemLibrary.SystemLibrary.make_binary_operator(compiler_string_consts.or_name, ctn, SemanticTree.basic_function_type.ior); + basic_function_node _int_or = SystemLibrary.SystemLibrary.make_binary_operator(StringConstants.or_name, ctn, SemanticTree.basic_function_type.ior); _int_or.compile_time_executor = SystemLibrary.static_executors.enum_or_executor; - basic_function_node _int_xor = SystemLibrary.SystemLibrary.make_binary_operator(compiler_string_consts.xor_name, ctn, SemanticTree.basic_function_type.ixor); + basic_function_node _int_xor = SystemLibrary.SystemLibrary.make_binary_operator(StringConstants.xor_name, ctn, SemanticTree.basic_function_type.ixor); _int_xor.compile_time_executor = SystemLibrary.static_executors.enum_xor_executor; if (ctn.scope != null) { - ctn.scope.AddSymbol(compiler_string_consts.and_name, new SymbolInfo(_int_and)); - ctn.scope.AddSymbol(compiler_string_consts.or_name, new SymbolInfo(_int_or)); - ctn.scope.AddSymbol(compiler_string_consts.xor_name, new SymbolInfo(_int_xor)); + ctn.scope.AddSymbol(StringConstants.and_name, new SymbolInfo(_int_and)); + ctn.scope.AddSymbol(StringConstants.or_name, new SymbolInfo(_int_or)); + ctn.scope.AddSymbol(StringConstants.xor_name, new SymbolInfo(_int_xor)); } } @@ -3434,10 +3434,10 @@ namespace PascalABCCompiler.TreeRealization lower_value, upper_value, oti_old.value_to_int, oti_old.ordinal_type_to_int); ctn.add_internal_interface(oti_new); - SystemLibrary.SystemLibrary.make_binary_operator(compiler_string_consts.gr_name, ctn, SemanticTree.basic_function_type.enumgr, SystemLibrary.SystemLibrary.bool_type); - SystemLibrary.SystemLibrary.make_binary_operator(compiler_string_consts.greq_name, ctn, SemanticTree.basic_function_type.enumgreq, SystemLibrary.SystemLibrary.bool_type); - SystemLibrary.SystemLibrary.make_binary_operator(compiler_string_consts.sm_name, ctn, SemanticTree.basic_function_type.enumsm, SystemLibrary.SystemLibrary.bool_type); - SystemLibrary.SystemLibrary.make_binary_operator(compiler_string_consts.smeq_name, ctn, SemanticTree.basic_function_type.enumsmeq, SystemLibrary.SystemLibrary.bool_type); + SystemLibrary.SystemLibrary.make_binary_operator(StringConstants.gr_name, ctn, SemanticTree.basic_function_type.enumgr, SystemLibrary.SystemLibrary.bool_type); + SystemLibrary.SystemLibrary.make_binary_operator(StringConstants.greq_name, ctn, SemanticTree.basic_function_type.enumgreq, SystemLibrary.SystemLibrary.bool_type); + SystemLibrary.SystemLibrary.make_binary_operator(StringConstants.sm_name, ctn, SemanticTree.basic_function_type.enumsm, SystemLibrary.SystemLibrary.bool_type); + SystemLibrary.SystemLibrary.make_binary_operator(StringConstants.smeq_name, ctn, SemanticTree.basic_function_type.enumsmeq, SystemLibrary.SystemLibrary.bool_type); InitEnumOperations(ctn); } //ctn.init_scope(); @@ -4146,7 +4146,7 @@ namespace PascalABCCompiler.TreeRealization { return base.name; } - return PascalABCCompiler.TreeConverter.compiler_string_consts.simple_array_name; + return StringConstants.simple_array_name; } } @@ -4875,7 +4875,7 @@ namespace PascalABCCompiler.TreeRealization private string _name=null; private string make_name() { - if (_proper_methods.Count == 0) return compiler_string_consts.method_group_type_name; + if (_proper_methods.Count == 0) return StringConstants.method_group_type_name; base_function_call bfc = _proper_methods[0]; System.Text.StringBuilder sb = new System.Text.StringBuilder(); if (bfc.function.return_value_type == null) @@ -4911,7 +4911,7 @@ namespace PascalABCCompiler.TreeRealization { if (_name == null) _name = make_name(); return _name; - //return compiler_string_consts.method_group_type_name; + //return StringConstants.method_group_type_name; } } @@ -4924,7 +4924,7 @@ namespace PascalABCCompiler.TreeRealization public override List find_in_type(string name, bool no_search_in_extension_methods = false) { - if (name != compiler_string_consts.plusassign_name && name != compiler_string_consts.minusassign_name) + if (name != StringConstants.plusassign_name && name != StringConstants.minusassign_name) foreach (base_function_call fn in _proper_methods) { if (fn.simple_function_node.parameters.Count == 0) @@ -5001,7 +5001,7 @@ namespace PascalABCCompiler.TreeRealization public override string name { - get { return compiler_string_consts.GetTypedFileTypeName(element_type.name); } + get { return StringConstants.GetTypedFileTypeName(element_type.name); } } @@ -5291,7 +5291,7 @@ namespace PascalABCCompiler.TreeRealization private int _length; private type_node _element_type; public ArrayConstType(type_node element_type, int length, location loc) - :base(compiler_string_consts.array_const_type_name, loc) + :base(StringConstants.array_const_type_name, loc) { _length = length; _element_type = element_type; @@ -5324,7 +5324,7 @@ namespace PascalABCCompiler.TreeRealization public class RecordConstType : undefined_type { public RecordConstType(location loc) - : base(compiler_string_consts.record_const_type_name, loc) + : base(StringConstants.record_const_type_name, loc) { } } @@ -5335,7 +5335,7 @@ namespace PascalABCCompiler.TreeRealization { //public type_node real_type = null; public auto_type(location loc) - : base(compiler_string_consts.auto_type_name, loc) { } + : base(StringConstants.auto_type_name, loc) { } } // тип, который объявляется как ienumerable_auto и определяется при компиляции в момент первого присваивания @@ -5344,7 +5344,7 @@ namespace PascalABCCompiler.TreeRealization { //public type_node real_type = null; public ienumerable_auto_type(location loc) - : base(compiler_string_consts.ienumerable_auto_type_name, loc) { } + : base(StringConstants.ienumerable_auto_type_name, loc) { } } } diff --git a/TreeConverter/TreeRealization/units.cs b/TreeConverter/TreeRealization/units.cs index b4db08a77..7c53deac9 100644 --- a/TreeConverter/TreeRealization/units.cs +++ b/TreeConverter/TreeRealization/units.cs @@ -109,7 +109,7 @@ namespace PascalABCCompiler.TreeRealization { get { - TreeConverter.SymbolInfo si = namespaces[0].findFirstOnlyInNamespace(TreeConverter.compiler_string_consts.system_unit_marker); + TreeConverter.SymbolInfo si = namespaces[0].findFirstOnlyInNamespace(StringConstants.system_unit_marker); if (si == null) return false; if (si.sym_info is constant_definition_node) diff --git a/VisualPascalABCNET/DS/Tools.cs b/VisualPascalABCNET/DS/Tools.cs index 8242bc65f..f8770e8f3 100644 --- a/VisualPascalABCNET/DS/Tools.cs +++ b/VisualPascalABCNET/DS/Tools.cs @@ -58,7 +58,7 @@ namespace VisualPascalABC { string sf = PascalABCCompiler.FormatTools.ExtensionsToString(Extensions, "*", ";"); sf = string.Format(VECStringResources.Get("DIALOGS_FILTER_PART_{0}{1}|{1}|"), Name, sf); - if (sf.IndexOf(compiler_string_consts.pascalSourceFileExtension) >= 0) + if (sf.IndexOf(StringConstants.pascalSourceFileExtension) >= 0) return sf + Filter; else return Filter + sf; diff --git a/VisualPascalABCNET/DockContent/CodeFileDocument.cs b/VisualPascalABCNET/DockContent/CodeFileDocument.cs index 7bf2e2d5b..029897947 100644 --- a/VisualPascalABCNET/DockContent/CodeFileDocument.cs +++ b/VisualPascalABCNET/DockContent/CodeFileDocument.cs @@ -593,7 +593,7 @@ namespace VisualPascalABC if (event_description != null) { MethodInfo mi = event_description.e.EventType.GetMethod( - PascalABCCompiler.TreeConverter.compiler_string_consts.invoke_method_name); + PascalABCCompiler.StringConstants.invoke_method_name); ParameterInfo[] pinfos = mi.GetParameters(); bool handler_found = false; diff --git a/VisualPascalABCNET/IB/CodeCompletion/CodeCompletionActions.cs b/VisualPascalABCNET/IB/CodeCompletion/CodeCompletionActions.cs index 8911199f3..411c0814b 100644 --- a/VisualPascalABCNET/IB/CodeCompletion/CodeCompletionActions.cs +++ b/VisualPascalABCNET/IB/CodeCompletion/CodeCompletionActions.cs @@ -117,7 +117,7 @@ namespace VisualPascalABC doc.Replace(offset, unitName.name.Length, new_val); doc.CommitUpdate(); } - WorkbenchServiceFactory.CodeCompletionParserController.RunParseThread(); + WorkbenchServiceFactory.CodeCompletionParserController.SwitchOnIntellisence(); VisualPABCSingleton.MainForm.StartTimer(); } diff --git a/VisualPascalABCNET/IB/CodeCompletion/CodeCompletionParserController.cs b/VisualPascalABCNET/IB/CodeCompletion/CodeCompletionParserController.cs index b3dfd8f0c..8c7d1100d 100644 --- a/VisualPascalABCNET/IB/CodeCompletion/CodeCompletionParserController.cs +++ b/VisualPascalABCNET/IB/CodeCompletion/CodeCompletionParserController.cs @@ -2,12 +2,6 @@ // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) using System; using System.Collections; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; -using ICSharpCode.TextEditor; -using ICSharpCode.TextEditor.Gui.CompletionWindow; -using ICSharpCode.TextEditor.Document; namespace VisualPascalABC { @@ -116,7 +110,10 @@ namespace VisualPascalABC } } - public void RunParseThread() + /// + /// Запуск потока с Intellisence + /// + public void SwitchOnIntellisence() { th = new System.Threading.Thread(InternalParsing); th.Priority = System.Threading.ThreadPriority.BelowNormal; diff --git a/VisualPascalABCNET/IB/Debugger/ExpressionEvaluation.cs b/VisualPascalABCNET/IB/Debugger/ExpressionEvaluation.cs index b23327a56..aeb3ce158 100644 --- a/VisualPascalABCNET/IB/Debugger/ExpressionEvaluation.cs +++ b/VisualPascalABCNET/IB/Debugger/ExpressionEvaluation.cs @@ -716,7 +716,7 @@ namespace VisualPascalABC } else { - res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name), "+"); + res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.plus_name), "+"); } } eval_stack.Push(res); @@ -1026,7 +1026,7 @@ namespace VisualPascalABC } else { - res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.minus_name), "-"); + res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.minus_name), "-"); } } eval_stack.Push(res); @@ -1288,7 +1288,7 @@ namespace VisualPascalABC } else { - res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.mul_name), "*"); + res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.mul_name), "*"); } } eval_stack.Push(res); @@ -1537,7 +1537,7 @@ namespace VisualPascalABC left.obj_val = DebugUtils.MakeValue(left.prim_val); if (right.obj_val == null && right.prim_val != null) right.obj_val = DebugUtils.MakeValue(right.prim_val); - res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.div_name), "/"); + res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.div_name), "/"); } eval_stack.Push(res); } @@ -1725,7 +1725,7 @@ namespace VisualPascalABC left.obj_val = DebugUtils.MakeValue(left.prim_val); if (right.obj_val == null && right.prim_val != null) right.obj_val = DebugUtils.MakeValue(right.prim_val); - res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.idiv_name), "div"); + res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.idiv_name), "div"); } eval_stack.Push(res); } @@ -1923,7 +1923,7 @@ namespace VisualPascalABC left.obj_val = DebugUtils.MakeValue(left.prim_val); if (right.obj_val == null && right.prim_val != null) right.obj_val = DebugUtils.MakeValue(right.prim_val); - res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.and_name), "and"); + res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.and_name), "and"); } } @@ -2119,7 +2119,7 @@ namespace VisualPascalABC left.obj_val = DebugUtils.MakeValue(left.prim_val); if (right.obj_val == null && right.prim_val != null) right.obj_val = DebugUtils.MakeValue(right.prim_val); - res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name), "-"); + res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.plus_name), "-"); } } @@ -2970,7 +2970,7 @@ namespace VisualPascalABC } else { - string op = PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name); + string op = PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.eq_name); if (left.obj_val.Type != right.obj_val.Type) { Type left_type = AssemblyHelper.GetType(left.obj_val.Type.FullName); @@ -3322,7 +3322,7 @@ namespace VisualPascalABC } else { - string op = PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.noteq_name); + string op = PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.noteq_name); if (left.obj_val.Type != right.obj_val.Type) { Type left_type = AssemblyHelper.GetType(left.obj_val.Type.FullName); @@ -3649,7 +3649,7 @@ namespace VisualPascalABC } else { - res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.sm_name), "<"); + res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.sm_name), "<"); } } eval_stack.Push(res); @@ -3931,7 +3931,7 @@ namespace VisualPascalABC } else { - res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.smeq_name), "<="); + res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.smeq_name), "<="); } } eval_stack.Push(res); @@ -4214,7 +4214,7 @@ namespace VisualPascalABC } else { - res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.gr_name), ">"); + res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.gr_name), ">"); } } eval_stack.Push(res); @@ -4497,7 +4497,7 @@ namespace VisualPascalABC } else { - res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.greq_name), ">="); + res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.greq_name), ">="); } } eval_stack.Push(res); @@ -4687,7 +4687,7 @@ namespace VisualPascalABC left.obj_val = DebugUtils.MakeValue(left.prim_val); if (right.obj_val == null && right.prim_val != null) right.obj_val = DebugUtils.MakeValue(right.prim_val); - res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.mod_name), "mod"); + res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.mod_name), "mod"); } } @@ -4844,7 +4844,7 @@ namespace VisualPascalABC } else { - string op = PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.not_name); + string op = PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.not_name); { IList mems = left.obj_val.Type.GetMember(op, Debugger.BindingFlags.All); if (mems != null && mems.Count == 1 && mems[0] is MethodInfo) diff --git a/VisualPascalABCNET/IB/Debugger/LocalVars.cs b/VisualPascalABCNET/IB/Debugger/LocalVars.cs index f95fe9612..aa1dd0465 100644 --- a/VisualPascalABCNET/IB/Debugger/LocalVars.cs +++ b/VisualPascalABCNET/IB/Debugger/LocalVars.cs @@ -323,9 +323,9 @@ namespace VisualPascalABC List types = new List(); try { - if (val.Type.FullName.Contains(PascalABCCompiler.TreeConverter.compiler_string_consts.ImplementationSectionNamespaceName)) + if (val.Type.FullName.Contains(PascalABCCompiler.StringConstants.ImplementationSectionNamespaceName)) { - string interf_name = val.Type.FullName.Substring(0, val.Type.FullName.IndexOf(PascalABCCompiler.TreeConverter.compiler_string_consts.ImplementationSectionNamespaceName)); + string interf_name = val.Type.FullName.Substring(0, val.Type.FullName.IndexOf(PascalABCCompiler.StringConstants.ImplementationSectionNamespaceName)); Type t = AssemblyHelper.GetTypeForStatic(interf_name); DebugType dt = DebugUtils.GetDebugType(t); types.Add(dt); diff --git a/VisualPascalABCNET/IB/FormExtensions.cs b/VisualPascalABCNET/IB/FormExtensions.cs index a1261a3ef..57274c80d 100644 --- a/VisualPascalABCNET/IB/FormExtensions.cs +++ b/VisualPascalABCNET/IB/FormExtensions.cs @@ -433,7 +433,7 @@ namespace VisualPascalABC timer.Interval = 2000; timer.Tick += TimerTicked;*/ //timer.Start(); - WorkbenchServiceFactory.CodeCompletionParserController.RunParseThread(); + WorkbenchServiceFactory.CodeCompletionParserController.SwitchOnIntellisence(); /*this.tsGotoRealization = new System.Windows.Forms.ToolStripMenuItem(); this.tsGotoRealization.Enabled = false; //this.tsGotoRealization.Image = ((System.Drawing.Image)(resources.GetObject("tsGotoDefinition.Image"))); diff --git a/VisualPascalABCNET/Projects/ProjectExplorer.cs b/VisualPascalABCNET/Projects/ProjectExplorer.cs index 4aa7a5828..227a7ed9c 100644 --- a/VisualPascalABCNET/Projects/ProjectExplorer.cs +++ b/VisualPascalABCNET/Projects/ProjectExplorer.cs @@ -384,7 +384,7 @@ namespace VisualPascalABC MessageBox.Show(Form1StringResources.Get("INVALID_SOURCE_FILE_NAME"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); return; } - if (string.Compare(Path.GetExtension(e.Label), compiler_string_consts.pascalSourceFileExtension, true) != 0) + if (string.Compare(Path.GetExtension(e.Label), StringConstants.pascalSourceFileExtension, true) != 0) { e.CancelEdit = true; MessageBox.Show(Form1StringResources.Get("INVALID_SOURCE_FILE_EXTENSION"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); diff --git a/VisualPascalABCNET/Projects/ProjectHelper.cs b/VisualPascalABCNET/Projects/ProjectHelper.cs index 1b2db6a6d..3ab1b6c12 100644 --- a/VisualPascalABCNET/Projects/ProjectHelper.cs +++ b/VisualPascalABCNET/Projects/ProjectHelper.cs @@ -65,7 +65,7 @@ namespace VisualPascalABC currentProject.include_debug_info = true; currentProject.project_type = projectType; - currentProject.source_files.Add(new PascalABCCompiler.SourceCodeFileInfo(projectName + compiler_string_consts.pascalSourceFileExtension, Path.Combine(dir, projectName + compiler_string_consts.pascalSourceFileExtension))); + currentProject.source_files.Add(new PascalABCCompiler.SourceCodeFileInfo(projectName + StringConstants.pascalSourceFileExtension, Path.Combine(dir, projectName + StringConstants.pascalSourceFileExtension))); currentProject.references.Add(new PascalABCCompiler.ReferenceInfo("System", "System.dll")); if (projectType == PascalABCCompiler.ProjectType.WindowsApp) { @@ -79,7 +79,7 @@ namespace VisualPascalABC currentProject.references.Add(new PascalABCCompiler.ReferenceInfo("System.Xml.Linq", "System.Xml.Linq.dll")); //roman// } - currentProject.main_file = Path.Combine(dir, projectName + compiler_string_consts.pascalSourceFileExtension); + currentProject.main_file = Path.Combine(dir, projectName + StringConstants.pascalSourceFileExtension); currentProject.generate_xml_doc = false; currentProject.delete_exe = true; currentProject.delete_pdb = true; @@ -88,7 +88,7 @@ namespace VisualPascalABC currentProject.build_version = 0; currentProject.revision_version = 0; currentProject.output_directory = dir; - StreamWriter sw = File.CreateText(Path.Combine(dir, projectName + compiler_string_consts.pascalSourceFileExtension)); + StreamWriter sw = File.CreateText(Path.Combine(dir, projectName + StringConstants.pascalSourceFileExtension)); currentProject.output_file_name = projectName + ".exe"; if (projectType == PascalABCCompiler.ProjectType.ConsoleApp) { @@ -231,7 +231,7 @@ namespace VisualPascalABC public string GetUnitFileName() { - return "Unit"+uid++ + compiler_string_consts.pascalSourceFileExtension; + return "Unit"+uid++ + StringConstants.pascalSourceFileExtension; } public string GetFullUnitFileName() diff --git a/VisualPascalABCNET/VisualPascalABCNET.csproj b/VisualPascalABCNET/VisualPascalABCNET.csproj index 7c782f33b..fe9376444 100644 --- a/VisualPascalABCNET/VisualPascalABCNET.csproj +++ b/VisualPascalABCNET/VisualPascalABCNET.csproj @@ -824,6 +824,10 @@ {cfc683f8-0165-4a9f-9c3f-bb8c5bab507f} PluginsSupport + + {e8aefbf9-0113-4fa4-be45-6cda555498b7} + StringConstants + {C2CAC65A-B2AE-4CCC-B067-E6B8E75DF73A} SyntaxTree diff --git a/VisualPascalABCNET/VisualPascalABCNET_40.csproj b/VisualPascalABCNET/VisualPascalABCNET_40.csproj index 2fb2adcd4..f12a99e02 100644 --- a/VisualPascalABCNET/VisualPascalABCNET_40.csproj +++ b/VisualPascalABCNET/VisualPascalABCNET_40.csproj @@ -818,6 +818,10 @@ {cfc683f8-0165-4a9f-9c3f-bb8c5bab507f} PluginsSupport + + {e8aefbf9-0113-4fa4-be45-6cda555498b7} + StringConstants + {C2CAC65A-B2AE-4CCC-B067-E6B8E75DF73A} SyntaxTree diff --git a/VisualPascalABCNETLinux/DockContent/CodeFileDocument.cs b/VisualPascalABCNETLinux/DockContent/CodeFileDocument.cs index 5b535aeca..e952c7137 100644 --- a/VisualPascalABCNETLinux/DockContent/CodeFileDocument.cs +++ b/VisualPascalABCNETLinux/DockContent/CodeFileDocument.cs @@ -600,7 +600,7 @@ namespace VisualPascalABC if (event_description != null) { MethodInfo mi = event_description.e.EventType.GetMethod( - PascalABCCompiler.TreeConverter.compiler_string_consts.invoke_method_name); + StringConstants.invoke_method_name); ParameterInfo[] pinfos = mi.GetParameters(); bool handler_found = false; diff --git a/VisualPascalABCNETLinux/IB/Debugger/ExpressionEvaluation.cs b/VisualPascalABCNETLinux/IB/Debugger/ExpressionEvaluation.cs index 7f951a019..e496bb90a 100644 --- a/VisualPascalABCNETLinux/IB/Debugger/ExpressionEvaluation.cs +++ b/VisualPascalABCNETLinux/IB/Debugger/ExpressionEvaluation.cs @@ -730,7 +730,7 @@ namespace VisualPascalABC } else { - res.monoValue = EvalCommonOperation(left.monoValue, right.monoValue, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name), "+"); + res.monoValue = EvalCommonOperation(left.monoValue, right.monoValue, PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.plus_name), "+"); } } eval_stack.Push(res); @@ -1083,7 +1083,7 @@ namespace VisualPascalABC } else { - res.monoValue = EvalCommonOperation(left.monoValue, right.monoValue, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.minus_name), "-"); + res.monoValue = EvalCommonOperation(left.monoValue, right.monoValue, PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.minus_name), "-"); } } eval_stack.Push(res); @@ -1345,7 +1345,7 @@ namespace VisualPascalABC } else { - res.monoValue = EvalCommonOperation(left.monoValue, right.monoValue, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.mul_name), "*"); + res.monoValue = EvalCommonOperation(left.monoValue, right.monoValue, PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.mul_name), "*"); } } eval_stack.Push(res); @@ -1594,7 +1594,7 @@ namespace VisualPascalABC left.monoValue = DebugUtils.MakeMonoValue(left.prim_val); if (right.monoValue == null && right.prim_val != null) right.monoValue = DebugUtils.MakeMonoValue(right.prim_val); - res.monoValue = EvalCommonOperation(left.monoValue, right.monoValue, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.div_name), "/"); + res.monoValue = EvalCommonOperation(left.monoValue, right.monoValue, PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.div_name), "/"); } eval_stack.Push(res); } @@ -1782,7 +1782,7 @@ namespace VisualPascalABC left.monoValue = DebugUtils.MakeMonoValue(left.prim_val); if (right.monoValue == null && right.prim_val != null) right.monoValue = DebugUtils.MakeMonoValue(right.prim_val); - res.monoValue = EvalCommonOperation(left.monoValue, right.monoValue, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.idiv_name), "div"); + res.monoValue = EvalCommonOperation(left.monoValue, right.monoValue, PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.idiv_name), "div"); } eval_stack.Push(res); } @@ -1980,7 +1980,7 @@ namespace VisualPascalABC left.monoValue = DebugUtils.MakeMonoValue(left.prim_val); if (right.monoValue == null && right.prim_val != null) right.monoValue = DebugUtils.MakeMonoValue(right.prim_val); - res.monoValue = EvalCommonOperation(left.monoValue, right.monoValue, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.and_name), "and"); + res.monoValue = EvalCommonOperation(left.monoValue, right.monoValue, PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.and_name), "and"); } } @@ -2176,7 +2176,7 @@ namespace VisualPascalABC left.monoValue = DebugUtils.MakeMonoValue(left.prim_val); if (right.monoValue == null && right.prim_val != null) right.monoValue = DebugUtils.MakeMonoValue(right.prim_val); - res.monoValue = EvalCommonOperation(left.monoValue, right.monoValue, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name), "-"); + res.monoValue = EvalCommonOperation(left.monoValue, right.monoValue, PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.plus_name), "-"); } } @@ -3027,7 +3027,7 @@ namespace VisualPascalABC } else { - string op = PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name); + string op = PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.eq_name); if (left.obj_val.Type != right.obj_val.Type) { Type left_type = AssemblyHelper.GetType(left.obj_val.Type.FullName); @@ -3379,7 +3379,7 @@ namespace VisualPascalABC } else { - string op = PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.noteq_name); + string op = PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.noteq_name); if (left.obj_val.Type != right.obj_val.Type) { Type left_type = AssemblyHelper.GetType(left.obj_val.Type.FullName); @@ -3706,7 +3706,7 @@ namespace VisualPascalABC } else { - res.monoValue = EvalCommonOperation(left.monoValue, right.monoValue, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.sm_name), "<"); + res.monoValue = EvalCommonOperation(left.monoValue, right.monoValue, PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.sm_name), "<"); } } eval_stack.Push(res); @@ -3988,7 +3988,7 @@ namespace VisualPascalABC } else { - res.monoValue = EvalCommonOperation(left.monoValue, right.monoValue, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.smeq_name), "<="); + res.monoValue = EvalCommonOperation(left.monoValue, right.monoValue, PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.smeq_name), "<="); } } eval_stack.Push(res); @@ -4271,7 +4271,7 @@ namespace VisualPascalABC } else { - res.monoValue = EvalCommonOperation(left.monoValue, right.monoValue, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.gr_name), ">"); + res.monoValue = EvalCommonOperation(left.monoValue, right.monoValue, PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.gr_name), ">"); } } eval_stack.Push(res); @@ -4554,7 +4554,7 @@ namespace VisualPascalABC } else { - res.monoValue = EvalCommonOperation(left.monoValue, right.monoValue, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.greq_name), ">="); + res.monoValue = EvalCommonOperation(left.monoValue, right.monoValue, PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.greq_name), ">="); } } eval_stack.Push(res); @@ -4744,7 +4744,7 @@ namespace VisualPascalABC left.obj_val = DebugUtils.MakeValue(left.prim_val); if (right.obj_val == null && right.prim_val != null) right.obj_val = DebugUtils.MakeValue(right.prim_val); - res.monoValue = EvalCommonOperation(left.monoValue, right.monoValue, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.mod_name), "mod"); + res.monoValue = EvalCommonOperation(left.monoValue, right.monoValue, PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.mod_name), "mod"); } } @@ -4905,7 +4905,7 @@ namespace VisualPascalABC } else { - string op = PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.not_name); + string op = PascalABCCompiler.StringConstants.GetNETOperName(PascalABCCompiler.StringConstants.not_name); { IList mems = left.obj_val.Type.GetMember(op, Debugger.BindingFlags.All); if (mems != null && mems.Count == 1 && mems[0] is MethodInfo) diff --git a/VisualPascalABCNETLinux/IB/Debugger/LocalVars.cs b/VisualPascalABCNETLinux/IB/Debugger/LocalVars.cs index d3ea82e40..403533b84 100644 --- a/VisualPascalABCNETLinux/IB/Debugger/LocalVars.cs +++ b/VisualPascalABCNETLinux/IB/Debugger/LocalVars.cs @@ -297,9 +297,9 @@ namespace VisualPascalABC List types = new List(); try { - if (val.TypeName.Contains(PascalABCCompiler.TreeConverter.compiler_string_consts.ImplementationSectionNamespaceName)) + if (val.TypeName.Contains(PascalABCCompiler.StringConstants.ImplementationSectionNamespaceName)) { - string interf_name = val.TypeName.Substring(0, val.TypeName.IndexOf(PascalABCCompiler.TreeConverter.compiler_string_consts.ImplementationSectionNamespaceName)); + string interf_name = val.TypeName.Substring(0, val.TypeName.IndexOf(PascalABCCompiler.StringConstants.ImplementationSectionNamespaceName)); Type t = AssemblyHelper.GetTypeForStatic(interf_name); var tr = new Mono.Debugging.Evaluation.TypeValueReference(frame.SourceBacktrace.GetEvaluationContext(frame.Index, Mono.Debugging.Client.EvaluationOptions.DefaultOptions), (frame.DebuggerSession as Mono.Debugging.Soft.SoftDebuggerSession).GetType(t.FullName)); diff --git a/VisualPascalABCNETLinux/VisualPascalABCNETLinux.csproj b/VisualPascalABCNETLinux/VisualPascalABCNETLinux.csproj index 14cc59fe8..0b7779967 100644 --- a/VisualPascalABCNETLinux/VisualPascalABCNETLinux.csproj +++ b/VisualPascalABCNETLinux/VisualPascalABCNETLinux.csproj @@ -942,6 +942,10 @@ {e009e776-9280-4061-b5ca-7f0c3e2d3c2a} PluginsSupportLinux + + {e8aefbf9-0113-4fa4-be45-6cda555498b7} + StringConstants + {C2CAC65A-B2AE-4CCC-B067-E6B8E75DF73A} SyntaxTree diff --git a/_GenerateLinuxVersion.bat b/_GenerateLinuxVersion.bat index 9a65d91dd..77cb40330 100644 --- a/_GenerateLinuxVersion.bat +++ b/_GenerateLinuxVersion.bat @@ -30,6 +30,7 @@ copy bin\mono_pabcnetc.bat Release\PascalABCNETLinux\mono_pabcnetc.bat copy bin\NETGenerator.dll Release\PascalABCNETLinux\NETGenerator.dll copy bin\OptimizerConversion.dll Release\PascalABCNETLinux\OptimizerConversion.dll copy bin\LanguageIntegrator.dll Release\PascalABCNETLinux\LanguageIntegrator.dll +copy bin\StringConstants.dll Release\PascalABCNETLinux\StringConstants.dll copy bin\pabcnetc.exe Release\PascalABCNETLinux\pabcnetc.exe copy bin\pabcnetc.exe.config Release\PascalABCNETLinux\pabcnetc.exe.config diff --git a/bin/Lng/Eng/CompilerErrors.dat b/bin/Lng/Eng/CompilerErrors.dat index 12facc228..c45002926 100644 --- a/bin/Lng/Eng/CompilerErrors.dat +++ b/bin/Lng/Eng/CompilerErrors.dat @@ -19,7 +19,9 @@ NAMESPACE_CAN_BE_COMPILED_ONLY_IN_PROJECTS=Files with namespaces can be compiled NAMESPACE_CANNOT_HAVE_IN_SECTION=Namespace cannot have 'in' section APPTYPE_DLL_IS_ALLOWED_ONLY_FOR_LIBRARIES= {$apptype dll} directive is allowed only for libraries USES_IN_WRONG_NAME=Unit name in uses-in ({0}) must be same as file name ({1}) -UNSUPPORTED_TARGETFRAMEWORK_{0}=TargetFramework '{0}' not supported +UNSUPPORTED_TARGETFRAMEWORK_{0}=TargetFramework '{0}' is not supported +UNSUPPORTED_TARGET_PLATFORM{0}=Platform '{0}' is not supported +UNSUPPORTED_OUTPUT_FILE_TYPE{0}=Output file type '{0}' is not supported %PREFIX%= COMPILER_INTERNAL_ERROR_IN_UNIT_{0}_:{1}=Internal compiler error in module {0} :'{1}' \ No newline at end of file diff --git a/bin/Lng/Eng/ParserErrors.dat b/bin/Lng/Eng/ParserErrors.dat index 74c03ebaa..1fc4c425d 100644 --- a/bin/Lng/Eng/ParserErrors.dat +++ b/bin/Lng/Eng/ParserErrors.dat @@ -1,4 +1,4 @@ -//Parser errors in PascalABCCompiler.Errors +// UNIVERSAL PARSER ERRORS %PREFIX%=PARSER_ERRORS_ BAD_FLOAT=Too big (small) number @@ -11,3 +11,8 @@ BIG_CHAR_NUMBER=Too big char const LOAD_ERROR{0}=Parser {0} loading error BAD_SOURCEFILE{0}_EXT=Can not choose parser for file '{0}' COMPILATION_ERROR{0}{1}{2}={0}{1} Compilation error: {2} + +EXPECTED_IDENTIFIER=Expected identifier +AVAILABLE_PARAM_VARIANTS{0}=Possible values are: {0} +AVAILABLE_EXT_VARIANTS{0}=Possible file extensions: {0} +SEE_THE_HELP_FOR_VARIANTS=You can find the possible values in the language documentation diff --git a/bin/Lng/Eng/PascalABCParser.dat b/bin/Lng/Eng/PascalABCParser.dat index e9dddebbe..10bf37003 100644 --- a/bin/Lng/Eng/PascalABCParser.dat +++ b/bin/Lng/Eng/PascalABCParser.dat @@ -18,9 +18,15 @@ LEFT_SIDE_ASSIGN_MUST_BE_VARIABLE=Leftside assigment must be variable PROCEDURE_CANNOT_HAVE_RETURNED_VALUE=Procedure cannot have returned value EXPECTED_{0}_BUT_FOUND_{1}=Expected '{0}' but found '{1}' NONTERMINALTOKEN_{0}_RETURN_NULL=Syntax rule '{0}' is not supported by the current version of the compiler -SEMICOLON_BEFORE_ELSE= else +SEMICOLON_BEFORE_ELSE=����� else ������ ������� ����� � ������� UNEXPECTED_SYMBOL{0}=Unexpected symbol '{0}' UNSUPPORTED_OLD_DIRECTIVES=Compiler directives began with # are not supported. Use directives {$ } +UNKNOWN_DIRECTIVE{0}=Unknown directive '{0}' +MISSING_DIRECTIVE_PARAM{0}=Directive '{0}' requires a parameter +UNNECESSARY_DIRECTIVE_PARAM{0}=Directive '{0}' is used without parameters +INCORRECT_DIRECTIVE_PARAM{0}{1}{2}=Invalid parameter '{0}' passed to directive '{1}'. {2} +EMPTY_DIRECTIVE=Empty directive is not allowed +DIRECTIVE_WRONG_NUMBER_OF_PARAMS{0}{1}=Directive '{0}' must have {1} INCLUDE_COULDNT_OPEN_FILE{0}=Compiler directive $include: can't open file '{0}' INCLUDE_EMPTY_FILE=Compiler directive $include: file name is absent RECUR_INCLUDE=Compiler directive $include: recursive include @@ -31,6 +37,12 @@ TYPE_NAME_EXPECTED=Type expected MULTILINE_STRING_CONTAINS_INCONSISTENT_INDENTS=Multiline string contains inconsistent indents NON_WHITESPACE_CHARACTERS_BEFORE_CLOSING_QUOTES_OF_MULTILINE_STRING=There should be no non-whitespace characters before the closing quotes of the multiline string +PARAM_SINGLE1=parameter +PARAM_SINGLE2=parameter +PARAM_MULTIPLE1=parameters +PARAM_MULTIPLE2=parameters +NOT_MORE_THAN=no more than +EXACTLY=exactly EOF1=end of file EOF=(end of file) diff --git a/bin/Lng/Rus/CompilerErrors.dat b/bin/Lng/Rus/CompilerErrors.dat index cd33adff6..23b5acc90 100644 --- a/bin/Lng/Rus/CompilerErrors.dat +++ b/bin/Lng/Rus/CompilerErrors.dat @@ -20,6 +20,8 @@ NAMESPACE_CANNOT_HAVE_IN_SECTION=Для пространства имен не APPTYPE_DLL_IS_ALLOWED_ONLY_FOR_LIBRARIES=Директива {$apptype dll} возможна только для библиотек USES_IN_WRONG_NAME=Имя модуля в uses-in ({0}) должно совпадать с именем файла ({1}) UNSUPPORTED_TARGETFRAMEWORK_{0}=TargetFramework '{0}' не поддерживается +UNSUPPORTED_TARGET_PLATFORM{0}=Платформа '{0}' не поддерживается +UNSUPPORTED_OUTPUT_FILE_TYPE{0}=Тип выходного файла '{0}' не поддерживается %PREFIX%= COMPILER_INTERNAL_ERROR_IN_UNIT_{0}_:{1}=Внутренняя ошибка компилятора в модуле {0} :'{1}' \ No newline at end of file diff --git a/bin/Lng/Rus/ParserErrors.dat b/bin/Lng/Rus/ParserErrors.dat index 3fd792430..f7070a529 100644 --- a/bin/Lng/Rus/ParserErrors.dat +++ b/bin/Lng/Rus/ParserErrors.dat @@ -1,4 +1,4 @@ -//Parser errors in PascalABCCompiler.Errors +// UNIVERSAL PARSER ERRORS %PREFIX%=PARSER_ERRORS_ BAD_FLOAT=Слишком большое вещественное @@ -11,4 +11,9 @@ EXPECTED{0}=Ожидалось {0} BIG_CHAR_NUMBER=Слишком большая константа LOAD_ERROR{0}=Ошибка загрузки парсера {0} BAD_SOURCEFILE{0}_EXT=Не могу выбрать подходящий парсер для файла '{0}' -COMPILATION_ERROR{0}{1}{2}={0}{1} Ошибка компиляции: {2} \ No newline at end of file +COMPILATION_ERROR{0}{1}{2}={0}{1} Ошибка компиляции: {2} + +EXPECTED_IDENTIFIER=Ожидался идентификатор +AVAILABLE_PARAM_VARIANTS{0}=Допустимые значения: {0} +AVAILABLE_EXT_VARIANTS{0}=Допустимые расширения файла: {0} +SEE_THE_HELP_FOR_VARIANTS=Уточните допустимые значения в документации языка \ No newline at end of file diff --git a/bin/Lng/Rus/PascalABCParser.dat b/bin/Lng/Rus/PascalABCParser.dat index 616a41c77..ee79d658c 100644 --- a/bin/Lng/Rus/PascalABCParser.dat +++ b/bin/Lng/Rus/PascalABCParser.dat @@ -20,6 +20,12 @@ NONTERMINALTOKEN_{0}_RETURN_NULL=Cинтаксическая конструкц SEMICOLON_BEFORE_ELSE=Перед else нельзя ставить точку с запятой UNEXPECTED_SYMBOL{0}=Неожиданный символ '{0}' UNSUPPORTED_OLD_DIRECTIVES=Директивы компилятора в стиле # более не поддерживаются. Используйте директивы в стиле {$ } +UNKNOWN_DIRECTIVE{0}=Неизвестная директива '{0}' +MISSING_DIRECTIVE_PARAM{0}=Директива '{0}' должна иметь параметр +UNNECESSARY_DIRECTIVE_PARAM{0}=Директива '{0}' не допускает параметров +INCORRECT_DIRECTIVE_PARAM{0}{1}{2}=Недопустимый параметр '{1}' для директивы '{0}'. {2} +EMPTY_DIRECTIVE=Пустая директива недопустима +DIRECTIVE_WRONG_NUMBER_OF_PARAMS{0}{1}=Директива '{0}' должна иметь {1} INCLUDE_COULDNT_OPEN_FILE{0}=Директива компилятора $include: нельзя открыть файл '{0}' INCLUDE_EMPTY_FILE=Директива компилятора $include: не указано имя файла RECUR_INCLUDE=Директива компилятора $include: рекурсивное включение файла @@ -30,6 +36,13 @@ TYPE_NAME_EXPECTED=Ожидался тип MULTILINE_STRING_CONTAINS_INCONSISTENT_INDENTS=Мультистрочная строка содержит несовместимые отступы NON_WHITESPACE_CHARACTERS_BEFORE_CLOSING_QUOTES_OF_MULTILINE_STRING=Перед закрывающими кавычками многострочной строки не должно быть непробельных символов +PARAM_SINGLE1=параметр +PARAM_SINGLE2=параметра +PARAM_MULTIPLE1=параметров +PARAM_MULTIPLE2=параметра +NOT_MORE_THAN=не более +EXACTLY=ровно + EOF1=конец файла EOF=(конец файла) TKIDENTIFIER=идентификатор diff --git a/bin/Lng/Ukr/PascalABCParser.dat b/bin/Lng/Ukr/PascalABCParser.dat index fd491f1a2..606c604db 100644 --- a/bin/Lng/Ukr/PascalABCParser.dat +++ b/bin/Lng/Ukr/PascalABCParser.dat @@ -21,6 +21,12 @@ NONTERMINALTOKEN_{0}_RETURN_NULL=Синтаксична конструкція SEMICOLON_BEFORE_ELSE=Перед else крапка з комою не ставиться UNEXPECTED_SYMBOL{0}=Несподіваний символ '{0}' UNSUPPORTED_OLD_DIRECTIVES=Директиви компілятора в стилі # більше не підтримуються. Використовуйте директиви в стилі {$ } +UNKNOWN_DIRECTIVE{0}=Невідома директива '{0}' +MISSING_DIRECTIVE_PARAM{0}=Директива '{0}' не допускає використання без параметра +UNNECESSARY_DIRECTIVE_PARAM{0}=Директива '{0}' не допускає параметрів +INCORRECT_DIRECTIVE_PARAM{0}{1}=Директиві '{0}' передано непримустимий параметр: '{1}' +EMPTY_DIRECTIVE=Порожня директива +DIRECTIVE_WRONG_NUMBER_OF_PARAMS{0}{1}=Директива '{0}' повинна мати таку кількість параметрів: {1} INCLUDE_COULDNT_OPEN_FILE{0}=Директива компілятора $include: не можна відкрити файл '{0}' INCLUDE_EMPTY_FILE=Директива компілятора $include: не вказано ім'я файлу UNNECESSARY $endif=Зайвий $endif diff --git a/bin/Lng/zh_CN/PascalABCParser.dat b/bin/Lng/zh_CN/PascalABCParser.dat index 5ae74e25a..69a39e87e 100644 --- a/bin/Lng/zh_CN/PascalABCParser.dat +++ b/bin/Lng/zh_CN/PascalABCParser.dat @@ -21,6 +21,12 @@ NONTERMINALTOKEN_{0}_RETURN_NULL=当前版本的编译器不支持语法规则 ' SEMICOLON_BEFORE_ELSE=不要在 else 之前加分号 UNEXPECTED_SYMBOL{0}=意外的符号 '{0}' UNSUPPORTED_OLD_DIRECTIVES=不支持以 # 开头的编译器指令。 使用指令 {$ } +UNKNOWN_DIRECTIVE{0}=未知指令 '{0}' +MISSING_DIRECTIVE_PARAM{0}='{0}' 指令需要一个参数 +UNNECESSARY_DIRECTIVE_PARAM{0}='{0}' 该指令的使用不带参数 +INCORRECT_DIRECTIVE_PARAM{0}{1}=向 '{0}' 指令传递了一个无效参数 '{1}' +EMPTY_DIRECTIVE=空指令 +DIRECTIVE_WRONG_NUMBER_OF_PARAMS{0}{1}='{0}' 指令必须有以下参数数:{1} INCLUDE_COULDNT_OPEN_FILE{0}=编译器指令 $include:无法打开文件 '{0}' INCLUDE_EMPTY_FILE=编译器指令 $include: 文件名不存在 RECUR_INCLUDE=编译器指令 $include: 递归包含