NestedAllocatableMember.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 NestedAllocatableMember(AllocatableMember, Cloneable, Measureable, ObjectArray, AllocatableFactory, AVTOOConstants)
{
    package (AllocatableFactory parentItem, int declarationPosition, int documentationPosition):
        super(parentItem, PUBLIC, null, declarationPosition, documentationPosition) {
    }

    public Field createStructField(Type type, int capacity, String specialSimpleName, int declarationPosition, int documentationPosition) {
        Field result = AllocatableFactory.super.createStructField(type, capacity, specialSimpleName, declarationPosition, documentationPosition);
        ClassType enclosing = parentType;
        if(enclosing != null) enclosing.appendChildItem(result);
        return result;
    }

    public final AllocatableMember getChildItem(String specialSimpleName) { return (AllocatableMember) super.getChildItem(specialSimpleName); }

    public final AllocatableMember getChildItem(String specialSimpleName, boolean ignoreCase) { return (AllocatableMember) super.getChildItem(specialSimpleName, ignoreCase); }

    public final AllocatableMember getChildMember(String specialSimpleName) { return (AllocatableMember) super.getChildItem(specialSimpleName); }

    public final AllocatableMember getChildMember(String specialSimpleName, boolean ignoreCase) { return (AllocatableMember) super.getChildItem(specialSimpleName, ignoreCase); }

    public final AllocatableMember operator [](int index) { return (AllocatableMember) super.operator [](index); }

    protected void insertChildItem(ProgrammeItem item, int position) {
        if(item != null && !(item instanceof AllocatableMember))
        {
            throw new IllegalArgumentException(package.getResourceString("adding-item.not-a-allocatable"));
        }
        super.insertChildItem(item, position);
    }

    protected final int computeInstanceOffset(int currentOffset, FieldsMap fieldsMap) {
        throw new UnsupportedOperationException(String.format(package.getResourceString("unsupported-operation.compute-instance-offset"), new Object[] { getClass().canonicalName }));
    }

    protected final String composeRecompilableName() { return null; }

    protected final String composeFasmSimpleName() { return null; }

    protected final String composeFasmFullName() { return null; }
}