* Implement first version of languages interfaces and classes ParsersController заменен на LanguageProvider. * Update ParserTools.csproj * Update RemoteCompiler.cs * Update TestRunner * Rename LanguageIntegrator project to Languages * Update TestRunner * Rename Parsers folder * Rename PascalABCParser.dll to PascalABCLanguage.dll * Reorganise LanguageIntegrator and rename DocTagsParser * Update Release Generators * Update language loading messages * Update linux version * Move BaseParser fields to ILanguage interface * Revert "Update Release Generators" This reverts commit 26a991c71b81e643d9fbd9a815ddca222768dda9. * Revert "Rename PascalABCParser.dll to PascalABCLanguage.dll" * Clean the mess in parser folders * Organize namespaces properly * Revert "Rename LanguageIntegrator project to Languages" * Add new enclosing folders for standard languages * Organize namespaces of LanguageIntegrator properly * Rename StandardLanguages to Languages * Comment the rest of Visual basic source code * Update OutputPath in pascal parser project * Move BaseParser methods to IParser * Restore Pascal parser project initial structure * Add PascalLanguage project * Move SyntaxTreeConverters project to Languages\Pascal folder * Rename SemanticRules in parser project * Rename Errors1 to Errors in parser project * Delete LambdaConverter dll from installer * Update language integrator to load *Language.dll files * Move lambda converter project to pascal lanuage dir * Revert "Delete LambdaConverter dll from installer" This reverts commit dd56f559ebe4f8c4c5c33752d44e6953001b96a5. * Switch off VBNETParser building * Delete syntax tree converters controller * Delete lambda converter dll from repository * Reorganize syntax tree to semantic tree conversion stage * Add BaseLanguage class to make language initialization more neat * Delete syntax tree post processors entity from ILanguage and refactor ABCStatistics calls * Add new IDocParser interface for documentation comments parser * Clean up folders * Add helper data structures to reduce parameters amount in CompileInterface and CompileImplementation * Add documentation to language classes * Move Union struct in global namespace and project (ParserTools) * Add more comments and a safe select language method * Rename SemanticRules class * Fix directives format null bug * Add System.Linq ref to LanguageIntegrator * Delete SyntaxToSemanticTreeConverter interface * Add BaseSyntaxTreeConverter * Call safe select language method in intellisence * Delete source files providers from parsers * Rename GetSyntaxTree method * Change Prebuild tree to be virtual - not abstract * Refresh documentation a bit * Add temporary language check for ABCHealth button * Add parser reference to parser tools * Move current compilation unit assigning higher to avoid bug with unit check * Delete null DirectiveInfo's and refactor directives' code * Add a few more comments
141 lines
6.2 KiB
C#
141 lines
6.2 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 PascalABCCompiler.TreeRealization;
|
||
namespace PascalABCCompiler.TreeConverter
|
||
{
|
||
public enum VariableInitializationParams { ConstantOnly, ConstructorCall, Expression }
|
||
public enum PoinerRealization { VoidStar, IntPtr }
|
||
public static class SemanticRulesConstants
|
||
{
|
||
/// <summary>
|
||
/// Определять методы в константных записях
|
||
/// </summary>
|
||
public static bool DefineMethodsInConstantRecord = false;
|
||
|
||
/// <summary>
|
||
/// Наследование константных записей
|
||
/// </summary>
|
||
public static bool InheritanceConstantRecord = false;
|
||
|
||
/// <summary>
|
||
/// Инициализировать строку пустой срокой
|
||
/// </summary>
|
||
public static bool InitStringAsEmptyString = true;
|
||
|
||
/// <summary>
|
||
/// Делать строки с быстрым доступом к символам на запись, но со ссылочной семантикой
|
||
/// </summary>
|
||
public static bool FastStrings = false;
|
||
|
||
/// <summary>
|
||
/// Индексировать строки с 0
|
||
/// </summary>
|
||
public static bool ZeroBasedStrings = false;
|
||
|
||
/// <summary>
|
||
/// Строгая проверка типа указателя
|
||
/// </summary>
|
||
public static bool StrongPointersTypeCheckForDotNet = true;
|
||
|
||
/// <summary>
|
||
/// Использовать is as для указателей
|
||
/// </summary>
|
||
public static bool IsAsForPointers = false;
|
||
|
||
/// <summary>
|
||
/// Чуствительность к регистру таблицы символов
|
||
/// </summary>
|
||
public static bool SymbolTableCaseSensitive = false;
|
||
|
||
/// <summary>
|
||
/// Разрешить использование операторов += -= /= *= для приметивных типов
|
||
/// </summary>
|
||
public static bool UseExtendedAssignmentOperatorsForPrimitiveTypes = true;
|
||
|
||
/// <summary>
|
||
/// Разрешить оператор /= для целых
|
||
/// </summary>
|
||
public static bool UseDivisionAssignmentOperatorsForIntegerTypes = false;
|
||
|
||
/// <summary>
|
||
/// Разрешить инициализацию списка переменных одним инициализатором
|
||
/// </summary>
|
||
public static bool ManyVariablesOneInitializator = false;
|
||
|
||
/// <summary>
|
||
/// Разрешить указатели на аргументы шаблона
|
||
/// </summary>
|
||
public static bool AllowPointersForGenericParameters = true;
|
||
|
||
/// <summary>
|
||
/// Разрешить запись аргументов шаблона в файл
|
||
/// </summary>
|
||
public static bool AllowGenericParametersForFiles = true;
|
||
|
||
/// <summary>
|
||
/// Отключить накопление ошибок
|
||
/// </summary>
|
||
public static bool ThrowErrorWithoutSave = true;
|
||
|
||
/// <summary>
|
||
/// Добавлять переменную result в функции
|
||
/// </summary>
|
||
public static bool AddResultVariable = true;
|
||
|
||
//!PoinerRealization! in NetGenerator\Helpers.cs
|
||
public static PoinerRealization PoinerRealization = PoinerRealization.VoidStar;
|
||
public static VariableInitializationParams VariableInitializationParams = VariableInitializationParams.Expression;
|
||
|
||
/// <summary>
|
||
/// Запертить объявление переменной в блоке если ее имя совпадает с переменной объявленой в объемлющем блоке
|
||
/// </summary>
|
||
public static bool DisabledDefinitionBlockVariablesWithSameNameThatInAboveScope = true;
|
||
|
||
/// <summary>
|
||
/// Разрешить неазависимость от порядка объявления методов
|
||
/// </summary>
|
||
public static bool OrderIndependedMethodNames = true;
|
||
|
||
/// <summary>
|
||
/// Разрешить неазависимость от порядка объявления функций
|
||
/// </summary>
|
||
public static bool OrderIndependedFunctionNames = false;
|
||
|
||
/// <summary>
|
||
/// Разрешить неазависимость от порядка объявления типов
|
||
/// </summary>
|
||
public static bool OrderIndependedTypeNames = false;
|
||
|
||
/// <summary>
|
||
/// Разрешить процедуру exit
|
||
/// </summary>
|
||
public static bool EnableExitProcedure = true;
|
||
|
||
/// <summary>
|
||
/// Инициализировать переменные типа аргументов управляемых шаблонов
|
||
/// </summary>
|
||
public static bool RuntimeInitVariablesOfGenericParameters = true;
|
||
|
||
/// <summary>
|
||
/// Разрешить неявное преобразование нетипизированного указателя к типизированному
|
||
/// </summary>
|
||
public static bool ImplicitConversionFormPointerToTypedPointer = true;
|
||
|
||
|
||
public static type_node ClassBaseType = null;
|
||
public static type_node StringType = null;
|
||
public static type_node StructBaseType = null;
|
||
|
||
public static bool AllowUseFormatExprAnywhere = false;
|
||
public static bool AllowChangeLoopVariable = true;
|
||
|
||
public static bool AllowGlobalVisibilityForPABCDll = true; // SSM не знаю, зачем понадобилось по умолчанию присваивать false. Сделал по умолчанию True. Исправляется тем самым баг #1575
|
||
// !!! Не присваивать false! Иначе ложится компиляция библиотек, использующих модули, и наоборот!!!
|
||
|
||
public static bool AddressOfOperatorNonOverloaded = true;
|
||
|
||
public static bool GenerateNativeCode = false;
|
||
}
|
||
}
|
||
|