From 6d6df9ae6409682cf78e388aa4c9c8d9f83eb8fc Mon Sep 17 00:00:00 2001 From: Arne Juul Date: Thu, 30 Mar 2023 08:50:40 +0000 Subject: rename some tokens containing dash for consistency --- config-model/src/main/javacc/SchemaParser.jj | 260 +++++++++++++-------------- 1 file changed, 130 insertions(+), 130 deletions(-) (limited to 'config-model/src/main/javacc') diff --git a/config-model/src/main/javacc/SchemaParser.jj b/config-model/src/main/javacc/SchemaParser.jj index 714e481d0e2..1684bf732d9 100644 --- a/config-model/src/main/javacc/SchemaParser.jj +++ b/config-model/src/main/javacc/SchemaParser.jj @@ -164,13 +164,13 @@ TOKEN : | < FIELD: "field" > | < FIELDS: "fields" > | < FIELDSET: "fieldset" > -| < STRUCTFIELD: "struct-field" > +| < STRUCT_FIELD: "struct-field" > | < IMPORT: "import" > | < AS: "as" > | < INDEXING: "indexing" > -| < SUMMARYTO: "summary-to" > -| < DOCUMENTSUMMARY: "document-summary" > -| < RANKTYPE: "rank-type" > +| < SUMMARY_TO: "summary-to" > +| < DOCUMENT_SUMMARY: "document-summary" > +| < RANK_TYPE: "rank-type" > | < WEIGHT: "weight" > | < TYPE: "type" > | < INDEX: "index" > @@ -179,29 +179,29 @@ TOKEN : | < TEXT: "text" > | < WORD: "word" > | < GRAM: "gram" > -| < GRAMSIZE: "gram-size" > -| < MAXLENGTH: "max-length" > +| < GRAM_SIZE: "gram-size" > +| < MAX_LENGTH: "max-length" > | < PREFIX: "prefix" > | < SUBSTRING: "substring" > | < SUFFIX: "suffix" > | < CONSTANT: "constant"> -| < ONNXMODEL: "onnx-model"> -| < INTRAOPTHREADS: "intraop-threads"> -| < INTEROPTHREADS: "interop-threads"> -| < GPUDEVICE: "gpu-device"> -| < EXECUTIONMODE: "execution-mode"> +| < ONNX_MODEL: "onnx-model"> +| < INTRAOP_THREADS: "intraop-threads"> +| < INTEROP_THREADS: "interop-threads"> +| < GPU_DEVICE: "gpu-device"> +| < EXECUTION_MODE: "execution-mode"> | < PARALLEL: "parallel"> | < SEQUENTIAL: "sequential"> | < MODEL: "model" > | < MUTATE: "mutate" > | < QUERY: "query" > -| < RANKPROFILE: "rank-profile" > +| < RANK_PROFILE: "rank-profile" > | < RAW_AS_BASE64_IN_SUMMARY: "raw-as-base64-in-summary" > | < SUMMARY: "summary" > | < FULL: "full" > | < STATIC: "static" > | < DYNAMIC: "dynamic" > -| < MATCHEDELEMENTSONLY: "matched-elements-only" > +| < MATCHED_ELEMENTS_ONLY: "matched-elements-only" > | < SSCONTEXTUAL: "contextual" > | < SSOVERRIDE: "override" > | < SSTITLE: "title" > @@ -236,7 +236,7 @@ TOKEN : | < TRUE: "true" > | < FALSE: "false" > | < SYMMETRIC: "symmetric" > -| < QUERYCOMMAND: "query-command" > +| < QUERY_COMMAND: "query-command" > | < ALIAS: "alias" > | < MATCH: "match" > | < RANK: "rank" > @@ -244,24 +244,24 @@ TOKEN : | < EXACT: "exact" > | < FILTER: "filter" > | < NORMAL: "normal" > -| < EXACTTERMINATOR: "exact-terminator" > -| < IGNOREDEFAULTRANKFEATURES: "ignore-default-rank-features" > +| < EXACT_TERMINATOR: "exact-terminator" > +| < IGNORE_DEFAULT_RANK_FEATURES: "ignore-default-rank-features" > | < ID: "id" > | < SOURCE: "source" > | < TO: "to" > | < DIRECT: "direct" > -| < FROMDISK: "from-disk" > -| < OMITSUMMARYFEATURES: "omit-summary-features" > +| < FROM_DISK: "from-disk" > +| < OMIT_SUMMARY_FEATURES: "omit-summary-features" > | < ALWAYS: "always" > -| < ONDEMAND: "on-demand" > +| < ON_DEMAND: "on-demand" > | < NEVER: "never" > -| < ENABLEBITVECTORS: "enable-bit-vectors" > -| < ENABLEONLYBITVECTOR: "enable-only-bit-vector" > -| < FASTACCESS: "fast-access" > +| < ENABLE_BIT_VECTORS: "enable-bit-vectors" > +| < ENABLE_ONLY_BIT_VECTOR: "enable-only-bit-vector" > +| < FAST_ACCESS: "fast-access" > | < MUTABLE: "mutable" > | < PAGED: "paged" > -| < FASTRANK: "fast-rank" > -| < FASTSEARCH: "fast-search" > +| < FAST_RANK: "fast-rank" > +| < FAST_SEARCH: "fast-search" > | < TENSOR_TYPE: "tensor" ("<" (~["<",">"])+ ">")? "(" (~["(",")"])* ")" > | < TENSOR_VALUE_SL: "value" (" ")* ":" (" ")* ("{") ("\n")? > | < TENSOR_VALUE_ML: "value" ()? "{" (["\n"," "])* ("{") (["\n"," "])* "}" ("\n")? > @@ -275,30 +275,30 @@ TOKEN : | < MAP: "map" > | < REFERENCE: "reference" > | < QUESTIONMARK: "?" > -| < CREATEIFNONEXISTENT: "create-if-nonexistent" > -| < REMOVEIFZERO: "remove-if-zero" > -| < MATCHPHASE: "match-phase" > +| < CREATE_IF_NONEXISTENT: "create-if-nonexistent" > +| < REMOVE_IF_ZERO: "remove-if-zero" > +| < MATCH_PHASE: "match-phase" > | < EVALUATION_POINT: "evaluation-point" > | < PRE_POST_FILTER_TIPPING_POINT: "pre-post-filter-tipping-point" > | < ORDER: "order" > -| < MAXFILTERCOVERAGE: "max-filter-coverage" > -| < MAXHITS: "max-hits" > -| < FIRSTPHASE: "first-phase" > -| < SECONDPHASE: "second-phase" > -| < GLOBALPHASE: "global-phase" > +| < MAX_FILTER_COVERAGE: "max-filter-coverage" > +| < MAX_HITS: "max-hits" > +| < FIRST_PHASE: "first-phase" > +| < SECOND_PHASE: "second-phase" > +| < GLOBAL_PHASE: "global-phase" > | < MACRO: "macro" > | < INLINE: "inline" > | < ARITY: "arity" > -| < LOWERBOUND: "lower-bound" > -| < UPPERBOUND: "upper-bound" > -| < DENSEPOSTINGLISTTHRESHOLD: "dense-posting-list-threshold" > +| < LOWER_BOUND: "lower-bound" > +| < UPPER_BOUND: "upper-bound" > +| < DENSE_POSTING_LIST_THRESHOLD: "dense-posting-list-threshold" > | < ENABLE_BM25: "enable-bm25" > | < HNSW: "hnsw" > -| < MAXLINKSPERNODE: "max-links-per-node" > +| < MAX_LINKS_PER_NODE: "max-links-per-node" > | < DOUBLE_KEYWORD: "double" > -| < DISTANCEMETRIC: "distance-metric" > -| < NEIGHBORSTOEXPLOREATINSERT: "neighbors-to-explore-at-insert" > -| < MULTITHREADEDINDEXING: "multi-threaded-indexing" > +| < DISTANCE_METRIC: "distance-metric" > +| < NEIGHBORS_TO_EXPLORE_AT_INSERT: "neighbors-to-explore-at-insert" > +| < MULTI_THREADED_INDEXING: "multi-threaded-indexing" > | < MATCHFEATURES_SL: "match-features" (" ")* ":" (~["}","\n"])* ("\n")? > | < MATCHFEATURES_ML: "match-features" ()? "{" (~["}"])* "}" > | < MATCHFEATURES_ML_INHERITS: "match-features inherits " () ()? "{" (~["}"])* "}" > @@ -318,16 +318,16 @@ TOKEN : | < #BRACE_ML_LEVEL_3: "}" > | < #BRACE_ML_CONTENT: (~["{","}"])* > | < #SEARCHLIB_SKIP: ([" ","\f","\n","\r","\t"])+ > -| < RANKPROPERTIES: "rank-properties" > -| < RERANKCOUNT: "rerank-count" > -| < NUMTHREADSPERSEARCH: "num-threads-per-search" > -| < MINHITSPERTHREAD: "min-hits-per-thread" > -| < NUMSEARCHPARTITIONS: "num-search-partitions" > -| < TERMWISELIMIT: "termwise-limit" > -| < POSTFILTERTHRESHOLD: "post-filter-threshold" > -| < APPROXIMATETHRESHOLD: "approximate-threshold" > -| < KEEPRANKCOUNT: "keep-rank-count" > -| < RANKSCOREDROPLIMIT: "rank-score-drop-limit" > +| < RANK_PROPERTIES: "rank-properties" > +| < RERANK_COUNT: "rerank-count" > +| < NUM_THREADS_PER_SEARCH: "num-threads-per-search" > +| < MIN_HITS_PER_THREAD: "min-hits-per-thread" > +| < NUM_SEARCH_PARTITIONS: "num-search-partitions" > +| < TERMWISE_LIMIT: "termwise-limit" > +| < POST_FILTER_THRESHOLD: "post-filter-threshold" > +| < APPROXIMATE_THRESHOLD: "approximate-threshold" > +| < KEEP_RANK_COUNT: "keep-rank-count" > +| < RANK_SCORE_DROP_LIMIT: "rank-score-drop-limit" > | < CONSTANTS: "constants" > | < FILE: "file" > | < URI: "uri" > @@ -611,7 +611,7 @@ void fieldSet(ParsedSchema schema) : (( ( name = identifier() { fieldSet.addField(name); } ( name = identifier() { fieldSet.addField(name); } )* ) - | ( (queryCommand = identifierWithDash() | queryCommand = quotedString())) { fieldSet.addQueryCommand(queryCommand); } + | ( (queryCommand = identifierWithDash() | queryCommand = quotedString())) { fieldSet.addQueryCommand(queryCommand); } | matchSettings(fieldSet.matchSettings()) ) ()* )+ @@ -828,7 +828,7 @@ void structField(ParsedField field) : ParsedField structField; } { - name = identifier() { + name = identifier() { if (name != null && Schema.isReservedName(name.toLowerCase())) { throw new IllegalArgumentException("Reserved name '" + name + "' can not be used as a field name."); } @@ -920,7 +920,7 @@ void summaryTo(ParsedField field) : ParsedSummaryField psf; } { - [name = identifier()] destination = identifier() + [name = identifier()] destination = identifier() { psf = field.summaryFieldFor(name); psf.addDestination(destination); @@ -959,8 +959,8 @@ void weightedset(ParsedType fieldType) : { } */ void weightedsetBody(ParsedType type) : { } { - ( { type.setCreateIfNonExistent(true); } - | { type.setRemoveIfZero(true); } ) + ( { type.setCreateIfNonExistent(true); } + | { type.setRemoveIfZero(true); } ) } /** @@ -974,7 +974,7 @@ void rankType(ParsedField field) : String indexName = ""; } { - [indexName = identifier()] typeName = identifier() + [indexName = identifier()] typeName = identifier() { field.addRankType(indexName, typeName); } @@ -1052,18 +1052,18 @@ void attributeSetting(ParsedAttribute attribute) : } { ( - { attribute.setFastRank(true); } - | { attribute.setFastSearch(true); } - | { attribute.setFastAccess(true); } + { attribute.setFastRank(true); } + | { attribute.setFastSearch(true); } + | { attribute.setFastAccess(true); } | { attribute.setMutable(true); } | { attribute.setPaged(true); } - | { deployLogger.logApplicationPackage(Level.WARNING, "'enable-bit-vectors' is deprecated and void -> remove it. Will be removed in vespa-9"); } - | { attribute.setEnableOnlyBitVector(true); } + | { deployLogger.logApplicationPackage(Level.WARNING, "'enable-bit-vectors' is deprecated and void -> remove it. Will be removed in vespa-9"); } + | { attribute.setEnableOnlyBitVector(true); } | attributeSorting(attribute) | { String alias; String aliasedName=attribute.name(); } [aliasedName = identifier()] alias = identifierWithDash() { attribute.addAlias(aliasedName, alias); } - | str = identifierWithDash() { attribute.setDistanceMetric(str); } + | str = identifierWithDash() { attribute.setDistanceMetric(str); } ) } @@ -1119,7 +1119,7 @@ void summaryInFieldShort(ParsedField field) : psf = field.summaryFieldFor(name); } ( { psf.setDynamic(); } - | { psf.setMatchedElementsOnly(); } + | { psf.setMatchedElementsOnly(); } | ( | ) { psf.setFull(); } ) } @@ -1164,7 +1164,7 @@ void summaryItem(ParsedSummaryField field) : { } void summaryTransform(ParsedSummaryField field) : { } { ( { field.setDynamic(); } - | { field.setMatchedElementsOnly(); } + | { field.setMatchedElementsOnly(); } | ( | ) { field.setFull(); } ) } @@ -1298,7 +1298,7 @@ void queryCommand(ParsedField field) : String command; } { - ( command = identifierWithDash() | command = quotedString() ) + ( command = identifierWithDash() | command = quotedString() ) { field.addQueryCommand(command); } @@ -1352,7 +1352,7 @@ void exactTerminator(ParsedMatchSettings matchInfo) : String terminator; } { - terminator = quotedString() + terminator = quotedString() { matchInfo.setExactTerminator(terminator); } @@ -1363,7 +1363,7 @@ void gramSize(ParsedMatchSettings matchInfo) : int gramSize; } { - gramSize = integer() + gramSize = integer() { matchInfo.setGramSize(gramSize); } @@ -1374,7 +1374,7 @@ void matchSize(ParsedMatchSettings matchInfo) : int matchSize; } { - matchSize = integer() { + matchSize = integer() { matchInfo.setMaxLength(matchSize); } } @@ -1429,13 +1429,13 @@ void documentSummary(ParsedSchema schema) : ParsedDocumentSummary summary; } { - ( + ( name = identifierWithDash() { summary = new ParsedDocumentSummary(name); } [inheritsDocumentSummary(summary)] lbrace() ( - { summary.setFromDisk(true); } | - { summary.setOmitSummaryFeatures(true); } | + { summary.setFromDisk(true); } | + { summary.setOmitSummaryFeatures(true); } | documentSummaryItem(summary) | )* @@ -1532,9 +1532,9 @@ void indexBody(ParsedIndex index) : | str = identifierWithDash() { index.addAlias(str); } | str = identifierWithDash() { index.setStemming(Stemming.get(str)); } | arity = integer() { index.setArity(arity); } - | num = longValue() { index.setLowerBound(num); } - | num = longValue() { index.setUpperBound(num); } - | threshold = floatValue() { index.setDensePostingListThreshold(threshold); } + | num = longValue() { index.setLowerBound(num); } + | num = longValue() { index.setUpperBound(num); } + | threshold = floatValue() { index.setDensePostingListThreshold(threshold); } | { index.setEnableBm25(true); } | hnswIndex(index) { } ) @@ -1559,9 +1559,9 @@ void hnswIndexBody(HnswIndexParams.Builder params) : boolean bool; } { - ( num = integer() { params.setMaxLinksPerNode(num); } - | num = integer() { params.setNeighborsToExploreAtInsert(num); } - | bool = bool() { params.setMultiThreadedIndexing(bool); } ) + ( num = integer() { params.setMaxLinksPerNode(num); } + | num = integer() { params.setNeighborsToExploreAtInsert(num); } + | bool = bool() { params.setMultiThreadedIndexing(bool); } ) } void onnxModelInSchema(ParsedSchema schema) : @@ -1587,7 +1587,7 @@ OnnxModel onnxModel() : OnnxModel onnxModel; } { - ( name = identifier() { onnxModel = new OnnxModel(name); } + ( name = identifier() { onnxModel = new OnnxModel(name); } lbrace() (onnxModelItem(onnxModel) ()*)+ ) { return onnxModel; } } @@ -1606,10 +1606,10 @@ void onnxModelItem(OnnxModel onnxModel) : ( (path = fileItem()) { onnxModel.setFileName(path); } | (path = uriItem()) { onnxModel.setUri(path); } | - num = integer() { onnxModel.setGpuDevice(num, false); } | - num = integer() { onnxModel.setStatelessIntraOpThreads(num); } | - num = integer() { onnxModel.setStatelessInterOpThreads(num); } | - ( { onnxModel.setStatelessExecutionMode("parallel"); } + num = integer() { onnxModel.setGpuDevice(num, false); } | + num = integer() { onnxModel.setStatelessIntraOpThreads(num); } | + num = integer() { onnxModel.setStatelessInterOpThreads(num); } | + ( { onnxModel.setStatelessExecutionMode("parallel"); } | { onnxModel.setStatelessExecutionMode("sequential"); } ) | () { String name = token.image.substring(5, token.image.lastIndexOf(":")).trim(); @@ -1685,7 +1685,7 @@ void rankProfile(ParsedSchema schema) : ParsedRankProfile profile; } { - ( | ) name = identifierWithDash() + ( | ) name = identifierWithDash() { profile = new ParsedRankProfile(name); } [inheritsRankProfile(profile)] lbrace() (rankProfileItem(schema, profile) ()*)* @@ -1824,7 +1824,7 @@ void matchPhase(ParsedRankProfile profile) : MatchPhaseSettings settings = new MatchPhaseSettings(); } { - lbrace() (matchPhaseItem(settings) ()*)* + lbrace() (matchPhaseItem(settings) ()*)* { settings.checkValid(); profile.setMatchPhaseSettings(settings); @@ -1843,8 +1843,8 @@ void matchPhaseItem(MatchPhaseSettings settings) : | diversity(settings) | ( { settings.setAscending(true); } | { settings.setAscending(false); } ) - | num = integer() { settings.setMaxHits(num); } - | coverage = floatValue() { settings.setMaxFilterCoverage(coverage); } + | num = integer() { settings.setMaxHits(num); } + | coverage = floatValue() { settings.setMaxFilterCoverage(coverage); } | multiplier = floatValue() { settings.setEvaluationPoint(multiplier); } | multiplier = floatValue() { settings.setPrePostFilterTippingPoint(multiplier); } ) @@ -1895,7 +1895,7 @@ void firstPhase(ParsedRankProfile profile) : String exp; } { - lbrace() (firstPhaseItem(profile) ()*)* + lbrace() (firstPhaseItem(profile) ()*)* } void firstPhaseItem(ParsedRankProfile profile) : @@ -1906,8 +1906,8 @@ void firstPhaseItem(ParsedRankProfile profile) : } { ( expression = expression() { profile.setFirstPhaseRanking(expression); } - | ( keepRankCount = integer()) { profile.setKeepRankCount(keepRankCount); } - | ( dropLimit = floatValue()) { profile.setRankScoreDropLimit(dropLimit); } + | ( keepRankCount = integer()) { profile.setKeepRankCount(keepRankCount); } + | ( dropLimit = floatValue()) { profile.setRankScoreDropLimit(dropLimit); } ) } @@ -1918,7 +1918,7 @@ void firstPhaseItem(ParsedRankProfile profile) : */ void secondPhase(ParsedRankProfile profile) : { } { - lbrace() (secondPhaseItem(profile) ()*)* + lbrace() (secondPhaseItem(profile) ()*)* } /** @@ -1933,7 +1933,7 @@ void secondPhaseItem(ParsedRankProfile profile) : } { ( expression = expression() { profile.setSecondPhaseRanking(expression); } - | ( rerankCount = integer()) { profile.setRerankCount(rerankCount); } + | ( rerankCount = integer()) { profile.setRerankCount(rerankCount); } ) } @@ -1944,7 +1944,7 @@ void secondPhaseItem(ParsedRankProfile profile) : */ void globalPhase(ParsedRankProfile profile) : { } { - lbrace() (globalPhaseItem(profile) ()*)* + lbrace() (globalPhaseItem(profile) ()*)* } /** @@ -1959,7 +1959,7 @@ void globalPhaseItem(ParsedRankProfile profile) : } { ( expression = expression() { profile.setGlobalPhaseExpression(expression); } - | ( rerankCount = integer()) { profile.setGlobalPhaseRerankCount(rerankCount); } + | ( rerankCount = integer()) { profile.setGlobalPhaseRerankCount(rerankCount); } ) } @@ -2097,7 +2097,7 @@ void rankFeatures(ParsedRankProfile profile) : */ void ignoreRankFeatures(ParsedRankProfile profile) : { } { - { profile.setIgnoreDefaultRankFeatures(true); } + { profile.setIgnoreDefaultRankFeatures(true); } } /** @@ -2110,7 +2110,7 @@ void numThreadsPerSearch(ParsedRankProfile profile) : int num; } { - ( num = integer()) { profile.setNumThreadsPerSearch(num); } + ( num = integer()) { profile.setNumThreadsPerSearch(num); } } /** @@ -2123,7 +2123,7 @@ void minHitsPerThread(ParsedRankProfile profile) : int num; } { - ( num = integer()) { profile.setMinHitsPerThread(num); } + ( num = integer()) { profile.setMinHitsPerThread(num); } } /** @@ -2136,7 +2136,7 @@ void numSearchPartitions(ParsedRankProfile profile) : int num; } { - ( num = integer()) { profile.setNumSearchPartitions(num); } + ( num = integer()) { profile.setNumSearchPartitions(num); } } /** @@ -2149,7 +2149,7 @@ void termwiseLimit(ParsedRankProfile profile) : double num; } { - ( num = floatValue()) { profile.setTermwiseLimit(num); } + ( num = floatValue()) { profile.setTermwiseLimit(num); } } /** @@ -2162,7 +2162,7 @@ void postFilterThreshold(ParsedRankProfile profile) : double threshold; } { - ( threshold = floatValue()) { profile.setPostFilterThreshold(threshold); } + ( threshold = floatValue()) { profile.setPostFilterThreshold(threshold); } } /** @@ -2175,7 +2175,7 @@ void approximateThreshold(ParsedRankProfile profile) : double threshold; } { - ( threshold = floatValue()) { profile.setApproximateThreshold(threshold); } + ( threshold = floatValue()) { profile.setApproximateThreshold(threshold); } } /** @@ -2187,7 +2187,7 @@ void approximateThreshold(ParsedRankProfile profile) : */ void rankProperties(ParsedRankProfile profile) : { } { - lbrace() (LOOKAHEAD(rankPropertyItem() rankPropertyItem() ) + lbrace() (LOOKAHEAD(rankPropertyItem() rankPropertyItem() ) rankProperty(profile) ()+)* [rankProperty(profile)] } @@ -2250,7 +2250,7 @@ void fieldRankType(ParsedRankProfile profile) : String type; } { - name = identifier() type = identifier() + name = identifier() type = identifier() { profile.addFieldRankType(name, type); } } @@ -2597,31 +2597,31 @@ String identifier() : { } | | | - | - | - | + | + | + | | | | | - | + | | | - | - | + | + | | - | - | + | + | | - | - | - | + | + | + | | | |
| | - | + | | | | @@ -2629,7 +2629,7 @@ String identifier() : { } | | | - | + | | | | @@ -2637,19 +2637,19 @@ String identifier() : { } | | | - | + | | | | | - | + | | | | | - | - | - | + | + | + | | | | @@ -2658,7 +2658,7 @@ String identifier() : { } | | | - | + | | | | @@ -2666,21 +2666,21 @@ String identifier() : { } | | | - | + | | | - | - | - | - | + | + | + | + | | | - | - | + | + | | | | - | + | | | | @@ -2698,7 +2698,7 @@ String identifier() : { } | | | - | + | | | | @@ -2708,7 +2708,7 @@ String identifier() : { } | | | - | + | | | | -- cgit v1.2.3