Class SchemaParser

java.lang.Object
com.yahoo.schema.parser.SchemaParser
All Implemented Interfaces:
SchemaParserConstants

public class SchemaParser extends Object implements SchemaParserConstants
The schema parser NOTE: When this grammar is changed, also change integration/intellij/src/main/bnf/ai/vespa/intellij/schema/parser/sd.bnf
Author:
bratseth
  • Field Details

  • Constructor Details

    • SchemaParser

      public SchemaParser(SimpleCharStream stream, com.yahoo.config.application.api.DeployLogger deployLogger, com.yahoo.config.model.api.ModelContext.Properties properties)
      Creates a parser.
    • SchemaParser

      public SchemaParser(CharStream stream)
      Constructor with user supplied CharStream.
      Parameters:
      stream - stream to init with
    • SchemaParser

      public SchemaParser(SchemaParserTokenManager tm)
      Constructor with generated Token Manager.
      Parameters:
      tm - Token manager to use
  • Method Details

    • schema

      public final ParsedSchema schema() throws ParseException
      The rule consumes any schema and returns the corresponding object. This is the only production that should ever consume leading newlines.
      Returns:
      the schema object
      Throws:
      ParseException
    • rootSchema

      public final ParsedSchema rootSchema() throws ParseException
      This rule consumes a proper schema block. This and rootDocument() are the only rules that should ever consume trailing newline tokens.
      Returns:
      the schema definition object.
      Throws:
      ParseException
    • rootSchemaItem

      public final void rootSchemaItem(ParsedSchema schema) throws ParseException
      Consumes an element of a schema block. This and rootSearch() are the only rules that should ever consume trailing newline tokens.
      Parameters:
      schema - the schema object to modify.
      Throws:
      ParseException
    • rootDocument

      public final ParsedSchema rootDocument() throws ParseException
      Consumes a schema definition that contains only documents to be used for inheritance, etc.
      Returns:
      the schema definition object.
      Throws:
      ParseException
    • rootDocumentItem

      public final ParsedSchema rootDocumentItem(ParsedSchema schema) throws ParseException
      Consumes a single item from within a root document node.
      Parameters:
      schema - the schema object to modify.
      Throws:
      ParseException
    • document

      public final void document(ParsedSchema schema) throws ParseException
      Consumes a document element. The name defaults to the schema's name, but may be set.
      Parameters:
      schema - the schema object to add content to.
      Throws:
      ParseException
    • namedDocument

      public final ParsedDocument namedDocument() throws ParseException
      Consumes a document element, explicitly named
      Throws:
      ParseException
    • documentBody

      public final void documentBody(ParsedDocument document) throws ParseException
      Consumes a document body block
      Parameters:
      document - the document type to modify.
      Throws:
      ParseException
    • rawAsBase64

      public final void rawAsBase64(ParsedSchema schema) throws ParseException
      Throws:
      ParseException
    • inheritsStruct

      public final void inheritsStruct(ParsedStruct struct) throws ParseException
      Consumes struct inheritance
      Parameters:
      struct - The struct type to modify.
      Throws:
      ParseException
    • inheritsDocument

      public final void inheritsDocument(ParsedDocument document) throws ParseException
      Consumes a document inheritance statement.
      Parameters:
      document - The document type to modify.
      Throws:
      ParseException
    • fieldInsideDoc

      public final void fieldInsideDoc(ParsedDocument document) throws ParseException
      Consumes a field block from within a document element.
      Parameters:
      document - the document type to modify
      Throws:
      ParseException
    • fieldOutsideDoc

      public final void fieldOutsideDoc(ParsedSchema schema) throws ParseException
      Consumes a field block from outside a document element.
      Parameters:
      schema - the schema to modify
      Throws:
      ParseException
    • field

      public final com.yahoo.schema.parser.ParsedField field() throws ParseException
      Consumes a field block
      Throws:
      ParseException
    • fieldSet

      public final void fieldSet(ParsedSchema schema) throws ParseException
      Consumes a fieldset block
      Throws:
      ParseException
    • annotationOutside

      public final void annotationOutside(ParsedSchema schema) throws ParseException
      This rule consumes a annotation block from within a schema element.
      Parameters:
      schema - the schema object to add content to
      Throws:
      ParseException
    • annotation

      public final void annotation(ParsedDocument document) throws ParseException
      Consumes an annotation block from within a document element
      Parameters:
      document - the document object to add content to
      Throws:
      ParseException
    • annotationBody

      public final void annotationBody(com.yahoo.schema.parser.ParsedAnnotation type) throws ParseException
      Consumes a single element of an annotation body block.
      Throws:
      ParseException
    • inheritsAnnotation

      public final void inheritsAnnotation(com.yahoo.schema.parser.ParsedAnnotation annotation) throws ParseException
      Throws:
      ParseException
    • structInside

      public final void structInside(ParsedDocument document) throws ParseException
      This rule consumes a struct block from within a document element.
      Parameters:
      document - the document object to add content to
      Throws:
      ParseException
    • structOutside

      public final void structOutside(ParsedSchema schema) throws ParseException
      This rule consumes a struct block from within a schema element.
      Parameters:
      schema - the schema object to add content to
      Throws:
      ParseException
    • structDefinition

      public final ParsedStruct structDefinition() throws ParseException
      This rule consumes a struct declaration block
      Throws:
      ParseException
    • dataType

      public final com.yahoo.schema.parser.ParsedType dataType() throws ParseException
      This rule consumes a data type block from within a field element.
      Returns:
      the consumed data type
      Throws:
      ParseException
    • referenceType

      public final com.yahoo.schema.parser.ParsedType referenceType() throws ParseException
      Throws:
      ParseException
    • annotationRefDataType

      public final com.yahoo.schema.parser.ParsedType annotationRefDataType() throws ParseException
      Throws:
      ParseException
    • mapDataType

      public final com.yahoo.schema.parser.ParsedType mapDataType() throws ParseException
      Throws:
      ParseException
    • structFieldDefinition

      public final void structFieldDefinition(ParsedStruct struct) throws ParseException
      This rule consumes a field block of a struct body.
      Parameters:
      struct - The struct to modify.
      Throws:
      ParseException
    • structField

      public final void structField(com.yahoo.schema.parser.ParsedField field) throws ParseException
      This rule consumes a struct subfield from a document field body. This is not to be confused with a document struct's fields, but rather this is a subfield of a document field of type struct.
      Parameters:
      field - the field to modify
      Throws:
      ParseException
    • fieldBody

      public final void fieldBody(com.yahoo.schema.parser.ParsedField field) throws ParseException
      This rule consumes a single element of a field body block.
      Parameters:
      field - the field being built
      Throws:
      ParseException
    • structFieldBody

      public final void structFieldBody(com.yahoo.schema.parser.ParsedField field) throws ParseException
      This rule consumes a single element of a struct subfield body block. Only elements that are supported in streaming schema and indexed schema (with complex attributes) are allowed.
      Parameters:
      field - the field being built
      Throws:
      ParseException
    • indexing

      public final void indexing(com.yahoo.schema.parser.ParsedField field) throws ParseException
      This rule consumes an indexing block of a field element.
      Parameters:
      field - The field to modify.
      Throws:
      ParseException
    • indexingOperation

      public final void indexingOperation(com.yahoo.schema.parser.ParsedField field, boolean multiLine) throws ParseException
      This rule consumes an IL script block. This is expected to consume trailing newlines.
      Parameters:
      field - The field to modify.
      Throws:
      ParseException
    • summaryTo

      public final void summaryTo(com.yahoo.schema.parser.ParsedField field) throws ParseException
      This rule consumes a summary-to statement of a field element.
      Parameters:
      field - The field to modify.
      Throws:
      ParseException
    • weight

      public final void weight(com.yahoo.schema.parser.ParsedField field) throws ParseException
      This rule consumes a weight statement of a field element.
      Parameters:
      field - The field to modify.
      Throws:
      ParseException
    • weightedset

      public final void weightedset(com.yahoo.schema.parser.ParsedType fieldType) throws ParseException
      This rule consumes a weighted set statement of a field element.
      Parameters:
      fieldType - The field type to modify.
      Throws:
      ParseException
    • weightedsetBody

      public final void weightedsetBody(com.yahoo.schema.parser.ParsedType type) throws ParseException
      This rule consumes one body item of a weighted set block.
      Parameters:
      type - The field type to modify.
      Throws:
      ParseException
    • rankType

      public final void rankType(com.yahoo.schema.parser.ParsedField field) throws ParseException
      This rule consumes a rank-type statement of a field element.
      Parameters:
      field - The field to modify.
      Throws:
      ParseException
    • attribute

      public final void attribute(com.yahoo.schema.parser.ParsedField field) throws ParseException
      This rule consumes an attribute statement of a field element.
      Parameters:
      field - The field to modify.
      Throws:
      ParseException
    • fieldSorting

      public final void fieldSorting(com.yahoo.schema.parser.ParsedField field) throws ParseException
      Throws:
      ParseException
    • attributeSorting

      public final void attributeSorting(com.yahoo.schema.parser.ParsedAttribute attribute) throws ParseException
      Throws:
      ParseException
    • sorting

      public final void sorting(com.yahoo.schema.parser.ParsedSorting sort) throws ParseException
      Throws:
      ParseException
    • sortingSetting

      public final void sortingSetting(com.yahoo.schema.parser.ParsedSorting sorting) throws ParseException
      Throws:
      ParseException
    • attributeSetting

      public final void attributeSetting(com.yahoo.schema.parser.ParsedAttribute attribute) throws ParseException
      This rule consumes a single attribute setting statement of an attribute element.
      Parameters:
      attribute - The attribute to change.
      Throws:
      ParseException
    • summaryInDocument

      public final void summaryInDocument(com.yahoo.schema.parser.ParsedDocumentSummary docsum) throws ParseException
      This rule consumes a summary statement defined inside a document-summary block.
      Parameters:
      docsum - The document summary to modify.
      Throws:
      ParseException
    • summaryInField

      public final void summaryInField(com.yahoo.schema.parser.ParsedField field) throws ParseException
      The rule consumes a summary statement defined inside a field.
      Parameters:
      field - The field to modify.
      Throws:
      ParseException
    • summaryInFieldShort

      public final void summaryInFieldShort(com.yahoo.schema.parser.ParsedField field) throws ParseException
      This rule consumes a single-line summary field.
      Throws:
      ParseException
    • summaryInFieldLong

      public final void summaryInFieldLong(com.yahoo.schema.parser.ParsedField field) throws ParseException
      This rule consumes a multi-line summary field.
      Throws:
      ParseException
    • summaryItem

      public final void summaryItem(com.yahoo.schema.parser.ParsedSummaryField field) throws ParseException
      This rule consumes an item of a summary field block.
      Parameters:
      field - The field to modify.
      Throws:
      ParseException
    • summaryTransform

      public final void summaryTransform(com.yahoo.schema.parser.ParsedSummaryField field) throws ParseException
      This rule consumes a transform statement for a summary field element.
      Parameters:
      field - The field to modify.
      Throws:
      ParseException
    • summaryBolding

      public final void summaryBolding(com.yahoo.schema.parser.ParsedSummaryField field) throws ParseException
      This rule consumes a bolding statement for a summary field element.
      Parameters:
      field - The summary field to modify.
      Throws:
      ParseException
    • summarySourceList

      public final void summarySourceList(com.yahoo.schema.parser.ParsedSummaryField field) throws ParseException
      This rule consumes a source-list statement for a summary field element.
      Parameters:
      field - The summary field to modify.
      Throws:
      ParseException
    • summaryDestinationList

      public final void summaryDestinationList(com.yahoo.schema.parser.ParsedSummaryField field) throws ParseException
      This rule consumes a destination-list statement for a summary field element.
      Parameters:
      field - The summary field to modify.
      Throws:
      ParseException
    • fieldStemming

      public final void fieldStemming(com.yahoo.schema.parser.ParsedField field) throws ParseException
      This rule consumes a stemming block of a field element.
      Parameters:
      field - The field to modify.
      Throws:
      ParseException
    • searchStemming

      public final void searchStemming(ParsedSchema schema) throws ParseException
      This rule consumes a stemming statement for a schema element.
      Parameters:
      schema - the schema to modify
      Throws:
      ParseException
    • normalizing

      public final void normalizing(com.yahoo.schema.parser.ParsedField field) throws ParseException
      This rule consumes a normalizing statement of a field element. At the moment, this can only be used to turn off normalizing.
      Parameters:
      field - The field to modify.
      Throws:
      ParseException
    • bolding

      public final void bolding(com.yahoo.schema.parser.ParsedField field) throws ParseException
      This rule consumes a bolding statement of a field element.
      Parameters:
      field - The field to modify.
      Throws:
      ParseException
    • dictionary

      public final void dictionary(com.yahoo.schema.parser.ParsedField field) throws ParseException
      This rule consumes a dictionary statement of a field element.
      Parameters:
      field - The field to modify.
      Throws:
      ParseException
    • dictionarySetting

      public final void dictionarySetting(com.yahoo.schema.parser.ParsedField field) throws ParseException
      Throws:
      ParseException
    • queryCommand

      public final void queryCommand(com.yahoo.schema.parser.ParsedField field) throws ParseException
      Throws:
      ParseException
    • alias

      public final void alias(com.yahoo.schema.parser.ParsedField field) throws ParseException
      Throws:
      ParseException
    • matchSettings

      public final void matchSettings(ParsedMatchSettings matchInfo) throws ParseException
      Throws:
      ParseException
    • matchType

      public final void matchType(ParsedMatchSettings matchInfo) throws ParseException
      Throws:
      ParseException
    • matchItem

      public final void matchItem(ParsedMatchSettings matchInfo) throws ParseException
      This rule consumes a single match item for a match block.
      Parameters:
      matchInfo - The settings to modify.
      Throws:
      ParseException
    • exactTerminator

      public final void exactTerminator(ParsedMatchSettings matchInfo) throws ParseException
      Throws:
      ParseException
    • gramSize

      public final void gramSize(ParsedMatchSettings matchInfo) throws ParseException
      Throws:
      ParseException
    • matchSize

      public final void matchSize(ParsedMatchSettings matchInfo) throws ParseException
      Throws:
      ParseException
    • rank

      public final void rank(com.yahoo.schema.parser.ParsedField field) throws ParseException
      Consumes a rank statement of a field element.
      Parameters:
      field - The field to modify.
      Throws:
      ParseException
    • rankSetting

      public final void rankSetting(com.yahoo.schema.parser.ParsedField field) throws ParseException
      Consumes a single rank setting of a rank statement.
      Parameters:
      field - The field to modify.
      Throws:
      ParseException
    • id

      public final void id(com.yahoo.schema.parser.ParsedField field) throws ParseException
      Consumes an id statement of a field body block.
      Parameters:
      field - The field to modify.
      Throws:
      ParseException
    • documentSummary

      public final void documentSummary(ParsedSchema schema) throws ParseException
      Consumes a document-summary block from within a schema block.
      Parameters:
      schema - the schema object to add content to
      Throws:
      ParseException
    • inheritsDocumentSummary

      public final void inheritsDocumentSummary(com.yahoo.schema.parser.ParsedDocumentSummary documentSummary) throws ParseException
      This rule consumes an inherits statement of a document summary.
      Parameters:
      documentSummary - the document summary to modify
      Throws:
      ParseException
    • documentSummaryItem

      public final void documentSummaryItem(com.yahoo.schema.parser.ParsedDocumentSummary summary) throws ParseException
      Consumes a single document-summary item.
      Parameters:
      summary - The document summary to modify.
      Throws:
      ParseException
    • indexOutsideDoc

      public final void indexOutsideDoc(ParsedSchema schema) throws ParseException
      Consumes an index block in a schema element.
      Parameters:
      schema - the schema object to add content to
      Throws:
      ParseException
    • indexInsideField

      public final void indexInsideField(com.yahoo.schema.parser.ParsedField field) throws ParseException
      Consumes an index block for a field element.
      Parameters:
      field - the field to modify
      Throws:
      ParseException
    • indexBody

      public final void indexBody(com.yahoo.schema.parser.ParsedIndex index) throws ParseException
      Consumes a single index statement for an index block.
      Parameters:
      index - The index to modify.
      Throws:
      ParseException
    • hnswIndex

      public final void hnswIndex(com.yahoo.schema.parser.ParsedIndex index) throws ParseException
      Throws:
      ParseException
    • hnswIndexBody

      public final void hnswIndexBody(HnswIndexParams.Builder params) throws ParseException
      Throws:
      ParseException
    • onnxModelInSchema

      public final void onnxModelInSchema(ParsedSchema schema) throws ParseException
      Throws:
      ParseException
    • onnxModelInProfile

      public final void onnxModelInProfile(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      Throws:
      ParseException
    • onnxModel

      public final OnnxModel onnxModel() throws ParseException
      Consumes an onnx-model block.
      Throws:
      ParseException
    • onnxModelItem

      public final void onnxModelItem(OnnxModel onnxModel) throws ParseException
      Consumes an onnx-model block.
      Parameters:
      onnxModel - the onnxModel to modify
      Throws:
      ParseException
    • rankingConstant

      public final void rankingConstant(ParsedSchema schema) throws ParseException
      Consumes a constant block of a schema element.
      Parameters:
      schema - the schema object to add content to
      Throws:
      ParseException
    • fileItem

      public final String fileItem() throws ParseException
      Throws:
      ParseException
    • uriItem

      public final String uriItem() throws ParseException
      Throws:
      ParseException
    • rankingConstantErrorMessage

      public final String rankingConstantErrorMessage(String name) throws ParseException
      Throws:
      ParseException
    • rankProfile

      public final void rankProfile(ParsedSchema schema) throws ParseException
      Consumes a rank-profile block of a schema element.
      Parameters:
      schema - the schema object to add content to
      Throws:
      ParseException
    • rankProfileItem

      public final void rankProfileItem(ParsedSchema schema, com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      This rule consumes a single statement for a rank-profile block.
      Parameters:
      profile - The rank profile to modify.
      Throws:
      ParseException
    • inheritsRankProfile

      public final void inheritsRankProfile(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      Consumes an inherits statement of a rank-profile.
      Parameters:
      profile - the profile to modify
      Throws:
      ParseException
    • mutate

      public final void mutate(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      This rule consumes an mutate statement of a rank-profile.
      Parameters:
      profile - The profile to modify.
      Throws:
      ParseException
    • mutate_operation

      public final void mutate_operation(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      Throws:
      ParseException
    • mutate_expr

      public final String mutate_expr() throws ParseException
      Throws:
      ParseException
    • function

      public final void function(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      This rule consumes a function statement of a rank-profile.
      Parameters:
      profile - The profile to modify.
      Throws:
      ParseException
    • inline

      public final boolean inline() throws ParseException
      Throws:
      ParseException
    • matchPhase

      public final void matchPhase(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      This rule consumes a match-phase block of a rank profile.
      Parameters:
      profile - The rank profile to modify.
      Throws:
      ParseException
    • matchPhaseItem

      public final void matchPhaseItem(RankProfile.MatchPhaseSettings settings) throws ParseException
      Throws:
      ParseException
    • diversity

      public final void diversity(RankProfile.MatchPhaseSettings profile) throws ParseException
      This rule consumes a diversity block of a rank profile.
      Parameters:
      profile - The rank profile to modify.
      Throws:
      ParseException
    • diversityItem

      public final void diversityItem(RankProfile.DiversitySettings settings) throws ParseException
      Throws:
      ParseException
    • firstPhase

      public final void firstPhase(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      Consumes the first-phase block of a rank profile.
      Parameters:
      profile - The rank profile to modify.
      Throws:
      ParseException
    • firstPhaseItem

      public final void firstPhaseItem(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      Throws:
      ParseException
    • secondPhase

      public final void secondPhase(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      Consumes the second-phase block of a rank profile.
      Parameters:
      profile - The rank profile to modify.
      Throws:
      ParseException
    • secondPhaseItem

      public final void secondPhaseItem(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      Consumes a statement for a second-phase block.
      Parameters:
      profile - The rank profile to modify.
      Throws:
      ParseException
    • inputs

      public final void inputs(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      Consumes an inputs block of a rank profile.
      Throws:
      ParseException
    • input

      public final void input(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      Throws:
      ParseException
    • inputName

      public final com.yahoo.searchlib.rankingexpression.Reference inputName() throws ParseException
      Returns the reference "query(name)" for both "query(name)" and "name".
      Throws:
      ParseException
    • valueType

      public final com.yahoo.tensor.TensorType valueType(com.yahoo.searchlib.rankingexpression.Reference reference) throws ParseException
      Throws:
      ParseException
    • summaryFeatures

      public final void summaryFeatures(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      Consumes a summary-features block of a rank profile.
      Parameters:
      profile - the rank profile to modify
      Throws:
      ParseException
    • strict

      public final void strict(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      Throws:
      ParseException
    • matchFeatures

      public final void matchFeatures(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      Consumes a match-features block of a rank profile.
      Parameters:
      profile - the rank profile to modify
      Throws:
      ParseException
    • rankFeatures

      public final void rankFeatures(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      Consumes a rank-features block of a rank profile
      Throws:
      ParseException
    • ignoreRankFeatures

      public final void ignoreRankFeatures(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      This rule consumes a ignore-default-rank-features statement for a rank profile.
      Parameters:
      profile - The rank profile to modify.
      Throws:
      ParseException
    • numThreadsPerSearch

      public final void numThreadsPerSearch(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      This rule consumes a num-threads-per-search statement for a rank profile.
      Parameters:
      profile - The rank profile to modify.
      Throws:
      ParseException
    • minHitsPerThread

      public final void minHitsPerThread(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      This rule consumes a min-hits-per-thread statement for a rank profile.
      Parameters:
      profile - The rank profile to modify.
      Throws:
      ParseException
    • numSearchPartitions

      public final void numSearchPartitions(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      This rule consumes a num-search-partitions statement for a rank profile.
      Parameters:
      profile - the rank profile to modify
      Throws:
      ParseException
    • termwiseLimit

      public final void termwiseLimit(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      This rule consumes a termwise-limit statement for a rank profile.
      Parameters:
      profile - the rank profile to modify
      Throws:
      ParseException
    • postFilterThreshold

      public final void postFilterThreshold(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      This rule consumes a post-filter-threshold statement for a rank profile.
      Parameters:
      profile - the rank profile to modify
      Throws:
      ParseException
    • approximateThreshold

      public final void approximateThreshold(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      This rule consumes an approximate-threshold statement for a rank profile.
      Parameters:
      profile - the rank profile to modify
      Throws:
      ParseException
    • rankProperties

      public final void rankProperties(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      Consumes a rank-properties block of a rank profile. There is a little trick within this rule to allow the final rank property to skip the terminating newline token.
      Parameters:
      profile - the rank profile to modify
      Throws:
      ParseException
    • rankProperty

      public final void rankProperty(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      Consumes a single rank property pair for a rank profile.
      Parameters:
      profile - the rank profile to modify
      Throws:
      ParseException
    • rankPropertyItem

      public final String rankPropertyItem() throws ParseException
      Consumes a single rank property for a rank-properties block.
      Returns:
      the token image of the consumed item
      Throws:
      ParseException
    • fieldWeight

      public final void fieldWeight(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      Consumes a field-weight statement of a rank profile.
      Parameters:
      profile - the rank profile to modify
      Throws:
      ParseException
    • fieldRankType

      public final void fieldRankType(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      Consumes a rank-type statement of a rank profile.
      Parameters:
      profile - the rank profile to modify
      Throws:
      ParseException
    • fieldRankFilter

      public final void fieldRankFilter(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      Consumes a rank filter statement of a rank profile.
      Parameters:
      profile - the rank profile to modify
      Throws:
      ParseException
    • constants

      public final void constants(ParsedSchema schema, com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      Consumes a set of constants available in ranking expressions in the enclosing profile.
      Throws:
      ParseException
    • constant

      public final void constant(ParsedSchema schema, com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException
      Throws:
      ParseException
    • constantName

      public final com.yahoo.searchlib.rankingexpression.Reference constantName() throws ParseException
      Returns the reference "constant(name)" for both "constant(name)" and "name".
      Throws:
      ParseException
    • constantValue

      public final void constantValue(com.yahoo.schema.parser.ParsedRankProfile profile, com.yahoo.searchlib.rankingexpression.Reference name) throws ParseException
      Throws:
      ParseException
    • constantTensor

      public final void constantTensor(com.yahoo.schema.parser.ParsedRankProfile profile, com.yahoo.searchlib.rankingexpression.Reference name) throws ParseException
      Throws:
      ParseException
    • constantTensorErrorMessage

      public final String constantTensorErrorMessage(String rankProfileName, com.yahoo.searchlib.rankingexpression.Reference name) throws ParseException
      Throws:
      ParseException
    • tensorValue

      public final com.yahoo.tensor.Tensor tensorValue(com.yahoo.tensor.TensorType type) throws ParseException
      Parses a tensor written in a tensor literal form, https://docs.vespa.ai/en/reference/tensor.html#tensor-literal-form
      Throws:
      ParseException
    • mappedTensorValue

      public final void mappedTensorValue(com.yahoo.tensor.Tensor.Builder builder) throws ParseException
      A mapped or mixed tensor value.
      Throws:
      ParseException
    • mappedTensorBlock

      public final void mappedTensorBlock(com.yahoo.tensor.Tensor.Builder builder) throws ParseException
      Throws:
      ParseException
    • indexedTensorBlockValues

      public final void indexedTensorBlockValues(com.yahoo.tensor.TensorAddress mappedAddress, com.yahoo.tensor.Tensor.Builder builder) throws ParseException
      Throws:
      ParseException
    • indexedTensorValues

      public final void indexedTensorValues(com.yahoo.tensor.Tensor.Builder builder) throws ParseException
      Throws:
      ParseException
    • arrayTensorValues

      public final void arrayTensorValues(List<Double> values) throws ParseException
      Tensor array values. Using sub-bracketing for multiple dimensions is optional and therefore ignored here.
      Throws:
      ParseException
    • indexedTensorValue

      public final void indexedTensorValue(List<Double> values) throws ParseException
      Throws:
      ParseException
    • mappedTensorCellValue

      public final void mappedTensorCellValue(com.yahoo.tensor.TensorAddress address, com.yahoo.tensor.Tensor.Builder builder) throws ParseException
      Throws:
      ParseException
    • tensorAddress

      public final com.yahoo.tensor.TensorAddress tensorAddress(com.yahoo.tensor.TensorType type) throws ParseException
      Throws:
      ParseException
    • tensorAddressElement

      public final void tensorAddressElement(com.yahoo.tensor.TensorAddress.Builder builder) throws ParseException
      Throws:
      ParseException
    • tensorAddressLabel

      public final String tensorAddressLabel() throws ParseException
      Throws:
      ParseException
    • tensorCellValue

      public final double tensorCellValue() throws ParseException
      Throws:
      ParseException
    • tensorValuePrefixedByValue

      public final String tensorValuePrefixedByValue() throws ParseException
      Undocumented syntax for supplying a tensor constant value by a string prefixed by "value"
      Throws:
      ParseException
    • tensorTypeWithPrefix

      public final com.yahoo.tensor.TensorType tensorTypeWithPrefix(String errorMessage) throws ParseException
      Throws:
      ParseException
    • tensorType

      public final com.yahoo.tensor.TensorType tensorType(String errorMessage) throws ParseException
      Throws:
      ParseException
    • importField

      public final void importField(ParsedSchema schema) throws ParseException
      Throws:
      ParseException
    • expression

      public final String expression() throws ParseException
      This rule consumes an expression token and returns its image.
      Returns:
      The consumed token image.
      Throws:
      ParseException
    • identifierWithDash

      public final String identifierWithDash() throws ParseException
      Throws:
      ParseException
    • identifier

      public final String identifier() throws ParseException
      Consumes an identifier. This must be kept in sync with all word tokens that should be parseable as identifiers.
      Returns:
      the identifier string
      Throws:
      ParseException
    • string

      public final String string() throws ParseException
      Consumes a string token and returns the token image.
      Returns:
      The consumed token image.
      Throws:
      ParseException
    • quotedString

      public final String quotedString() throws ParseException
      Consumes a quoted string token and returns the token image minus the quotes. This does not perform unescaping of the content, it simply removes the first and last character of the image. However, the token itself can contain anything but a double quote.
      Returns:
      the unquoted token image
      Throws:
      ParseException
    • bool

      public final Boolean bool() throws ParseException
      A boolean value.
      Throws:
      ParseException
    • integer

      public final int integer() throws ParseException
      Consumes an integer token and returns its numeric value.
      Throws:
      ParseException
    • longValue

      public final long longValue() throws ParseException
      Consumes a long or integer token and returns its numeric value.
      Throws:
      ParseException
    • floatValue

      public final double floatValue() throws ParseException
      Consumes a floating-point token and returns its numeric value.
      Throws:
      ParseException
    • number

      public final Number number() throws ParseException
      Throws:
      ParseException
    • lbrace

      public final void lbrace() throws ParseException
      Consumes an opening brace with leading and trailing newline tokens.
      Throws:
      ParseException
    • ReInit

      public void ReInit(CharStream stream)
      Reinitialise.
      Parameters:
      stream - stream to init with
    • ReInit

      public void ReInit(SchemaParserTokenManager tm)
      Reinitialise
      Parameters:
      tm - Token manager to use
    • getNextToken

      public final Token getNextToken()
      Returns:
      the next Token.
    • getToken

      public final Token getToken(int index)
      Parameters:
      index - index to be retrieved
      Returns:
      the specific Token.
    • generateParseException

      public ParseException generateParseException()
      Generate ParseException.
      Returns:
      new Exception object. Never null
    • trace_enabled

      public final boolean trace_enabled()
      Returns:
      Always false.
    • enable_tracing

      public final void enable_tracing()
      Enable tracing.
    • disable_tracing

      public final void disable_tracing()
      Disable tracing.