pascalabcnet/PascalABCLanguageInfo/PascalABCLanguage.cs
AlexanderZemlyak 7a59245eaf
Language interface change (#3356)
* Move standard language info assigning to LanguageInformation classes

* Move Language name in compilation_unit.Language variable assigning in BaseParser

* Documentation update
2025-11-07 20:43:29 +03:00

51 lines
2.3 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.SyntaxTreeConverters;
using PascalABCCompiler.SystemLibrary;
using PascalABCCompiler.TreeConverter;
namespace Languages.Pascal
{
public class PascalABCLanguage : BaseLanguage
{
public PascalABCLanguage() : base(
languageInformation: new Frontend.Data.PascalABCLanguageInformation(),
parser: new Frontend.Wrapping.PascalABCNewLanguageParser(),
docParser: new Frontend.Documentation.PascalDocTagsLanguageParser(),
syntaxTreeConverters: new List<ISyntaxTreeConverter>() { new Frontend.Converters.StandardSyntaxTreeConverter(), new SyntaxSemanticVisitors.LambdaAnyConverter() }
) { }
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;
SemanticRulesConstants.AllowMethodCallsWithoutParentheses = true;
}
public override void SetSyntaxTreeToSemanticTreeConverter()
{
SyntaxTreeToSemanticTreeConverter = new syntax_tree_visitor();
}
}
}