All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ai.vespa.schemals.schemadocument.parser.schema.IdentifyRankProfileInheritance Maven / Gradle / Ivy

There is a newer version: 8.441.21
Show newest version
package ai.vespa.schemals.schemadocument.parser.schema;

import java.util.ArrayList;

import org.eclipse.lsp4j.Diagnostic;

import ai.vespa.schemals.context.ParseContext;
import ai.vespa.schemals.parser.ast.identifierWithDashStr;
import ai.vespa.schemals.parser.ast.inheritsRankProfile;
import ai.vespa.schemals.schemadocument.parser.Identifier;
import ai.vespa.schemals.tree.SchemaNode;

/**
 * IdentifyRankProfileInheritance indentifies inheritance of a rank-profile and adds it to a list to resolve later.
 */
public class IdentifyRankProfileInheritance extends Identifier {

	public IdentifyRankProfileInheritance(ParseContext context) {
		super(context);
	}

	@Override
	public ArrayList identify(SchemaNode node) {
        ArrayList ret = new ArrayList<>();

        if (!node.isASTInstance(identifierWithDashStr.class)) return ret;
        if (node.getParent() == null || !node.getParent().isASTInstance(inheritsRankProfile.class)) return ret;

        if (!node.hasSymbol()) {
            return ret;
        }

        context.addUnresolvedInheritanceNode(node);

        return ret;
	}

    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy