pascalabcnet/PascalABCLanguageInfo/PascalABCLanguage.cs
AlexanderZemlyak d5e9994ff2
Revert pascal language moving to language plugins (#3175)
* Return Parsers folder with standard parsers and move SyntaxTreeConverters back to Core

* Rename PascalLanguage project to PascalABCLanguageInfo

* Fix pascal dll loading
2024-07-02 16:10:50 +03:00

58 lines
2.6 KiB
C#

// 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 Languages.Facade;
using PascalABCCompiler;
using PascalABCCompiler.SyntaxTreeConverters;
using PascalABCCompiler.SystemLibrary;
using PascalABCCompiler.TreeConverter;
namespace Languages.Pascal
{
public class PascalABCLanguage : BaseLanguage
{
public PascalABCLanguage() : base(
name: StringConstants.pascalLanguageName,
version: "1.2",
copyright: "Copyright © 2005-2024 by Ivan Bondarev, Stanislav Mikhalkovich",
parser: new Frontend.Wrapping.PascalABCNewLanguageParser(),
docParser: new Frontend.Documentation.PascalDocTagsLanguageParser(),
syntaxTreeConverters: new List<ISyntaxTreeConverter>() { new Frontend.Converters.StandardSyntaxTreeConverter(), new SyntaxSemanticVisitors.LambdaAnyConverter() },
syntaxTreeToSemanticTreeConverter: new syntax_tree_visitor(),
filesExtensions: new string[] { StringConstants.pascalSourceFileExtension },
caseSensitive: false,
systemUnitNames: StringConstants.pascalDefaultStandardModules
) { }
public override void SetSemanticConstants()
{
SemanticRulesConstants.ClassBaseType = SystemLibrary.object_type;
SemanticRulesConstants.StructBaseType = SystemLibrary.value_type;
SemanticRulesConstants.AddResultVariable = true;
SemanticRulesConstants.ZeroBasedStrings = false;
SemanticRulesConstants.FastStrings = false;
SemanticRulesConstants.InitStringAsEmptyString = true;
SemanticRulesConstants.UseDivisionAssignmentOperatorsForIntegerTypes = false;
SemanticRulesConstants.ManyVariablesOneInitializator = false;
SemanticRulesConstants.OrderIndependedMethodNames = true;
SemanticRulesConstants.OrderIndependedFunctionNames = false;
SemanticRulesConstants.OrderIndependedTypeNames = false;
SemanticRulesConstants.EnableExitProcedure = true;
SemanticRulesConstants.StrongPointersTypeCheckForDotNet = true;
SemanticRulesConstants.AllowChangeLoopVariable = false;
SemanticRulesConstants.AllowGlobalVisibilityForPABCDll = true;
}
public override void SetSyntaxTreeToSemanticTreeConverter()
{
SyntaxTreeToSemanticTreeConverter = new syntax_tree_visitor();
}
}
}