pascalabcnet/LanguageIntegrator/ILanguage.cs
Александр Земляк b23f9c96d0
Деактивация кнопок, связанных с Intellisense, для языков без Intellisense + разделение ILanguageInformation на два интерфейса (#3378)
* Refactor language information classes

* Implement SimpleLanguageInformation abstract class

* Move some properties to SimpleLanguageInformation

* Implement format and debug buttons disabling if Intellisense is not supported for current language

* Add Intellisense available check in FormsExtensions to deactivate menu items if needed

* Change function interfaces in VisibilityService

* Replace CodeCompletionController.CurrentParser null checks with IntellisenseAvailable method call

* Refactor IParser and BaseParser to deduplicate code

* Fix BuildTreeInSpecialMode in SPythonParser

* Add SimpleParser class for new languages without Intellisense

* Delete duplicate SetDebugButtonsEnabled function

* Add Intellisense available check in RunService when attaching debugger

* Delete inner check in SetDebugButtonsEnabled to improve architecture

* Change CurrentParser property in CodeCompletion to be CurrentLanguage

* Divide ILanguageInformation into two interfaces (creating new ILanguageIntellisenseSupport)

* Fix LanguageIntellisenseSupport initialization in BaseLanguage

* Fix RunService fictive_attach logic

* Disable Intellisense parsing for languages without Intellisense support

* Add DefaultLanguageInformation abstract class

* Add default implementation for SetSemanticConstants in BaseLanguage

* Simplify IParser interface

* Update developer guide documentation
2026-01-27 22:25:28 +03:00

82 lines
3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 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 PascalABCCompiler.Parsers;
using PascalABCCompiler.SyntaxTreeConverters;
using PascalABCCompiler.TreeConverter;
namespace Languages.Facade
{
/// <summary>
/// Интерфейс языка программирования, поддерживаемого платформой
/// </summary>
public interface ILanguage
{
/// <summary>
/// Название языка
/// </summary>
string Name { get; }
/// <summary>
/// Версия языка
/// </summary>
string Version { get; }
/// <summary>
/// Авторское право
/// </summary>
string Copyright { get; }
ILanguageInformation LanguageInformation { get; }
ILanguageIntellisenseSupport LanguageIntellisenseSupport { get; }
/// <summary>
/// Основной парсер языка
/// </summary>
IParser Parser { get; }
/// <summary>
/// Парсер документирующих комментариев языка
/// </summary>
IDocParser DocParser { get; }
/// <summary>
/// Постпреобразования синтаксического дерева (синтаксический сахар и др.)
/// </summary>
List<ISyntaxTreeConverter> SyntaxTreeConverters { get; }
/// <summary>
/// Преобразователь из синтаксического дерева в семантическое
/// </summary>
syntax_tree_visitor SyntaxTreeToSemanticTreeConverter { get; }
/// <summary>
/// Расширения файлов, относящиеся к языку
/// </summary>
string[] FilesExtensions { get; }
/// <summary>
/// Чувствительность к регистру
/// </summary>
bool CaseSensitive { get; }
/// <summary>
/// Названия системных модулей (стандартной библиотеки и др.)
/// </summary>
string[] SystemUnitNames { get; }
/// <summary>
/// Задание семантических констант, частично задающих семантические правила языка (поля класса SemanticRules)
/// </summary>
void SetSemanticConstants();
/// <summary>
/// Обновление SyntaxTreeToSemanticTreeConverter (нужно при обновлении компилятора)
/// </summary>
// TODO: Возможно, стоит переделать логику обновления, чтобы не приходилось создавать новый объект каждый раз EVA
void SetSyntaxTreeToSemanticTreeConverter();
}
}