TableItem.avt

Переключить прокрутку окна
Загрузить этот исходный код

/*
    Компилятор языка программирования
    Объектно-ориентированный продвинутый векторный транслятор

    Copyright © 2021, 2024 Малик Разработчик

    Это свободная программа: вы можете перераспространять ее и/или изменять
    ее на условиях Стандартной общественной лицензии GNU в том виде,
    в каком она была опубликована Фондом свободного программного обеспечения;
    либо версии 3 лицензии, либо (по вашему выбору) любой более поздней версии.

    Эта программа распространяется в надежде, что она будет полезной,
    но БЕЗО ВСЯКИХ ГАРАНТИЙ; даже без неявной гарантии ТОВАРНОГО ВИДА
    или ПРИГОДНОСТИ ДЛЯ ОПРЕДЕЛЕННЫХ ЦЕЛЕЙ. Подробнее см. в Стандартной
    общественной лицензии GNU.

    Вы должны были получить копию Стандартной общественной лицензии GNU
    вместе с этой программой. Если это не так, см.
    <https://www.gnu.org/licenses/>.
*/

package ru.malik.elaborarer.avtoo.lang;

import avt.lang.array.*;

public abstract class TableItem(ProgrammeItem, Cloneable, Measureable, ObjectArray)
{
    private int fldImplementationPosition;
    private String fldRecompilableName;
    private String fldFasmSimpleName;
    private final int fldDeclarationPosition;
    private final int fldDocumentationPosition;
    private final LexemeSequence fldDocumentationContent;
    private final Source fldSource;
    private final Library fldParentLibrary;

    package (ProgrammeItem parentItem, String specialSimpleName, Source source, int declarationPosition, int documentationPosition): super(parentItem, specialSimpleName) {
        Object documentationContent = source == null || documentationPosition < 0 || documentationPosition >= source.length ? null : source[documentationPosition];
        fldImplementationPosition = -1;
        fldDeclarationPosition = declarationPosition;
        fldDocumentationPosition = documentationPosition;
        fldDocumentationContent = !(documentationContent instanceof LexemeSequence) ? null : (LexemeSequence) documentationContent;
        fldSource = source;
        fldParentLibrary = parentItem instanceof Library ? (Library) parentItem : !(parentItem instanceof TableItem) ? null : ((TableItem) parentItem).fldParentLibrary;
    }

    public final int implementationPosition { read = fldImplementationPosition, write = fldImplementationPosition }

    public final int declarationPosition { read = fldDeclarationPosition }

    public final int documentationPosition { read = fldDocumentationPosition }

    public final LexemeSequence documentationContent { read = fldDocumentationContent }

    public final String recompilableName { read = fldRecompilableName }

    public final String fasmSimpleName { read = fldFasmSimpleName }

    public final Source source { read = fldSource }

    public final Library parentLibrary { read = fldParentLibrary }

    protected abstract String composeRecompilableName();

    protected abstract String composeFasmSimpleName();

    protected void afterConstruction() {
        super.afterConstruction();
        fldRecompilableName = composeRecompilableName();
        fldFasmSimpleName = composeFasmSimpleName();
    }
}